Jump to content

Photo

Trouble with what I thought was a simple script trigger


4 replies to this topic

#1 IDontKnow

IDontKnow
  • Members
  • 13 posts

Posted 07 November 2018 - 06:11 AM

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

 

IF

  OR(2)
    See([CHARMED.HUMANOID.0.0])
    See([CONTROLLED.HUMANOID.0.0])

THEN

   

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.



#2 Miloch

Miloch

    Barbarian

  • Modders
  • 4819 posts
  • Gender:Male
  • Location:At Large

Posted 07 November 2018 - 08:16 PM

I don't know if I've done it quite like that, but last I checked (and it's been a while), I thought this worked:

 

StateCheck(LastSeenBy(),STATE_CHARMED)


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett


#3 IDontKnow

IDontKnow
  • Members
  • 13 posts

Posted 09 November 2018 - 06:34 AM

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?



#4 kjeron

kjeron
  • Members
  • 136 posts

Posted 09 November 2018 - 07:31 AM

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)
7:[REALLYCHARMED] (Charm)

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].

#5 IDontKnow

IDontKnow
  • Members
  • 13 posts

Posted 10 November 2018 - 04:11 PM

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. :)





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users