Jump to content

Trouble with what I thought was a simple script trigger


Recommended Posts

I'm trying to make a creature script in SoA/ToB that identifies Charmed creatures. Does anyone see a problem with this?






It never triggers, and I've tried all the variations of the Charm opcodes (5 & 241) aside from Controlled by Cleric.


I'm thinking the charm mechanic doesn't change the EA identifier.

Link to post

I'll try using that, then. I haven't decided yet exactly what I want the script to actually do so I'm not even totally sure what I want the triggers to do. The only thing I've settled on is that I want it to be able to differentiate between any number of Charmed/Unconscious/Stunned and so on creatures out of a group regardless of their relative positions for priority targeting.


Another option I considered was temporarily forcing a different identifier with opcode 72 (Set IDS State) to allow my See triggers to pick the Charmed creatures out... Is Specific.IDS used for anything? Could it be used for something like that?

Link to post

Who are you trying to detect as Charmed?


Those charmed by you and your allies end up with EA values:

5:[CONTROLLED] (Dire/Domination/Turning)



Those charmed by enemies end up with EA values:

254:[EVILBYCHARM] (Charm)

255:[ENEMY] (Dire/Domination/Turning)


Party members charmed by allies do not change EA value, they remain 2:[PC].

Link to post

Well this all started with me being bored and deciding to make a custom Animate Dead spell that would summon a skeletal Fighter, Archer and Mage at higher levels; the Mage's script being the cause of this thread.


I wanted the Mage to be able to pick Humanoids out of a group of assorted beasties and use Dire Charm on them before moving to a lower priority and blasting things with other spells. After everything else was dead the Skeletons would attack the Charmed creature. Since the Mage could (theoretically) be summoned by enemies it would have to work against PCs, too.


Now that I know things Charmed by Enemies and Allies end up with different EA values I should be able to get the desired behavior with no real difficulty... That said, my EA seems a bit simpler than the one you've posted. Probably since I'm not using BG:EE. My EA doesn't have a # 7 or 254. I checked in the game and the script was able to identify a Charmed party member as EA 255, so I imagine it works the other way around, too.


I'll play with the script some more (Eventually) and if I hit a snag I know where to go. :)

Link to post
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...