I am trying to run a mission with ALiVE and have the event handler run on every unit spawned. I have done it before with class Extended_Init_EventHandlers
and have had no problems before, but in this mission I want to only use Extended_Killed_EventHandlers
, since I only want the event handler to trigger when a unit dies. This is what I have so far...
description.ext
#define QUOTE(var1) #var1 class Extended_Killed_EventHandlers { class CAManBase { class SLX_XEH_INS_CAManBase_Init { killed = QUOTE(_this call INS_fnc_handleKilled;); }; }; };
It seems that it only works if the code it runs is not very demanding, for example. I ran the code below when a Civ is killed.
params["_unit","_killer"]; [format["%1 killed a %2",name _killer,name _unit],"systemChat",true,false,true] call BIS_fnc_MP;
But if it's more complex than that then it seems that the event handler doesn't function properly. I believe my issue may be related to this , but not sure. Has anyone else had this problem before?