Home   Help Search Login Register  

Author Topic: Deleting Dead Bodies  (Read 2990 times)

0 Members and 5 Guests are viewing this topic.

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re:Deleting Dead Bodies
« Reply #15 on: 28 Nov 2002, 19:48:02 »


Ok well that answers my original question so you have been very helpful :)

Thanks for your help!

I'll let you know how I make out.

Hoz
Xbox Rocks

dreaming_adam

  • Guest
Re:Deleting Dead Bodies
« Reply #16 on: 28 Nov 2002, 19:57:38 »
Seeing as we are trying to REDUCE lag rather than create it, I have removed the sink into the ground part of the delbody script... Have a look at the tutorial again later on because it is updated for the final time lol.

Hope it all works out for you :)

Ciao Ciao

Adam

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re:Deleting Dead Bodies
« Reply #17 on: 02 Dec 2002, 20:00:56 »

Well I came up with something that works well for me and doesn't require continous loops check triggers and arrays :)

Here is what I did, and this helped with a tonne of dead bodies all over the place.

In the init part of the soliders that I wanted to dissappear I put this:

this addeventhandler ["killed", {_this exec "dead.sqs"}]

In the soldiers I created on the fly I added this to the "init".
Notice the double quotes.
this addeventhandler [""killed"", {_this exec ""dead.sqs""}]

I used some of the code from your script. :)
dead.sqs

; Select the Unit
_unit = _this select 0
;Delay the delete after death
~5
; Sink into the ground
_k = (getpos _unit) select 2
#loop
_k = _k - 0.1
_unit setpos [(getpos _unit) select 0,(getpos _unit) select 1,_k]
?(_k > -1):goto "loop"
; finally delete the vehicle
deletevehicle _unit
exit

Hope this helps others :)

Hoz
Xbox Rocks