OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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?
-
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
-
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
-
Really? I've used it like 100's of times. Never encountered any problems with it. I suggest try again ;D
-
That works from a trigger, but does not seem to work from inside a script
It does work from inside a script
-
use:
deletevehicle(driver chopper)
deletevehicle(gunner chopper)
-
How about:
{deletevehicle _x} foreach crew chopper
That way, you also catch anyone in cargo, I think.
-
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
-
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.