Cleaning up empty vehicles?

Workshop for all Mission Engineer Comrades. Home of the FA Mission Making Template.
Post Reply
User avatar
Eagle_Eye
Posts: 209
Joined: Wed Feb 11, 2015 2:35 am
Location: Cork, Ireland

Cleaning up empty vehicles?

Post 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?

User avatar
wolfenswan
Posts: 1209
Joined: Wed May 25, 2011 4:59 pm

Re: Cleaning up empty vehicles?

Post 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.

User avatar
Eagle_Eye
Posts: 209
Joined: Wed Feb 11, 2015 2:35 am
Location: Cork, Ireland

Re: Cleaning up empty vehicles?

Post by Eagle_Eye »

Cheers Wolf,

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

Post Reply