NPCs or Monsters attacking selves with CombatLib

JonQ
15 Nov 2018, 22:54

With CombatLib, any given monster (or NPC) in my game will attack itself at random during various sessions of play instead of attacking the player. I have tried reloading the CombatLib files into my game folder, just to make sure I didn't tweak something I should not have, but even with completely original CombatLib files, it still does this.

I have isolated the problem by creating a brand new game without interference from any tweaks in my other (actual) game. All I did in this new game (just 3 rooms, 2 monsters, 1 NPC, nothing else at all, no descriptions or anything else) was add the NPCLib and CombatLib. I have the same problem.

The problem only occurs if you implement the 'friend' option whereby an NPC can fight alongside the player by using this starting script:

do (NpcName, "settodefend")

My guess is that somehow this 'settodefend' code is not updating lists (attackers or friends) correctly, or in some other way Quest is making the monster or NPC select itself as a target instead of other monsters. This addition of the 'settodefend' starting script was the lone factor that made monsters or NPCs attack themselves.

I did try to see if anyone else on the forums had problems like this, and indeed I found an unresolved topic along the same lines back in February: https://textadventures.co.uk/forum/quest/topic/ppcz9qjyp062hw0wvohvhw/problem-with-followers-in-pixies-combat-lib

I would love to have NPCs fighting alongside my player. Is this possible?