OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: myke13021 on 17 Mar 2007, 12:30:25

Title: Dead Body remover (OBSOLETE)
Post by: myke13021 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 (http://www.ofpec.com/forum/index.php?topic=30181.msg206827#msg206827).
Title: Re: Dead Body remover
Post by: Cheetah 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.
Title: Re: Dead Body remover
Post by: colligpip on 17 Mar 2007, 17:05:15
is there anyway of having it reomve just any dead body on the map after 30 secs
Title: Re: Dead Body remover
Post by: myke13021 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.
Title: Re: Dead Body remover
Post by: Trash Can Man on 19 Mar 2007, 05:40:39
It didn't work for me  ???
Title: Re: Dead Body remover
Post by: myke13021 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?
Title: Re: Dead Body remover
Post by: Trash Can Man on 19 Mar 2007, 20:56:17
actually, there was no error given.... I waited a whole minute and the body remained.
Title: Re: Dead Body remover
Post by: Cheetah on 19 Mar 2007, 21:07:33
You placed down the terminator and the logic?
Title: Re: Dead Body remover
Post by: Trash Can Man on 19 Mar 2007, 21:15:20
yes I did... ???
Title: Re: Dead Body remover
Post by: myke13021 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?
Title: Re: Dead Body remover
Post by: Trash Can Man 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
Title: Re: Dead Body remover
Post by: satexas69 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:
Title: Re: Dead Body remover
Post by: satexas69 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.
Title: Re: Dead Body remover
Post by: myke13021 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
Title: Re: Dead Body remover
Post by: satexas69 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:
Title: Re: Dead Body remover
Post by: h- 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:
Title: Re: Dead Body remover
Post by: satexas69 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  ???  ???  ???
Title: Re: Dead Body remover
Post by: bedges 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.
Title: Re: Dead Body remover
Post by: Terox on 23 Mar 2007, 10:28:36
I personally think the best dead body removal system, is one that
Title: Re: Dead Body remover
Post by: satexas69 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.
Title: Re: Dead Body remover
Post by: Rambo16AAB 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 ) ?
Title: Re: Dead Body remover
Post by: Terox 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

Title: Re: Dead Body remover
Post by: FreeBird 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)}]
Title: Re: Dead Body remover
Post by: Rambo16AAB 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.
Title: Re: Dead Body remover
Post by: FreeBird 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.
Title: Re: Dead Body remover
Post by: Rambo16AAB on 07 Apr 2007, 23:25:46
thanks, ill give it a go.