OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: terrazasjs on 07 Jun 2003, 04:57:46
-
i have this MP mission that I making and I want to use a script to delete death bodies and vehicles but the script that I download from the script section doesn't work at all.
one goes like this:
clearcorpse.sqs
#loop
_eunit = list EVERYUNIT
"?(!alive _x):[_x] exec {delbody.sqs} foreach _eunit
goto "loop"
exit
and the next:
delbody.sqs
_u = _this select 0
~60
_u setpos [0,0,99999]
deletevehicle _u
exit
then in the init field of the init or in the init sqs file you suppost to write this code:"[] exec {clearcorpse.sqs}"
but the code doesn't work nither in the init field or in the init sqs file or i'm doing something wrong :hmm:
if you can make this script to work can you show mw the changes you make and attach me a little sample mission? :help:
and once againg thank you for your time :)
-
That looks like the lag eliminator script that's on this site somewhere. Correct?
I haven't used it before, but my guess is that you need to create a trigger with an area that covers the entire map. Name this trigger EVERYUNIT, and have it check for the presence of anyone.
That should get your script to work.
-
OK, why don't you test the scripts one by one?
1. Create your player and name it "mychar", thne create a soldier that you want to kill and test your script.
2. in the init field of the to be killed soldier, write down "this addEventHandler ["killed", {_this exec "delbody.sqs"}]"
3. Put a debug message below the "_u = _this select 0" in delbody.sqs something like:
"mychar globalChat "delbody.sqs got called";
mychar globalChat format ["%1 got killed", _u];"
4. if you recieve a message, and the guy who got killed is the guy you killed then it means that it got called and the "_u" variable is correct.
5. If the soldier doesn't die, change the ~60 to ~2 or simply delete the whole line to see if it's the time delay that's causing the problem.
btw, "_u setpos [0,0,99999]" doesn't help you at all, it dosn't reduce the lag or cpu load if not increase it, so I suggest you to remove it.
Once you're sure this script works, keep the debug message and I can show you how to test the other script.
I can't test your script where I am (since I don't have OFP installed at work) so I can only give you advice :).
-
You could try this script...
It seems that the script removes dead bodies randomly, missing some and removing others. Don't know why...
Give it a try if you want!