Author Topic: BROKEN!  (Read 617 times)

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
BROKEN!
« Reply #15 on: July 22, 2015, 02:52:51 pm »


               

Well just off hand I can tell you that you don't need the module switch for tag based items in there twice. Remove the redundency. When merging if two scripts use the exact same code it is usually best just to have one copy of the code. 



{
     object oItem = GetModuleItemAcquired();
     // * Generic Item Script Execution Code
     // * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
     // * it will execute a script that has the same name as the item's tag
     // * inside this script you can manage scripts for all events by checking against
     // * GetUserDefinedItemEventNumber(). See x2_it_example.nss
     if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
     {
        SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACQUIRE);
        int nRet =   ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
        if (nRet == X2_EXECUTE_SCRIPT_END)
        {
           return;
        }
}

I'll look more in depth later, but no reason for running the wheel twice.



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
BROKEN!
« Reply #16 on: July 22, 2015, 09:07:12 pm »


               


Well just off hand I can tell you that you don't need the module switch for tag based items in there twice. Remove the redundency. When merging if two scripts use the exact same code it is usually best just to have one copy of the code. 



{
     object oItem = GetModuleItemAcquired();
     // * Generic Item Script Execution Code
     // * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
     // * it will execute a script that has the same name as the item's tag
     // * inside this script you can manage scripts for all events by checking against
     // * GetUserDefinedItemEventNumber(). See x2_it_example.nss
     if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
     {
        SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACQUIRE);
        int nRet =   ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
        if (nRet == X2_EXECUTE_SCRIPT_END)
        {
           return;
        }
}

I'll look more in depth later, but no reason for running the wheel twice.




I so totally overlooked that one............


               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
BROKEN!
« Reply #17 on: July 22, 2015, 09:14:05 pm »


               


I so totally overlooked that one............




okay deleted the extra text but it does not really fix my problem since the items simply do not work.... I am really sorry for asking so much if I am but I am just trying to understand what I am doing wrong (and fix it :S)