OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: websnake on 03 Jul 2005, 22:40:02

Title: deadbody remover
Post by: websnake on 03 Jul 2005, 22:40:02
im making a mp mission and i want to put down about 100 men but i cant because it will lag to much when they get killed. Ive tried a few scripts to remove the dead bodys but none of them seem to work!!! can anyone help me please?
Title: Re:deadbody remover
Post by: ItsMeAgain on 04 Jul 2005, 00:04:10
Hi there

You can remove dead bodies using the deleteVehicle command...
that would need the units to have a name
I guess you dont like the thought to give all those units a name...

edit: maybe the foreach command could help

something like
"? !Alive _x: deleteVehicle _x" forEach units >Group<

doesnt works in a trigger (I tried) but maybe in a script ??? (IÂ'll try)
this way only the groups would need a name...

Well try looking in the online Command Reference for now
Hope that helped a little bit...

Title: Re:deadbody remover
Post by: websnake on 04 Jul 2005, 00:19:51
thanks mate, ill keep that in mind but like you said doing that will take ages, i got just over 100units  :-\ i tried using a script on here called eraser.sqs but when i put it on the mission it cant find it ???

thanks for the help anyways
Title: Re:deadbody remover
Post by: General Barron on 04 Jul 2005, 00:35:02
Here is a simple way to do it. First, make a trigger covering the whole mission area, activated by 'anybody present' (one time). In it's 'on activation' field, write:

{_x addeventhandler ["killed", {_this exec "killed.sqs"}]} foreach thislist

Then make a script titled "killed.sqs", and put the following inside of it:
Code: [Select]
~60
deletevehicle (_this select 0)
exit
The ~60 means that it will wait 60 seconds after the unit is killed, then it will delete it. If you want a shorter or longer delay, just change that number.
Title: Re:deadbody remover
Post by: websnake on 04 Jul 2005, 01:21:27
nice one mate  ;D works perfect