Un-profile units/groups?

  1. 8 years ago

    Hi,

    Is it possible to "un-profile" a unit?

    Context:
    I want to be able to capture units with ACE cable-tie and that once this happens they get removed from ALiVE cycle, so that if captured units are left alone by players, they won't get virtualized.

    I got a script that can deal with the "if (isCaptured) then{doStuff}" checks, but I don't know how to remove them from ALiVE's influence.

    Hope you can help me with that.

    Have a good day.

  2. Might be possible by just nullifying thr unit's data hash, will have to play around with it though. Although once you nullify thr data it's either gone forever or you'll have to store it in a serverside array with the civ's name in order to add it back later (not sure if this'll work properly).

  3. By looking at ALiVE's profile handler.
    Haven't tested it yet, but I think this could be a way to do it.

    _unit = _this select 0;
    
    _profileID = _unit getVariable "profileID";
    _profile = [ALIVE_profileHandler, "getProfile", _profileID] call ALIVE_fnc_profileHandler;
    [ALIVE_profileHandler, "unregisterProfile", _profile] call ALIVE_fnc_profileHandler;

    I guess I will need to do something equivalent for vehicles that are "captured" from the enemy.

  4. Edited 8 years ago by SpyderBlack723

    For civilians, you must get it's agentID using this method. Civilians and profiles are two different entities.

    _agent = _civ getVariable ["agentID", ""];

    You would then use this to unregister

    [ALIVE_agentHandler, "unregisterAgent", _agent] call ALIVE_fnc_agentHandler;
  5. Well in my case it's not about Civilians, more about regular soldiers (officers and other field leaders).

    Tho thanks for pointing this one, could come in handy.

  6. Ah, then yeah.. your solution would be fine.

 

or Sign Up to reply!