Arma 3
Code for deleting dead AI-bodies?
To the missions I soon will release I wish to have a code in the init-file that clean the map from dead bodies (all fractions, AI as well as players) so the total amount of bodies lies around is maximized to a certain number - for example 15 bodies.

I got the code below from a supportive coding Arma-friend but unfortunately that code seems to cause the multiplayer slots = respawnable AI, to create some kind of limitation on how many times they can respawn meaning after a while a my group consisting of 5 multiplayer slots = respawnable AI is reduced to zero. At that point they have respawned perhaps 3-5 times.

Note that I wish the code to work without using names on all AI (if possible)...

[] SPAWN { if (!isserver) exitWith {}; while {true} do { sleep 60; if (count alldeadMen > 15) then { _copy = + allDeadMen; _c = count _copy - 1; while {count alldeadMen > 15 && {_c >= 0}} do {if !((_copy select _c) in (switchableUnits + playableUnits)) then {deletevehicle (_copy select _c);}; sleep 0.1;_c = _c - 1;}; }; }; };

(Yes, I know that this subject seems to already exist in the forum but those threads do not have exactly my problem to solve.)
< >
Showing 1-2 of 2 comments
Irish_Bu11et Sep 15, 2014 @ 3:00pm 
Have you tried this? Description.ext - corpseManagerMode, corpseLimit[community.bistudio.com]



More info on how it works.
corpse removal manager[feedback.arma3.com]
The manager is used only for units that are respawned by in-game mechanic (AI in player slots and players, it's not used for units generated by scripts). We can expand the system for AI if you find it useful (but thats probably for another ticket :)
Its all units now (i.e. corpseManagerMode = 1) - read the link below.
corpseManagerMode[feedback.arma3.com]
Last edited by Irish_Bu11et; Sep 15, 2014 @ 3:09pm
MajorExperiMental Sep 16, 2014 @ 12:43am 
Yes I discovered that short after posting here.

Inspired of that I tested this (Low values for easy detect if it works):

Code:
corpseManagerMode = 1; corpseLimit = 3; corpseRemovalMinTime = 10; //seconds corpseRemovalMaxTime = 20; //seconds

I saw not many signs of it to work; at one point I saw 1 corps disappear in front of my eyes during the test with different values but other corpses seems untouched.... Does someone have a clue what to do?
Last edited by MajorExperiMental; Sep 16, 2014 @ 12:44am
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: Sep 13, 2014 @ 2:24am
Posts: 2