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
-
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)
; 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:
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).
-
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.
-
is there anyway of having it reomve just any dead body on the map after 30 secs
-
i think everyone is capable to delete these lines for themselves if they don't want to have the smooth sink-into-ground effect:
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.
-
It didn't work for me ???
-
@Trash Can Man
a little bit more info would be nice...what didn't worked, did you get any error message?
-
actually, there was no error given.... I waited a whole minute and the body remained.
-
You placed down the terminator and the logic?
-
yes I did... ???
-
@ Trash Can Man
2 Questions:
What type of Unit you placed as "terminator"?
And surely you added the eventhandler to the unit?
-
for the terminator I used the ArmA version of spec ops.
Yes I did add an eventhandler to the unit
-
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:
-
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.
-
@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
-
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:
-
satexas69, do not double post.
Why is it that almost every single thread started I have to come and say that.. :no:
-
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 ??? ??? ???
-
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.
-
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
-
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.
-
Is there an easy war to remove dead bodies & vehicles without the need for AI ( for use in an AI free map ) ?
-
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
-
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;
this addeventhandler ["killed",{HideBody (_this select 0)}]
-
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.
-
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;
@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:player addeventhandler ["killed",{_this exec "delete.sqs"}]
-delete.sqs:
_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.
-
thanks, ill give it a go.