Jump to content
Sign in to follow this  
CarlGustaffa

deleteVehicle on a whole convoy

Recommended Posts

Hi

In my "learning-to-make-missions" mission, we are flown out by some UH60's. Enroute we pass a convoy on the move just to have something interresting to look at.

I now have a two-trigger system that deletes all cargo (a different group moved into a 5t truck), crew, and vehicles.

Is it possible through some clever one-liners that can do all of this in one go, on trigger activation?

I was thinking in the lines of:

{deleteVehicle _x} forEach %Cargo,%Crew, and %Vehicles

Those % marks the spot where I'm not getting the syntax correctly, at least not for a oneliner command.

As I said, I have a working two-trigger system that works, but doesn't look good smile_o.gif, so this is just to feed my curiosity.

Edit: Typos

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

{deletevehicle _x} foreach ([truck] + crew truck)

truck is the name given to the vehicle

Share this post


Link to post
Share on other sites

Seems to work without naming anything as well...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

{deletevehicle _x} foreach ([thislist select 0] + crew (thislist select 0))

Share this post


Link to post
Share on other sites

I made it working as suggested (using the name), but I still have to deal with each separate vehicle.

Can I do mulltiple forEach loops within a line?

I.e. {_x deleteVehicle} foreach crew {thislist select _y} forEach vehicle thislist??? Have NO idea what such a syntax would be, and I'm getting nowhere. Just for fun though, would be nice to know smile_o.gif

Edit: Here is one that the engine don't like the syntax of (type code, expected array): This is what I ment with a one-liner; one line to delete all crew in all vehicles, pluss all vehicles. Basically just clear the area. Same goes with dead units if any within the trigger area (another similar problem).

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

{deletevehicle _x} forEach {([thislist select _x] + crew (thislist select _x))} forEach thislist

Share this post


Link to post
Share on other sites

Just wanted to confirm that {deletevehicle _x} foreach ([thislist select 0] + crew (thislist select 0)) seems to have worked for me - three helis are gone like in a Bermuda triangle.

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  

×