Mongoose_84 0 Posted December 10, 2006 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? Share this post Link to post Share on other sites
Victor_S. 0 Posted December 11, 2006 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
feersum.endjinn 6 Posted December 11, 2006 You can use "killed" event handler to do it. http://community.bistudio.com/wiki/addEventHandler Share this post Link to post Share on other sites
Mongoose_84 0 Posted December 11, 2006 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
Mongoose_84 0 Posted December 11, 2006 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
raedor 8 Posted December 11, 2006 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
Mongoose_84 0 Posted December 11, 2006 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
cain2001 0 Posted December 11, 2006 <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
Mongoose_84 0 Posted December 11, 2006 <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
raedor 8 Posted December 11, 2006 <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
Mongoose_84 0 Posted December 12, 2006 <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