So, I have used tag based scripts for quite a while but now im doing a tag based 'On Hit: Unique Power' script...
Lets get to the point:
Stripped down x2_mod_def_act (OnActivate script)
#include "x2_inc_switches"
void main()
{
object oItem = GetItemActivated();
object oPC = GetItemActivator();
[b]SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE);[/b]
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
Just an example. You see that the user defined event -whatever, is set here, in the module scripts.
This is the 'On Hit: UP' part of the default X2 tag based script template.
if (nEvent ==[b]X2_ITEM_EVENT_ONHITCAST[/b])
{
oItem = GetSpellCastItem();
oPC = OBJECT_SELF;
object oTarget = GetSpellTargetObject();
}
What the hell?
There is no module event for On Hit! There is no module script that will set the user event to this!
How will this bit of the script ever fire??
Modifié par Xardex, 28 juillet 2010 - 08:05 .