there is a more efficient way of deleting bodies than having every unit run a timed delete script or utilising a fast looping trigger
This is how it would work
The deadbody array is filled via an eventhandler killed on each ai unit
The system uses one array to fill another, then waits a period before it deletes the bodies from the newly created array
It then removes the elements in the new array from the old array and restarts the loop
This way a dead body waits at least 120 seconds (+ 60 random seconds) after death before it is removed
It uses
this addEventHandler ["killed", {tx_deadbody = tx_deadbody + [_this select 0]}];; in the init field of each unit
This removes the problem of having multiple remove dead body scripts running
(Very efficient when you have a hundred or so AI to kill) but allows the dead units to remain on the map for at least X seconds.
Here's the system
Mission editorInit Field of each unitthis addEventHandler ["killed", {tx_deadbody = tx_deadbody + [_this select 0]}]
Init.sqs?(local server): [] exec "deadbody.sqs"
deadbody.sqs#INIT
tx_removebody = []
tx_deadbody = []
#START
tx_removebody = tx_deadbody
;; the following delay is the minimal amount of time you want a body to remain on the map
;; in the case below its between 2 and 3 minutes
~ 120 + (random 60)
{deletevehicle _x} forEach tx_removebody
tx_deadbody = (tx_deadbody - tx_removebody)
goto "START"
and heres a link to a random spawnpoint threadhttp://www.ofpec.com/yabbse/index.php?board=7;action=display;threadid=23209one day i will get around to publishing all my scripts for the editors depot