OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: LAPD on 25 Jan 2003, 16:54:40
-
I followed dreaming_adam's tutorial about deleting dead bodies in MP match. I did exactly what the tutorial says:
STEP ONE:
Insert a trigger central on the map. Set the x and y axis fields to 99999, set the ACTIVATION to ANYBODY, and set it to REPEATEDLY.
Next set its name to EVERYUNIT.
STEP TWO:
Leave the editor and set up the following scripts.
clearcorpse.sqs
#loop
_eunit = list EVERYUNIT
"?(!alive _x):[_x] exec {delbody.sqs} foreach _eunit
goto "loop"
exit
delbody.sqs
_u = _this select 0
~60
_u setpos [0,0,99999]
deletevehicle _u
exit
In the delbody.sqs file, the ~60 is the delay before the body will be removed.
Place these scripts in your missions folder (usually c:\program files\codemasters\operation flashpont\users\yourname\mpmissions\yourmissionname\ ) and then put "[] exec {clearcorpse.sqs}" in any units init field, or in INIT.SQS.
It dosen't work. When I tried changing something it slowed the game so much that I couldn't move. What to do?
Also, i did't understand the last line in the tutorial:
This script will work for units that are created runtime
Thanks :)
-
1) place the following line in your init.sqs file
[]exec "Clearcorpse.sqs"
then
2) insert the following scripts into your mission's folder
;;clearcorpse.sqs
?(!local server):exit
gamestatus = "RUNNING"
_n=-1
#loop
~62
?(count (list EVERYUNIT) < 2):goto "loop"
_curlist = list EVERYUNIT
#loop2
_n = _n + 1
?(!alive (_curlist select _n)): [(_curlist select _n)] exec "delbody.sqs"
?(_n < (count _curlist)):goto "loop2"
_n=0
?(gamestatus != "FINISHED"): goto "loop"
exit
;;delbody.sqs
_u = _this select 0
_u setpos [0,0,99999]
deletevehicle _u
exit
the wait 62 seconds (~62) is to stop dead flag runners from disappearing if there is a 60 second flag return delay
you can delay it by whatever you want
Basically every 6o seconds this cyscles and removes dead bodies
i dont see the point of having it recycle any quicker than once/ minute and even that may be a bit to often
there is no need for triggers etc
also of interest is Tacticians tutorial about removing ai created by the server when a player disconnects
-
Thanks Terox, that's great. :)
Topic solved. :D