Author Topic: A Henchmen Problem  (Read 1486 times)

Legacy_Mephisto Gladius

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
A Henchmen Problem
« Reply #30 on: September 01, 2010, 03:14:02 am »


               Following Lilac Soul's Script Generator instructions it should look like this:


#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
switch (nEvent)
{
case X2_ITEM_EVENT_ACTIVATE:
ExecuteScript("ac_"+GetTag(GetItemActivated()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_EQUIP:
ExecuteScript("eq_"+GetTag(GetPCItemLastEquipped()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_UNEQUIP:
ExecuteScript("ue_"+GetTag(GetPCItemLastUnequipped())
, OBJECT_SELF); break;
case X2_ITEM_EVENT_ACQUIRE:
ExecuteScript("aq_"+GetTag(GetModuleItemAcquired()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_UNACQUIRE:
ExecuteScript("ua_"+GetTag(GetModuleItemLost()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_SPELLCAST_AT:
ExecuteScript("sp_"+GetTag(GetModuleItemLost()),
OBJECT_SELF); break;
case X2_ITEM_EVENT_ONHITCAST:
ExecuteScript("on_"+GetTag(GetSpellCastItem()),
OBJECT_SELF); break;
}
}

               
               

               


                     Modifié par Mephisto Gladius, 01 septembre 2010 - 02:14 .
                     
                  


            

Legacy_Redunct

  • Jr. Member
  • **
  • Posts: 85
  • Karma: +0/-0
A Henchmen Problem
« Reply #31 on: September 01, 2010, 03:25:38 am »


               I'm not seeing what's causing it. You're not executing the script anywhere else, are you? If not, then I'm stumped.

               
               

               
            

Legacy_Mephisto Gladius

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
A Henchmen Problem
« Reply #32 on: September 01, 2010, 03:27:28 am »


               No. The only way to execute this script is by acrivating the item. There's nothing about him in the mercenary's death script or anywhere...
               
               

               
            

Legacy_Redunct

  • Jr. Member
  • **
  • Posts: 85
  • Karma: +0/-0
A Henchmen Problem
« Reply #33 on: September 01, 2010, 03:32:23 am »


               Well, we can see if it's that's the problem by changing the name of the script and executing it straight from the onitemactivate.


In onItemActivate of the Module Properties:

if (GetTag(oItem)=="axs_mercreg")
{
executescript("//NEWSCRIPTNAME",OBJECT_SELF);
}


               
               

               


                     Modifié par Redunct, 01 septembre 2010 - 02:37 .
                     
                  


            

Legacy_Mephisto Gladius

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
A Henchmen Problem
« Reply #34 on: September 01, 2010, 03:34:46 am »


               Okay, now instead of the script executing 3 times.. It doesn't execute!

I'm starting to hate those henchmen...'Posted

Well... Tomorrow I will face this nightmare again..
               
               

               


                     Modifié par Mephisto Gladius, 01 septembre 2010 - 02:55 .
                     
                  


            

Legacy_Redunct

  • Jr. Member
  • **
  • Posts: 85
  • Karma: +0/-0
A Henchmen Problem
« Reply #35 on: September 01, 2010, 04:06:33 am »


               We can try this:

if (GetTag(oItem)=="axs_mercreg")

{

executescript("//NEWSCRIPTNAME",oItem);

}


               
               

               
            

Legacy_Mephisto Gladius

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
A Henchmen Problem
« Reply #36 on: September 01, 2010, 07:12:03 pm »


               It didn't worked again.. But wait, I think I found the problem... This may be at my OnItemActivate script... I'll check it..

Edit: All the time, the problem was with the OnItemActivate Script! I've fixed it, and now my Mercenary System is working! Thanks for the help guys 'Posted
               
               

               


                     Modifié par Mephisto Gladius, 01 septembre 2010 - 06:27 .