Mongoose_84

How to adress (unnamed) corpses?

11 posts in this topic

I'm just experimenting and getting familiar with the editor and scripting, but now I can't seem to find a satisfying way to rid the battlefield of corpses. goodnight.gif

I can't get them via trigger ("list"), as it doesn't work on dead units. And if I adress them by their group, it sometimes happens, that they get deleted from it, before I can do so - resulting in every 10th (or so) unit to remain on the map.

And secondly: Does "hiding" bodies really make them disappear and therefore prevents performance from suffering or is there some other command I should use?

Can anyone help?

Share this post


Link to post
Share on other sites

I do not think hiding bodies makes them disappear just go underground. As for deleting dead bodies I know how to do it for ofp, but have not tried in arma. Use the delete vehicle command. There are lots of ways to delete them via scripts or triggers, Sorry I can't be of more help right now but I have to go. Just play around with delete vehicle and us the units name.

Share this post


Link to post
Share on other sites

Thanks for the replies

@ Victor_S.

I already tried using the deleteVehicle command instead and it worked, but it just doesn't look as smooth as "hiding" them. That's why I would prefer the hideBody command, IF the bodies get deleted that way, too... Maybe anyone knows for sure?

@ feersum.endjinn

I'm not yet familiar with event handling - gonna try it, thanks.

Share this post


Link to post
Share on other sites

okay...

can anyone please tell me, why this is working (as a unit's "init"-script):

this addEventHandler ["killed", {hideBody unit_name}]

.. and this is not:

this addEventHandler ["killed", {hideBody this}]

? Because, if i have to name every unit that is created, it doesn't really help...

Share this post


Link to post
Share on other sites

Try<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["killed", {hideBody (_this select 0)}]

Share this post


Link to post
Share on other sites
Try<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["killed", {hideBody (_this select 0)}]

Thanks, it works now.

I thought that with "this" (inside the eventHandler's script) i would refer to the unit that the script is run on, but if it refers to the eventHandler itself, then your suggestion makes perfect sense, of course.

So, thanks again!

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; Select the Unit

_unit = _this select 0

;-Delay the delete after death

~120

; delete the unit

deletevehicle _unit

exit

Or something like that.

Share this post


Link to post
Share on other sites
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; Select the Unit

_unit = _this select 0

;-Delay the delete after death

~120

; delete the unit

deletevehicle _unit

exit

Or something like that.

But how do I delay a command within a script? Or can I use a countdown timer on the entire eventHandler somehow?

I'd like the script to wait a few secs first, then hide the body and eventually delete it.

I've been trying to use loops and the "_time" variable, but that can't be it...

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["killed", {_this select 0 execVM "hideBody.sqf"}]And then the hideBody.sqf:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">sleep 20;

hideBody _this;

Share this post


Link to post
Share on other sites
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["killed", {_this select 0 execVM "hideBody.sqf"}]
And then the hideBody.sqf:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">sleep 20;

hideBody _this;

thank you once more!

i made it:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

sleep 60;

hideBody _this;

sleep 5;

deleteVehicle _this;

and it seems to work just fine

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