Author Topic: Henchman interjection triggers destroyed before hiring henchman  (Read 422 times)

Legacy_okamimiyazaki

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0


               It's been a while since I've used the toolset and I don't have a ton of programming experience, so please don't mind if I sound clueless.

My issue is with non-random henchman interjection (and one-liner) triggers disappearing if I walk in them before even hiring the henchman (these are my own custom henchmen). I place the trigger on the ground: XP2 Interjection Non-random. I use x0_d2_hen_inter, etc. in the conversation editor and put the corresponding key tag and it works.

The problem is that once I walk into that trigger it destroys it *regardless* of if I have the henchman with me or not.
For example, say I have a room with a henchman in the middle and a trigger for an interjection in the corner. If I hire him, then walk to the corner, he starts the interjection. However, if I walk into the corner first, then hire him, then walk back to the corner, nothing happens (it's gone now). 

Is there a way to prevent this? I looked through some of the code in the scripts and noticed that they are destroying the triggers, but I want to prevent that if I don't have the henchman with me. Is there a different script I should use? (I'm using x2_evt_trigger on enter.) I'm not familiar with most of them.

Thanks.':wizard:'
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Henchman interjection triggers destroyed before hiring henchman
« Reply #1 on: July 26, 2011, 12:48:04 am »


               Chance the code for x2_evt_trigger to look like this.

#include "x0_i0_common"
#include "x2_inc_banter"

void main()
{
    object oTrigger = GetEnteringObject();
    if (GetIsPC(oTrigger) && GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oTrigger)))
    {
      string sTag = GetTag(OBJECT_SELF); // What kind of trigger am I?
      AttemptInterjectionOrPopup(OBJECT_SELF, sTag, oTrigger);
    }
}
               
               

               
            

Legacy_okamimiyazaki

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Henchman interjection triggers destroyed before hiring henchman
« Reply #2 on: July 26, 2011, 01:15:51 am »


                Perfect, it works!!! Thank you so much '<img'>