Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How to adress (unnamed) corpses?

  1. #1
    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.

    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?
    \"The future of life on earth depends on our ability to take action. Many individuals are doing what they can, but real success can only come if there's a change in our societies and our economics and in our politics. I've been lucky in my lifetime to see some of the greatest spectacles that the natural world has to offer. Surely we have a responsibility to leave for future generations a planet that is healthy, inhabitable by all species.\"

    \"Population growth is the single biggest threat to life on earth. No doubt at all. A great number of our major environmental problems [...] are caused by more and more human beings wanting the fresh air of the earth. I'm not one who says that you should let babies die or that you should deny the man in the Brazilian forest the right to grow food for his children, but if we do want a solution to the problem, the correct solution is population control.\"

    - Sir David Attenborough

  2. #2
    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.

  3. #3
    You can use "killed" event handler to do it.

    http://community.bistudio.com/wiki/addEventHandler

  4. #4
    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.

  5. #5
    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...

  6. #6
    oida ouk eidos raedor's Avatar
    Join Date
    Sep 30 2002
    Location
    Germany, Austria
    Posts
    5,284
    Try<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler &#91;&#34;killed&#34;, {hideBody &#40;_this select 0&#41;}&#93;[/QUOTE]

  7. #7
    Quote Originally Posted by (raedor @ Dec. 11 2006,22:27)
    Try<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler &#91;&#34;killed&#34;, {hideBody &#40;_this select 0&#41;}&#93;
    [/QUOTE]
    Thanks, it works now.

    I thought that with "this" (inside the eventHandler&#39;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&#33;




  8. #8
    <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[/QUOTE]


    Or something like that.
    Don&#39;t give me that same old pack of lies
    I&#39;ll tell you the story how it really is
    Want me to carry on?

  9. #9
    Quote Originally Posted by (cain2001 @ Dec. 11 2006,23:13)
    <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.[/QUOTE]
    But how do I delay a command within a script? Or can I use a countdown timer on the entire eventHandler somehow?

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

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

  10. #10
    oida ouk eidos raedor's Avatar
    Join Date
    Sep 30 2002
    Location
    Germany, Austria
    Posts
    5,284
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler &#91;&#34;killed&#34;, {_this select 0 execVM &#34;hideBody.sqf&#34;}&#93;[/QUOTE]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;[/QUOTE]

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •