Home   Help Search Login Register  

Author Topic: Too many event handlers?  (Read 456 times)

0 Members and 1 Guest are viewing this topic.

deaddog

  • Guest
Too many event handlers?
« on: 07 May 2003, 03:50:06 »
I placed a "killed" event handler in the init line of about 20 armored units.  These call a burning vehicle script when activated.  No problems here.  Vehicle dies...Vehicle burns (and looks cool doing it)  8).

The problem comes when retrying a saved game.  The resulting lag is ferocious.  This happens even if no vehicles were destroyed.  I removed the eventhandlers and the lag disappeared after doing a retry.

Has anyone experienced this?   ???

Thanks  ;)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Too many event handlers?
« Reply #1 on: 07 May 2003, 03:55:00 »
it hapened 2 me  :-X

i think dat we shud avoid usin eventhandlers wen posivble ;D

like u can use not alive trigers (or script) 8) ;D

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

deaddog

  • Guest
Re:Too many event handlers?
« Reply #2 on: 07 May 2003, 04:00:48 »
Well, that stinks.  :)  at least it's not just me, though.

Quote
i think dat we shud avoid usin eventhandlers wen posivble
Or never die so we don't have to retry..  ;D

Thanks

*update*

this script does the same thing:

_u=[bmp1,shilka10,shilka1,brdm1,t80guard,bmp87,bmp5,bmp6,t72b,mi2,mi24_2,mi17_1,t72patrol1]
_u=_u+t72patrol2,bmppatrol1,bmppatrol2,brdm2,bh1,ah64_1,m113_1,m2a2_4,m2a2_3,m1a1_1,m1a1_2]
_u=_u+[m2a2_1,bh9,bmpdol]


#loop
?count _u==0 or !alive player:exit
~4
_v=[]
{if (!alive _x) then {_v=_v+[_x]}} foreach _u
?count _v > 0:_u=_u-_v;{[_x] exec "ultimatefire.sqs"} foreach _v

goto "loop"

Basically, I start with an array of all the vehicles I want to check.  When they are dead the burn script gets called for that vehicle.  It then gets deleted from the main array so it won't be checked again.  Plus, the more vehicles that are destroyed, the faster this will run.

« Last Edit: 07 May 2003, 04:48:47 by deaddog »