Home   Help Search Login Register  

Author Topic: Lag reductoin  (Read 504 times)

0 Members and 1 Guest are viewing this topic.

Jim666

  • Guest
Lag reductoin
« on: 15 Apr 2004, 21:36:52 »
ok i followed some tutorial about deleting the corpses but it doesnt work at all, can anyone help?

CopyrightPhilly

  • Guest
Re:Lag reductoin
« Reply #1 on: 16 Apr 2004, 01:19:41 »
i just make sure that any scipts that have no need to be running end...

dont know if this is any help..

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:Lag reductoin
« Reply #2 on: 16 Apr 2004, 02:48:45 »
Jim, i just guess now you're asking for 1.46...here's how it works (at least it did at my side)

name all you playable loons, like pl1, pl2, pl3....and so on.
for each playable loon you need a trigger:

size: 0
triggered repeatedly
condition: !alive pl1
on activation: [pl1] exec "delbody.sqs"


;delbody.sqs

_body = _this select 0
~20
deleteVehicle _body
 
exit


this should work for 1.46

For resistance, you can use eventhandlers to do this...just put in each loons init line:

this AddEventHandler ["killed",{[this] exec "delbody.sqs"}]

(eventhandlers aren't available at 1.46)
« Last Edit: 16 Apr 2004, 02:57:35 by myke13021 »

Tom Norman

  • Guest
Re:Lag reductoin
« Reply #3 on: 16 Apr 2004, 07:56:17 »
Sorry pal, you can't delete units which were in the level from the initialisation (ie. those units that you put in by hand and were not 'created' by a line of code).   :(

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:Lag reductoin
« Reply #4 on: 16 Apr 2004, 13:24:57 »
@Tom Norman

I'm affraid you're wrong. This code is well tested and works. You can delete ANY unit/Vehic, no matter if they were there from beginning or created during game.

Tom Norman

  • Guest
Re:Lag reductoin
« Reply #5 on: 16 Apr 2004, 14:04:11 »
Hey, check that out, you're right.  But are you sure it's not a new feature for Flashpoint?  Well then in that case, bollocks to that trigger idea, just execute the following script in whatever units you want to delete:

Code: [Select]
_Unit = _This select 0

@ !(Alive _Unit)
~20
DeleteVehicle _Unit
Exit

Simple as that.  Much the same as adding an event handler really, except you don't need to know anything about eventhandlers.   :P

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:Lag reductoin
« Reply #6 on: 16 Apr 2004, 20:52:52 »
@Tom Norman

yep, you're right, but i guess this wont work in a MP map for playable loons which will respawn.
The trigger method works well for this...i used this in some DM maps i made...no AI, just playable loons.

:edit:
i dunno if it's a new feature of OFP..at least on 1.46 maps it works and i don't think theres anyone around with a lower version of OFP ;D
« Last Edit: 16 Apr 2004, 20:53:53 by myke13021 »