OK, found this and here's what I got so far:
[_unit] spawn
{
_unit = _this select 0;
waitUntil
{
sleep 1; captive _unit
};
_profileID = _unit getVariable ["profileID",""];
_profile = [ALiVE_profileHandler,"getProfile", _profileID] call ALiVE_fnc_hashGet;
[ALiVE_profileHandler, "unregisterProfile", _profile] call ALIVE_fnc_profileHandler;
};
Which I'm running as init on all ALiVE spawned units as linked in the first post. Units are unprofiled when captive and I get to carry them wherever I please. Tested it, it works. So far, so good.
What it doesn't do, however, is work with CQB-module spawned units.
Some more digging and this is where I'm at:
[_unit] spawn
{
_unit = _this select 0;
waitUntil
{
sleep 1; captive _unit
};
_house = _unit getVariable "house";
if (isNil "_house") then
{
_profileID = _unit getVariable ["profileID",""];
_profile = [ALiVE_profileHandler,"getProfile", _profileID] call ALiVE_fnc_hashGet;
[ALiVE_profileHandler, "unregisterProfile", _profile] call ALIVE_fnc_profileHandler;
} else
{
_group = createGroup (side _unit);
_house setVariable ["group",_group];
[ALiVE_CQB, "clearHouse", _house] call ALiVE_fnc_CQB;
};
};
What I'm trying to achieve here is to detect whether a unit was spawned by the CQB module (house variable present) and if so to mark the house as cleared upon setting the unit as captive, hopefully tricking the CQB module into deleting a newly created group instead. It seems to work only some of the time, certain units persist past the zone and certain ones despawn. I don't get it.