Home   Help Search Login Register  

Author Topic: deleting Units ingame to reduce lag  (Read 619 times)

0 Members and 1 Guest are viewing this topic.

terrazasjs

  • Guest
deleting Units ingame to reduce lag
« on: 09 Jun 2003, 23:46:40 »
i have this  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 is:
                    delbody.sqs

_u = _this select 0
~60
_u setpos [0,0,99999]
deletevehicle _u
exit
ofcourse you have to set them up in a note pad each of this scripts.
in the map i have to create a triger as big as the whole mission X=99999 and y=99999 and name it "EVERYUNIT"

then in the init field of every soldier or vehicle I have to write this code:"[] exec {clearcorpse.sqs}"or I can put this code too in the init sqs file and i think in this way it will affect every unit in the map,and i alraedy did all of this.

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 me the changes you make and attach me a little sample mission?

and once againg thank you for your time :)  

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:deleting Units ingame to reduce lag
« Reply #1 on: 10 Jun 2003, 00:35:19 »
u need 2 exec da 1st 1 (triger based) only 1

nd change it 2


Code: [Select]
@ count list EVERYUNIT > 0
~2
_eunit = list EVERYUNIT
#loop
"if (not alive _x) then {[_x] exec ""delbody.sqs""}" foreach _eunit
~1
goto "loop"

Code: [Select]
_u = _this select 0
~60
deletevehicle _u
exit


shud work - leave da trig da way it is

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

terrazasjs

  • Guest
Re:deleting Units ingame to reduce lag
« Reply #2 on: 10 Jun 2003, 04:09:41 »
okey do i need to put this codes in one notepad only and to replace this command:"[] exec {clearcorpse.sqs}"for this one:"[] exec {delbody.sqs}"because I want the script to affect all unit in the map, and how can I make this scrit work in the init.sqs file? ???

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:deleting Units ingame to reduce lag
« Reply #3 on: 10 Jun 2003, 04:57:06 »
no - its 2 scripts

exec like u execed da 1st ver

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

terrazasjs

  • Guest
Re:deleting Units ingame to reduce lag
« Reply #4 on: 10 Jun 2003, 06:33:03 »
okey I did everything and this time I dont have the error in the command line ,but nothing happens i kill a soldier and will stay there and will not desappear tell me are testing the script?try to do it and if you make this script works please send me a little sample mission :)

SteroidG

  • Guest
Re:deleting Units ingame to reduce lag
« Reply #5 on: 10 Jun 2003, 06:47:19 »
Why don't you use a little debug message in your script to see if it works?

I use <name of my player> globalChat "stuff I wanna report back"; To see if my script works.

the format command is very usefull to convert different variables to strings so globalChat can report it.

If I were you I'd at least put one in "delbody.sqs" to see if it got excuted or not.

Northener-PNE

  • Guest
Re:deleting Units ingame to reduce lag
« Reply #6 on: 28 Jul 2003, 15:33:43 »
I got it to work but thanks goes to LCD for getting me started. It was a fluke really. Try this as it works on my DM map i made.

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. In the "On Activation" box enter this : [] exec {delbody.sqs}     Bla Bla Bla....

STEP TWO:

Leave the editor and set up the following scripts.

clearcorpse.sqs

@ count list EVERYUNIT > 0
~2
_eunit = list EVERYUNIT
#loop
"if (not alive _x) then {[_x] exec ""delbody.sqs""}" foreach _eunit
~1
goto "loop"

delbody.sqs

_u = _this select 0
~20
deletevehicle _u
exit

I didn't put this in every soldiers init field :"[] exec {clearcorpse.sqs}" Just the one. Soldier S1 in my case.

It works fine. Thanks again LCD for the script. Your a star. ;D