Home   Help Search Login Register  

Author Topic: Deleting destroyed/dead obects via script  (Read 797 times)

0 Members and 1 Guest are viewing this topic.

Baphomet

  • Guest
Deleting destroyed/dead obects via script
« on: 11 Dec 2002, 07:26:13 »
I know this may sound a bit funny posting something that should be easily researched in the editors depot. However this is relevant to something other than simply removing bodies for multiplayer.

I was wondering if there is a scripting command that will allow me to just totally wipe dead bodies/destroyed vehicles off the playing field without having to specify each unit to be removed. Just a general removal of anything thats !=alive so to speak.

This is for a mission I'm making where at a certain point. I just want to remove all the aforementioned things as simply as possible.

Offline KTottE

  • Former Staff
  • ****
Re:Deleting destroyed/dead obects via script
« Reply #1 on: 11 Dec 2002, 11:55:32 »
There is a ready-made script (two scripts actually) that will remove all dead bodies after a set amount of time, and keep removing them at set intervals.

Check the ed depot for that.

And you might be able to tweak it to your liking.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

dreaming_adam

  • Guest
Re:Deleting destroyed/dead obects via script
« Reply #2 on: 11 Dec 2002, 17:46:59 »
Hey Baphomet,
My MP LAG ELIMINATOR tutorial (over in the editors section) will do exactally this. It removes both vehicle corpses as well as human ones - and additionally it doesnt require a single unit to be named and placed in an array.

I know it is in the multiplayer section, but it will work just as well on single player (tested)

I will be posting an example mission on the tutorial in time..

Cheers and I hope it works for ya

Adam

Baphomet

  • Guest
Re:Deleting destroyed/dead obects via script
« Reply #3 on: 12 Dec 2002, 02:36:12 »
Is there a way I  can just incorporate it into an existing script? Or perhaps just reference it. Basically it's to take place before a small cutscene to remove the bodies. I'll check it out. Although the thing I am concerned about is it running constantly when all I really need it to do is run once. Thats it.


I've taken a look at the lag eliminator script. Unfortunately I see a problem already that I wouldn't know how to deal with. I simply want to be able (at the very least). To exec a script and just have the bodies/wreckage deleted. Thats it. The instructions for your script require a trigger to be named "everyunit". It seems there is a reference to "everyunit" in the script, I suppose bypassing the necessity to exec anything (bad for me, good for anyone else, I guess). So I'm not sure how essential this "everyunit" designation is to the trigger. Can I just ignore it and will it still run the way it's supposed to?

I was hoping to have a trigger that runs a script of mine. This script will perform some cinematic effect like a black out when the trigger is activated (when there are no longer any enemies in the area). Then exec the body deleting script before continuing the rest of the cutscene. Now this may be strange putting this post in here as opposed to cam/cutscenes. However I'm not asking about anything specifically pertinent to that. I just want to know how to delete some dead guys.  :P
« Last Edit: 12 Dec 2002, 02:57:57 by Baphomet »

dreaming_adam

  • Guest
Re:Deleting destroyed/dead obects via script
« Reply #4 on: 14 Dec 2002, 03:26:03 »
unfortunately when an object is destroyed it is not picked up by triggers and such... This means that if you want to delete objects manually (which is what it sounds like your trying to do) you will have to deletevehicle objectname for each and every object. If you wanna script it cleanly Id suggest using an array, but either way will work.

I might be wrong, but as far as I know the only way you can issue functions to "destroyed" objects is by referencing directly to their name... to do that you need to know all their names (and that means either naming them seperately or manually storing each of the objects in an array).

Cheers and I hope this helps

Adam
BTW my lag eliminator script can be stopped by simply setting the global variable "gamestatus" equal to "FINISHED"