OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: roscoe on 16 Jan 2004, 16:32:00

Title: deleting dead troops in op flash v.1.46
Post by: roscoe on 16 Jan 2004, 16:32:00
is there a script to delete the dead in the standard op flash or do i have to buy resistance coz i cant find one such script or a copy of resistance anywhere  :'(
Title: Re:deleting dead troops in op flash v.1.46
Post by: dmakatra on 16 Jan 2004, 17:42:43
I dunno man, but buy resitance, it's absolutley worth it.

:beat: *Gets Shot* :beat:
Title: Re:deleting dead troops in op flash v.1.46
Post by: Artak on 16 Jan 2004, 18:45:04
When was the deletevehicle command introduced?
I was reading the 1.3 unofficial command reference and couldn't see it in there.
Title: Re:deleting dead troops in op flash v.1.46
Post by: macguba on 16 Jan 2004, 18:53:33
Resistance is DEEPLY worth it, and pretty cheap these days.   It's not just all the new commands and the campaign but it opens up a whole new world of addons and user created missions.
Title: Re:deleting dead troops in op flash v.1.46
Post by: Planck on 16 Jan 2004, 20:29:57
deleteVehicle was added in version 1.34 according to the official command reference.


Planck
Title: Re:deleting dead troops in op flash v.1.46
Post by: Artak on 16 Jan 2004, 22:43:49
Well then I don't see any reason why deleting dead people wouldn't work in 1.46. If the ready-made scripts have some fancy stuff you can always try to modify them or even write your own deletion script, it shouldn't be too hard.
Title: Re:deleting dead troops in op flash v.1.46
Post by: m21man on 18 Jan 2004, 15:39:07
Yeah, but body deletion is best done with eventhandlers.
Title: Re:deleting dead troops in op flash v.1.46
Post by: roscoe on 20 Jan 2004, 18:28:38
no i cant do it still,  i tried! :'(  any ideas? or script snippets anyone can post? ???
Title: Re:deleting dead troops in op flash v.1.46
Post by: DrStrangelove on 20 Jan 2004, 21:41:00
In your init.sqs file create a global variable called soldiers:

soldiers=[]

Now, in your createunit script, add this after you create an entire group:

soldiers=soldiers + units _group

Now, create a new script called deletebodies.sqs (or whatever):

Code: [Select]
;deletebodies.sqs

#loop
~20

?count soldiers == 0:goto "loop"

_temp=[]

_i=0

#l1
_u=soldiers select _i

?!alive _u:_temp=_temp+[_u];deletevehicle _u

_i=_i+1
?_i<count soldiers:goto "l1"
 
soldiers=soldiers-_temp
goto "loop"

execute this script from your init.sqs file:

[] exec "deletebodies.sqs"

I haven't tested this so there is no guarantee, but give it shot. :)

Edit

Made a small change

Whole thread is here: http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=15118;start=0 (http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=15118;start=0)
Title: Re:deleting dead troops in op flash v.1.46
Post by: roscoe on 26 Jan 2004, 16:58:09
Whole thread is here: http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=15118;start=0 (http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=15118;start=0)

 ;Dcheers mate i'l give it a shot! ;D