Page 1 of 1

Cleaning up empty vehicles?

Posted: Mon Feb 23, 2015 11:00 am
by Eagle_Eye
Hey guys,

I'm working on a mission at the minute that is based on a mounted infantry platoon. Basically every element has a Hunter that they should spawn in at mission start.

However, currently all of the unslotted team's hunters also spawn, and will sit there for the rest of the mission, probably most notably is the helos, which 90% of the time will not be slotted. I notice that this doesn't happen from what I've seen in other FA missions. So how do you guys generally clean up any spare vehicles that aren't needed after slotting?

Re: Cleaning up empty vehicles?

Posted: Mon Feb 23, 2015 11:27 am
by wolfenswan
You can try putting this into the presence condition field of the hunter:

Code: Select all

!(isNil "UnitNATO_C1_FTL")
That would check if the relevant FTL exists and if not, delete the Hunter.
To check for the full group this would work:

Code: Select all

{!(isNil _x)} count ["UnitNATO_C1_FTL","UnitNATO_C1_AR","UnitNATO_C1_AAR","UnitNATO_C1_RAT"] >= 1
That one would spawn the Hunter if at least one member of the entire group is present.

Another option would be to run this at the end of the init.sqf:

Code: Select all

if (isServer) then {
{if (count crew _x == 0) then {deleteVehicle _x};} forEach [VehNATO_Car1,VehNATO_Car2]
};
VehNATO_Car1 etc. would be the names of the Hunters. This obv. only works if the Hunters are pre-mounted.

Re: Cleaning up empty vehicles?

Posted: Tue Feb 24, 2015 1:48 pm
by Eagle_Eye
Cheers Wolf,

I hadnt thought about the presence condition box, but of course thats exactly what Im looking for.