Author Topic: How can I modify this event trigger to fire only when variables match?  (Read 338 times)

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0


               I need the following script modified so the henchman only initiates a conversation if variables match. I'm not exactly sure how to do this...can someone help me out? Thanks!

//::///////////////////////////////////////////////////////
// X2_EVT_TRIGGER
/*
  This is the OnEntered script for the henchman trigger objects.
  It signals the event router that a given event has occured,
  by obtaining the key tag from the trigger and using that as
  the event number.

  Each trigger will only be activated once, and can only be
  activated by a PC.

  AUGUST 2003
  1. Code split. New script for new XP2 functionality


  MODIFIED BY BRENT, APRIL 2003
  1. Henchmen now trigger the trigger, not players
  2. Henchmen will only attempt to do the popup or intjereciton
      if the player and the henchmen meet he following requirements
        (a) Neither in combat
        ('B)' Neither in Conversation
        © Within 10 meters of each other
*/
//::///////////////////////////////////////////////////////
// May 26 2003: Make player trigger the interjection.
//    If henchmen is able to move, move them to player and
//    start interjection.
//    Destroy trigger regardless.

#include "x0_i0_common"
#include "x2_inc_banter"


void main()
{
object oEnter = GetEnteringObject();
if(GetLocalInt(GetModule(), "menzo2lionel") == 1)
{
ExecuteScript("x0_evt_trigger", OBJECT_SELF);
}
}
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
How can I modify this event trigger to fire only when variables match?
« Reply #1 on: June 25, 2012, 10:41:14 pm »


               #include "x0_i0_common"
#include "x2_inc_banter"


void main()
{
  object oEnter = GetEnteringObject();
  if(GetLocalInt(GetMaster(oEnter), "menzo2lionel") == 1  ) ExecuteScript("x0_evt_trigger", OBJECT_SELF);

}
 

 
               
               

               


                     Modifié par Lightfoot8, 26 juin 2012 - 02:12 .
                     
                  


            

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
How can I modify this event trigger to fire only when variables match?
« Reply #2 on: June 26, 2012, 02:20:10 am »


               Thanks Lightfoot. I should have been clearer. The way I need it to work is that the henchman initiates the conversation if the PC has the variable "menzo2lionel" and it equals 1.

I hope that helps.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
How can I modify this event trigger to fire only when variables match?
« Reply #3 on: June 26, 2012, 03:14:10 am »


               oops,   I meant to post the script down here.   But I edited the post above instead.
               
               

               
            

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
How can I modify this event trigger to fire only when variables match?
« Reply #4 on: June 26, 2012, 03:20:08 am »


               Ah, so its the function ExecuteScript that does it. Thanks! I'll have to remember that.