Home   Help Search Login Register  

Author Topic: Dead Body remover (OBSOLETE)  (Read 8076 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Dead Body remover (OBSOLETE)
« on: 17 Mar 2007, 12:30:25 »
As i'm was suggested to release this little script as standalone, here it is.

This script will let sink any dead unit into the ground and delete it after 30 seconds

It needs:
1 Gamelogic, named "Server"
1 Saboteur or Spetznaz, named "terminator. This unit can/shall be placed far away from every fighting area (tiny offshore island)

Code: [Select]
; remover.sqs
?! (local server): exit
_unit = _this select 0
~30
terminator action ["HIDEBODY", _unit]
~10
deletevehicle _unit
exit

Here the script call which goes in the init line of each unit you like to have deleted after its dead:
Code: [Select]
this addEventHandler ["killed", {_this exec "remover.sqs"}]


Spooner 2007-09-22: This has been obsoleted because the functionality has been re-submitted as part of myke13021's "Coop essentials" Package.
« Last Edit: 23 Sep 2007, 16:00:31 by Spooner »

Offline Cheetah

  • Former Staff
  • ****
Re: Dead Body remover
« Reply #1 on: 17 Mar 2007, 13:43:44 »
If you like the animation that the body is burried, use the terminator. You might want to add the possibility to just deleteVehicle the unit, that way there doesn't have to be a terminator guy.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline colligpip

  • Members
  • *
Re: Dead Body remover
« Reply #2 on: 17 Mar 2007, 17:05:15 »
is there anyway of having it reomve just any dead body on the map after 30 secs

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Dead Body remover
« Reply #3 on: 17 Mar 2007, 21:03:43 »
i think everyone is capable to delete these lines for themselves if they don't want to have the smooth sink-into-ground effect:

Code: [Select]
terminator action ["HIDEBODY", _unit]
~10

this way you can get rid off the terminator unit. But as i was often asked how to achieve the sink effect, i build it in.

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Dead Body remover
« Reply #4 on: 19 Mar 2007, 05:40:39 »
It didn't work for me  ???

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Dead Body remover
« Reply #5 on: 19 Mar 2007, 18:45:18 »
@Trash Can Man

a little bit more info would be nice...what didn't worked, did you get any error message?

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Dead Body remover
« Reply #6 on: 19 Mar 2007, 20:56:17 »
actually, there was no error given.... I waited a whole minute and the body remained.

Offline Cheetah

  • Former Staff
  • ****
Re: Dead Body remover
« Reply #7 on: 19 Mar 2007, 21:07:33 »
You placed down the terminator and the logic?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Dead Body remover
« Reply #8 on: 19 Mar 2007, 21:15:20 »
yes I did... ???

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Dead Body remover
« Reply #9 on: 19 Mar 2007, 22:34:28 »
@ Trash Can Man

2 Questions:
What type of Unit you placed as "terminator"?
And surely you added the eventhandler to the unit?

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Dead Body remover
« Reply #10 on: 19 Mar 2007, 23:34:55 »
for the terminator I used the ArmA version of spec ops.
Yes I did add an eventhandler to the unit

Offline satexas69

  • Members
  • *
Re: Dead Body remover
« Reply #11 on: 20 Mar 2007, 08:36:19 »
Myke -

Thanks for releasing this. Since the feature isn't built into the game (yet) as an option, I think it should be a mandatory add for every CTF or unit-heavy map.

The wonders it does in it's basic concept alone to remove server lag and general map processing is great.

- Kudos to you.


NOTE - You included the "nbs_dgc" directory in your syntax, but may confuse some that make a "remover.sqs" file using your code, and putting it in their main mission directory. You  may ned to "dumb down" your instructions or remove that reference (since it's stand-alone).

Also, I like it when authors put their handle in the comments, with maybe a version number (ie 1.0) so as time flies, we know who did it, and if our copy is current  :laugh:

Offline satexas69

  • Members
  • *
Re: Dead Body remover
« Reply #12 on: 20 Mar 2007, 08:45:12 »
Trash Can Man,

This script is very easy, you're likely over-thinking it.  :D

Make your terminator guy a "SF Sabetaur" if your going to use him as a BLUFOR guy (not that it matters if it's OPFOR or BLUFOR)

If you want him to be OPFOR, make him a "Spetznah"

Why? Cause he has to have "body-hiding" ability.

Make sure the script path is correct as I suggested in my previous post. In Myke's original example, he used a sub-directory in the INIT reference.. so create the directory and put the remover.sqs in there IF you follow his example exactly.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Dead Body remover
« Reply #13 on: 20 Mar 2007, 13:59:47 »
@satexas69

yep, the subfolder was my bad...just copy/pasted it and didn't checked for that issue. Fixed it now in the original post.

I don't see the reason of version number for this tiny seven liner. I'm also wondering why noone else already released such a script.

And i didn't put my name in it to mark: this is free to use, no copyrights or such intention...use it, edit it as you like, it wasn't a huge workload to write it so i don't care what happens with it. And surplus it would be ridiculous to ask for credits in the mission for this seven liner.

That's my gneral opinion for everything what i do...i write some scripts and surely there's always room for improvements and if you feel, you can do this improvements without asking me if you're allowed to. Only for my larger works like the DGC i would be happy for a little credit somewhere hidden in a fancy readme file  :D

Offline satexas69

  • Members
  • *
Re: Dead Body remover
« Reply #14 on: 20 Mar 2007, 17:26:36 »
Understood - I didn't mean put a name on it for credit, as much as I meant for reference....

Sometimes when I take apart a script to change it to do something else, it's nice to know who wrote the original so I can go to them and either thank them, ask them questions or let them know I used their script and updated it - letting them know the update in case they want it.

Like you, I release anything I write out to the community without care for fame or credit.. I'm just an anal guy that likes to be organized is allĂ‚  :D :laugh:
« Last Edit: 20 Mar 2007, 18:19:23 by bedges »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Dead Body remover
« Reply #15 on: 20 Mar 2007, 22:16:07 »
satexas69, do not double post.

Why is it that almost every single thread started I have to come and say that..  :no:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline satexas69

  • Members
  • *
Re: Dead Body remover
« Reply #16 on: 21 Mar 2007, 06:29:48 »
Huh? I didn't respond to myself...

One post was for myke and that discussion, one was for trashcan...

2 different conversations, one tread - is that REALLY that bad?

And I believe you've only ever warned me once before.. maybe you have me confused?

I even edit my own posts now for updates, have for weeks... I'm  ???  ???  ???

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Dead Body remover
« Reply #17 on: 21 Mar 2007, 08:43:19 »
i think what h- meant was that there's a double post in pretty much any thread started nowadays, not your threads in particular.

if you wish to answer points from many people, use one post and the @ symbol to identify whose point you are replying to. it keeps the forums free of clutter, such as these last 3 posts.

back on topic please folks.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re: Dead Body remover
« Reply #18 on: 23 Mar 2007, 10:28:36 »
I personally think the best dead body removal system, is one that
    a) works of a killed event handler
    b) The event handler script then
         b1) Adds the unit to a deadbody array
         b2) Counts the array
         b3) If the array count is above the count limit (Adjustable variable), then removes the first elements of the array until the count is acceptable

    This way you dont continuously run looping scripts and you keep enough dead bodies on the map for scavenging weapons etc

    far more efficient than
    ~120
    deletevehicle Deadman
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline satexas69

  • Members
  • *
Re: Dead Body remover
« Reply #19 on: 03 Apr 2007, 00:49:12 »
Terox,

True, but also false.

I don't "want" dead bodies lying around when I'm using unlimited respawn AND using Toad's script that gives you back the weapons you were holding when you died.

Besides, if you want bodies lying around, just set the "timer" to a much higher value.

Offline Rambo16AAB

  • Members
  • *
Re: Dead Body remover
« Reply #20 on: 06 Apr 2007, 20:06:03 »
Is there an easy war to remove dead bodies & vehicles without the need for AI ( for use in an AI free map ) ?

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re: Dead Body remover
« Reply #21 on: 06 Apr 2007, 20:14:24 »
Terox,

True, but also false.

I don't "want" dead bodies lying around when I'm using unlimited respawn AND using Toad's script that gives you back the weapons you were holding when you died.

Besides, if you want bodies lying around, just set the "timer" to a much higher value.


how you do it is entirely up to you, what i was trying to point out was, that any system that runs a "countdown timer" on an indivdual unit is not the most efficient system to use

eg 10 dead bodies with 10 looping scripts is far less efficient that no looping scripts

Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline FreeBird

  • Members
  • *
Re: Dead Body remover
« Reply #22 on: 07 Apr 2007, 10:28:27 »
Is there an easy war to remove dead bodies & vehicles without the need for AI ( for use in an AI free map ) ?


Yes,write in their init;

Code: [Select]
this addeventhandler ["killed",{HideBody (_this select 0)}]
Call [This,Birth,School,Work,Death]execVM "Storyofmylife.sqf"
(_this select 1)ObjStatus "DONE";(_this select 2)ObjStatus "DONE";(_this select 3)ObjStatus "ACTIVE";(_this select 4)ObjStatus "HIDDEN";
if not((_this select 0) IsKindOf "Human")ExitWith{PlayMusic"Goodbye Cruel World"}

Offline Rambo16AAB

  • Members
  • *
Re: Dead Body remover
« Reply #23 on: 07 Apr 2007, 11:24:27 »
Thanks.

Does this still require the SQS file from page 1 to work, or is this  all I need to do ?? ( not familure with scripting so please excuse the questions ).
Does that work for vehicles and will it stay in the Init after a respawn ??

thanks.

Offline FreeBird

  • Members
  • *
Re: Dead Body remover
« Reply #24 on: 07 Apr 2007, 13:50:19 »
Code: [Select]
this addeventhandler ["killed",{HideBody (_this select 0)}]is good for COOP missions,write it in the AI init field and they sink in the ground when killed (a la BF2)

**For MP missions with respawning players U better edit your respawnscript who will run anyway when killed;

Code: [Select]
@playerRespawnTime == 0
HideBody _unit

somewhere on the end of your script (_unit can be passed by EH killed -->_this select 0)

**If you have a very basic mission without respawnscript you can do it like this:
-in init.sqs:
Code: [Select]
player addeventhandler ["killed",{_this exec "delete.sqs"}]-delete.sqs:
Code: [Select]
_corpse = _this select 0
player removealleventhandlers "killed"
@playerRespawnTime == 0
HideBody _corpse
player addeventhandler ["killed",{_this exec "delete.sqs"}]
exit

Note:No doubt SQF will fit better here as this script will be executed many times.

EDIT:The vehicle question:U need DeleteVehicle _wreck (instead of HideBody _unit),but there is no "sink into the ground" effect.
Call [This,Birth,School,Work,Death]execVM "Storyofmylife.sqf"
(_this select 1)ObjStatus "DONE";(_this select 2)ObjStatus "DONE";(_this select 3)ObjStatus "ACTIVE";(_this select 4)ObjStatus "HIDDEN";
if not((_this select 0) IsKindOf "Human")ExitWith{PlayMusic"Goodbye Cruel World"}

Offline Rambo16AAB

  • Members
  • *
Re: Dead Body remover
« Reply #25 on: 07 Apr 2007, 23:25:46 »
thanks, ill give it a go.