OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: madmedic on 28 Jan 2005, 10:33:59

Title: deleting the crew of a chopper
Post by: madmedic on 28 Jan 2005, 10:33:59
I am working on a script that replaces a downed chopper with a wrecked one (a wreck that I made that has a pilot and gunner in it)

The only problem is...when the original chopper is deleted, the pilot and gunner are NOT.
(They end up lying on the ground next to the wrecked chopper)
How do I delete the chopper AND its crew?
Title: Re:deleting the crew of a chopper
Post by: nominesine on 28 Jan 2005, 10:42:07
You use the letters D and G to single out the Driver and Gunner of any vehicle. Try this:

deleteVehicle chopper1; deleteVehicle chopper1G; deleteVehicle chopper1D
Title: Re:deleting the crew of a chopper
Post by: madmedic on 28 Jan 2005, 11:27:25
You use the letters D and G to single out the Driver and Gunner of any vehicle. Try this:

deleteVehicle chopper1; deleteVehicle chopper1G; deleteVehicle chopper1D

That works from a trigger, but does not seem to work from inside a script
Title: Re:deleting the crew of a chopper
Post by: nominesine on 28 Jan 2005, 12:01:01
Really? I've used it like 100's of times. Never encountered any problems with it. I suggest try again  ;D
Title: Re:deleting the crew of a chopper
Post by: THobson on 28 Jan 2005, 12:26:23
Quote
That works from a trigger, but does not seem to work from inside a script
It does work from inside a script
Title: Re:deleting the crew of a chopper
Post by: MachoMan on 28 Jan 2005, 12:34:28
use:

deletevehicle(driver chopper)
deletevehicle(gunner chopper)

Title: Re:deleting the crew of a chopper
Post by: General Barron on 28 Jan 2005, 15:46:28
How about:

{deletevehicle _x} foreach crew chopper

That way, you also catch anyone in cargo, I think.
Title: Re:deleting the crew of a chopper
Post by: THobson on 28 Jan 2005, 17:43:14
Quote
That way, you also catch anyone in cargo, I think
I am sure you know.  crew will indeed get anyone in the chopper even those in cargo
Title: Re:deleting the crew of a chopper
Post by: DrStrangelove on 30 Jan 2005, 14:14:13
I had some issues with deleting dead crew members. A good trick is to save the info of the crew members first, then move a gamelogic into all crew slots (the dead members fall out of the vehicle) and then deletevehicle all saved crew members.