Jump to content
Sign in to follow this  
davincy81

looking for Simple delete dead body script

Recommended Posts

Hello and moin moin,

im looking for a script that delete all the dead bodys on map.

I tried a few things from ArmA 1, but it seems that dont work for ArmA2 MP.

Thanks a lot for any ideas

davincy

Share this post


Link to post
Share on other sites
Hello and moin moin,

im looking for a script that delete all the dead bodys on map.

I tried a few things from ArmA 1, but it seems that dont work for ArmA2 MP.

Thanks a lot for any ideas

davincy

http://www.armedassault.info/index.php?game=1&cat=news&id=3405

I recommend using that... the F2 system is a great system for mission makers and has a wonderful customizable body removal system.

Share this post


Link to post
Share on other sites

OK thx HavocDemon! I will test this

I think i need one week to find the parts of this that i need for my map :confused:

is there not a more simple way?

Share this post


Link to post
Share on other sites

Here is a little script written by XENO.

clearCorpes.sqf

private ["_aU", "_dU"];
_aU = allUnits;

while {true} do {
  sleep 60;
  if (count _aU != count allUnits) then {
     _dU = _aU - allUnits;
     {hidebody _x} foreach _dU;
  };
  _aU = allUnits;
};

Share this post


Link to post
Share on other sites

Hi Imutep and thx,

i think thats more what im looking for.

how can i "exec" the .sqf? in any units init? or in all units init-line ?

( this exec "clearCorpes.sqf" )

Share this post


Link to post
Share on other sites

You need to execute it once. E.g. in the player's initline:

[] execVM "clearCorpses.sqf"

I'd like to suggest using F2 as well, though, as you have mayn other useful features and a readme that explains all the stuff. ;)

Share this post


Link to post
Share on other sites

yes, i check the F2-files atm. Im sure thats really good stuff!

Thx for helping guys!

Share this post


Link to post
Share on other sites
You need to execute it once. E.g. in the player's initline:

[] execVM "clearCorpses.sqf"

This produces an "Expected nothing" error.

this = execVM "clearCorpses.sqf"

...doesn't give me the "Expected nothing" error, but I also don't see corpses being deleted or hidden, either.

Script isn't working for me.

I wish you scripting geniuses could apply the same genius to writing instructions. Too often the student has to debug what the masters have taught him, and most of the time that seems to involve guessing what the secret handshakes are.

[uPDATE: Are script filenames case-sensitive? When I corrected the capitalization of the called script filename, I saw ONE corpse get hidden. There's plenty more scum on the streets needing to get deleted.]

Edited by Uziyahu--IDF

Share this post


Link to post
Share on other sites

add this to the init of any units

this addEventHandler ['killed',{_this execVM "AI_Cleaner.sqf"}];

AI_Cleaner.sqf

_ai = _this select 0;

sleep 60;

deletevehicle _ai;

it will delete any unit after 60 seconds when he dies

works in MP

Edited by Zonekiller

Share this post


Link to post
Share on other sites
For a one-time deletion of all dead corpses, do this:

{if (_x isKindOf "Man") then {deleteVehicle _x}} forEach allDead

If you want constant deletion of bodies as they die, try my brand new Remove Dead script:

http://forums.bistudio.com/showthread.php?t=113434

This is certainly the simplest solution. It's even in the wiki example for alldead:

{ deleteVehicle _x } forEach allDead;

To make it continual, just throw it into a while-do loop like this:

while {true} do {{if (_x isKindOf "Man") then {deleteVehicle _x}} forEach allDead; sleep 1; }:

Share this post


Link to post
Share on other sites

Probably a stupid question, my apologies. Is there an easy way to run this script in a trigger to keep the battlefield clear over the course of the mission?

Thanks.

Share this post


Link to post
Share on other sites
Probably a stupid question, my apologies. Is there an easy way to run this script in a trigger to keep the battlefield clear over the course of the mission?

Thanks.

yes, use spawn:

place this in a trigger, not repeated:

_null = [] spawn {while {true} do {{if (_x isKindOf "Man") then {deleteVehicle _x};} forEach allDead;sleep 1;};};

change sleep 1 to sleep 10 or 60 or how many seconds inbetween you want to check for dead units to delete.

btw DNK example while loop above had a colon at end instead of ;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×