Home   Help Search Login Register  

Author Topic: need help fast  (Read 448 times)

0 Members and 1 Guest are viewing this topic.

Sol Fire

  • Guest
need help fast
« on: 25 Feb 2003, 09:32:48 »
need some help fast..

Quote
by dreaming_adam

Recommended for OFP version 1.75 (OFP: Resistance).

Views: 851

   

The following will remove any objects that have been destroyed after a predetermined delay. That means, if you kill somebody on a MP map, the body will dissapear after x seconds - preventing lag created by a huge mass of useless objects. This script will work for ALL units that are not apart of the landscape. That means, if you blow up a tank, after x seconds the tank will be removed. I have tested this and it works for tanks, infantry, helos, planes, boats, and buildings that you place IN the editor using the object addon.

It is relatively easy to exclude objects from the script, so that a particular objects carcus will remain on the map.

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.

VIOLA!!!

This script will work for units that are created runtime, and units do not have to be given names.



i used this but it gave me errors.. anyone give me a "how To" on this thing?

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:need help fast
« Reply #1 on: 25 Feb 2003, 09:52:47 »
fast help:


I think the script explains it self, but there seems to be an error in this line

"?(!alive _x):[_x] exec {delbody.sqs} foreach _eunit

should propably be

"?(!alive _x):[_x] exec {delbody.sqs}" foreach _eunit

or

?(!alive _x):[_x] exec {delbody.sqs} foreach _eunit

or

?(!alive _x):"[_x] exec {delbody.sqs}" foreach _eunit



if that won't work, give us the error message and we know more how to fix it.
« Last Edit: 25 Feb 2003, 09:53:14 by Artak »
Not all is lost.

Sol Fire

  • Guest
Re:need help fast
« Reply #2 on: 25 Feb 2003, 11:43:10 »
it doesnt give me an error anymore when i use the first fix you suggested..

but it doesnt seem to be working.. well i will know more when i work on it later right now its 1:30 am im tired and if im going to get up around 12:00 like normal i got to get to sleep.. cya later

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:need help fast
« Reply #3 on: 25 Feb 2003, 12:39:21 »
try dis line

"if (not alive _x) then {[_x] exec {delbody.sqs}" foreach _eunit


and make sure u have array dere ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Sol Fire

  • Guest
Re:need help fast
« Reply #4 on: 26 Feb 2003, 00:22:36 »
thanks that works