Jump to content
Sign in to follow this  
stephen271276

Delete units from an unused side mission?

Recommended Posts

Is it possible to delete all editor placed objects within a marked area using a script?

I have multiple side missions which the player can choose to accept/decline, so if the player decides not to accept id like to delete the units and object iv placed for this sidemission. I know how to do it one by one delteVehicle unitname etc, but surely theres a quicker way?

Share this post


Link to post
Share on other sites

This will be a little slow and resource intensive, but it will work if you dont know the names of the units.

{if (side _x == East) && ((_x distance _mysidemisson) <  100) then {deleteVehicle  _x;};} forEach allUnits;

A better way would be to name the objects in the editor, then make an array with their names.

_my_SM_array = [b1,b2,b3,etc..];

{deleteVehicle  _x;} forEach _my_SM_array;

Share this post


Link to post
Share on other sites

even better way since you use accepted/decline.

DONT spawn any units at sidemission until accepted!!

Or when spawned collect all spawned items/objects/units/vehicles from whatever script you use for side missions in a array and delete all in array if declined.

Share this post


Link to post
Share on other sites

Demonized is right. Just spawn stuff if you use it.

I found something helpful to get rid of an area of objects:

I placed a gamelogic called "sidemission" at the center of the area I want to delete and create a trigger with the following On Act.

{deleteVehicle _x} foreach (position sidemission nearEntities 200); {deleteVehicle _x} foreach (position sidemission nearObjects 200);

Deletes even furniture and crews of vehicles.

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  

×