OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CopyrightPhilly on 06 May 2005, 00:01:28

Title: delete unit not the vehicle...
Post by: CopyrightPhilly on 06 May 2005, 00:01:28
hey chaps

what i want to do is delete the unit but not the vehicle IF they are in one...

I'm trying to do with a trigger:
"deletevehicle _x" Foreach thislist

but this will delete the vehicle as well...
any ideas?

cheers,
Phil
Title: Re:delete unit not the vehicle...
Post by: Planck on 06 May 2005, 00:11:14
Not sure if this would work, but......

deletevehicle vehiclenamed    .....for driver
deletevehicle vehiclenameg    .....for gunner
deletevehicle vehiclenamec    .....for commander


As I said, I'm not sure if it will work.....and I have no clue about cargo.


Planck
Title: Re:delete unit not the vehicle...
Post by: Flauta on 06 May 2005, 03:01:00
I think It should work...

this is the Full Thing:



Code: [Select]
"deletevehicle driver  _x" Foreach thislist; "deletevehicle gunner  _x" Foreach thislist; "deletevehicle commander  _x" Foreach thislist
chek it!

 
Title: Re:delete unit not the vehicle...
Post by: UNN on 06 May 2005, 03:22:17
You can use nested ForEach commands:

Code: [Select]
{{DeleteVehicle _x} ForEach (Crew _x)} ForEach ThisList
But I think you might CTD if you try and delete the crew straight out of a vehicle, you might have to SetPos them out first with a slight pause.

Code: [Select]
{{[_x] Exec "Eject.sqs"} ForEach (Crew _x)} ForEach ThisList
Eject.sqs

Code: [Select]
_Unit=_This Select 0
_Unit SetPos [0,0,0]
@(_Unit==Vehicle _Unit)
DeleteVehicle _Unit