EventHandlers

  1. 6 years ago

    Hi there,

    so I'm trying to build a statistics tracking function for my mission, everytime I've tested it so far is with spawning the AI through Zeus and everything works fine. However, I just discovered today that if I shoot an AI spawned in with alive the event handler no longer works.

    I just want to know if it's even possible to add event handler for the AI's being spawned in by Alive itself or if it doesn't work at all. Because every eventhandler added to the server works fine by itself besides when it interacts with alive.

    here are the current event handler I've got running on my mission

    player addEventHandler ["Fired", {_this call alive_fnc_handleFired;}]; // Works Fine
    ["CAManBase", "Hit", {_this call alive_fnc_handleHit;}] call CBA_fnc_addClassEventHandler;
    ["CAManBase", "Killed", {_this call alive_fnc_handleKill;}] call CBA_fnc_addClassEventHandler;

    None of the CBA event handlers works with the alive mod, only if I spawn with Zeus or add the AI's from the editor. I've tried adding them with the original event handlers from arma "addEventHandler" but at that point it didn't work at all when I tested it, all though I only tested it with Zeus

    Any ideas?

  2. Tupolov

    2 Jul 2017 Administrator

    We have stats tracking in ALiVE already (as well as AAR) if that helps?

    We don't do anything different wrt EH, we use the standard BIS way of adding EH for our mod. For example:

    class Extended_Killed_Eventhandlers
    {
        class LANDVEHICLE
        {
            class alive_sys_statistics
            {
                killed = "_this call alive_sys_statistics_fnc_unitKilledEH";
            };
        };
        class MAN
        {
            class alive_sys_statistics
            {
                killed = "_this call alive_sys_statistics_fnc_unitKilledEH";
            };
        };
        class AIR
        {
            class alive_sys_statistics
            {
                killed = "_this call alive_sys_statistics_fnc_unitKilledEH";
            };
        };
        class SHIP
        {
            class alive_sys_statistics
            {
                killed = "_this call alive_sys_statistics_fnc_unitKilledEH";
            };
        };
    };
 

or Sign Up to reply!