Jump to content
Sign in to follow this  
Tracker_uk

Detecting a object being deleted

Recommended Posts

hi,im wondering if theres a way to detect if say"object1"&"object2"got deleted im deleting everything in an area after blufor leaves\dies if they die theyre object will delete and wont be available but task still there "object1"is spawned in "object2"is placed via editor

any help or advice appreciated

Share this post


Link to post
Share on other sites

My way to make sure things get deleted is to "register" them in the missionNamespace after creation like that:

missionNamespace setVariable ["mission_myObject", _yourObject];

If you delete the respective object then it disappears from the missionNamespace. The returnvalue is objNull. So what you could do is:

if(isNull (missionNamespace getVariable "mission_myObject")) then
{
 //do your spawn stuff here
};

EDIT: Updated as the previous if-statement was bullshit. ^_^

Edited by waltenberg

Share this post


Link to post
Share on other sites

And as another alternative I do believe a simple: !alive object, would also suffice, depending on what exactly it is, I use this for collecting of intel, or destruction of radio towers, etc. so...

In trigger Condition Field:

!alive object1 && !alive object2;

In a script checking it:

if !(alive object1 && object2) then {....};

Edited by JShock

Share this post


Link to post
Share on other sites
... deleting everything in an area after blufor leaves\dies if they die theyre object will delete and wont be available but task still there "object1"is spawned in "object2"is placed via editor

Your post is all over the place lol. Anyhow..

Something like this.

waitUntil {{alive _x} count units bluGrp == 0 || {{object1 distance _x > 100} forEach units bluGrp}}; // waituntil the blufor group is dead or far enough away
_objPos = getPosATL object1; // store the objects position
deleteVehicle object1; // delete the object
sleep 1; // wait 1 second before creating the new object 
object2 = "Land_Bricks_V2_F" createVehicle _objPos; // create the new object

Edited by Iceman77

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×