Extended Killed EventHandlers not working

  1. 8 years ago

    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?

  2. Edited 8 years ago by SpyderBlack723

    Sounds very related depending on how demanding your executed code is.

    I guess just use Extended_Init_EventHandlers and then apply a killed eventhandler to the unit. Not the desired method obviously due to being ran on init, but may work for a temporary patch until this could be fixed if it is related.

    May also be worth raising it in the CBA thread, looks like it hasn't been touched in awhile and it may bring it into discussion again.

  3. Edited 8 years ago by DaVidoSS

    put the code into function and use like this:

    	
    class Extended_Init_EventHandlers	{
    	 
    	
    	
             class LOP_Tak_Civ_Man_01 {
    	
    		init = "(_this select 0) call INS_fnc_ckcivEH";
    		
    	};
    	class LOP_Tak_Civ_Man_02 {
    	
    		init = "(_this select 0) call INS_fnc_ckcivEH";
    		
    	};
    	class LOP_Tak_Civ_Man_04 {
    	
    		init = "(_this select 0) call INS_fnc_ckcivEH";
    		
    	};
    
    };
  4. Edited 8 years ago by SpyderBlack723

    Thats what he's doing, reference his description.ext section.

    #define QUOTE(var1) #var1

    class Extended_Killed_EventHandlers {
    class CAManBase {
    class SLX_XEH_INS_CAManBase_Init {
    killed = QUOTE(_this call INS_fnc_handleKilled;);
    };
    };
    };

 

or Sign Up to reply!