[Snippet] Deleting a vehicle + crew on waypoint activation

Party-approved future science plus handbooks for the revolution
Post Reply
User avatar
wolfenswan
Posts: 1208
Joined: Wed May 25, 2011 4:59 pm

[Snippet] Deleting a vehicle + crew on waypoint activation

Post by wolfenswan » Fri Mar 22, 2013 11:13 am

This code snippete deletes the vehicle and it's entire crew. Useful for getting rid of for example insertion helicopters or ambient vehicles that have served their purpose:

Code: Select all

{deleteVehicle _x} forEach thislist + [vehicle (thislist select 0)] + crew (vehicle (thislist select 0));
code goes in the On Act. field of the waypoint.

User avatar
SuicideKing
Host
Posts: 309
Joined: Wed Nov 27, 2013 1:29 pm
Location: India/Netherlands
Contact:

Re: [Snippet] Deleting a vehicle + crew on waypoint activati

Post by SuicideKing » Mon Oct 05, 2015 8:34 am

Slight variation, more compact:

Code: Select all

{deleteVehicle _x} forEach (crew vehicleName); deleteVehicle vehicleName;
themiddlevoid.wordpress.com

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

Re: [Snippet] Deleting a vehicle + crew on waypoint activati

Post by wolfenswan » Mon Oct 05, 2015 10:31 am

It works but that way you have to assign a unique name to each vehicle and modify each waypoint. First variant allows simple copy-paste.

User avatar
SuicideKing
Host
Posts: 309
Joined: Wed Nov 27, 2013 1:29 pm
Location: India/Netherlands
Contact:

Re: [Snippet] Deleting a vehicle + crew on waypoint activati

Post by SuicideKing » Tue Oct 06, 2015 9:17 am

Ah, I see, thanks!

I had thought using "this" instead of vehicle name would work (was using names anyway), but it causes the crew to jump out and the helo crashes. :lol:
themiddlevoid.wordpress.com

Post Reply