Detect Dead Bodies script by LAGGY v 0.9Actually gives the "Hide Body" action a reason to exist.
In my opinion a must in any infiltration or stealth mission.
This is a script that can recognize when a dead unit from a certain side or with a certain unitName is found by someone from a certain side, group or with a certain name.
The parameters are important. Through those you can customize the script for your mission purposes and set global effects if the conditions are met. Read the init.sqf and its instructions.
Based on eventhandler "killed"
Should be MP compatible - tested on dedi.
JIP behaviour still unknown.
Unless someone spots bugs or can suggest improvements, I concider this to be ready for submission.
IMPORTANT CHANGES in this version:
-Works also on vehicles like cars etc.
-Included an array called "LAGGY_FoundBodiesList" that contains all units (having the EH) that have been killed AND found under the set script conditions.
-Included the possibility of "Crucial Bodies", which means that you can check if specified units have been killed and found (based on unitName).
-Included the possibility of "Crucial Finders", which means that you can check if specified units have found any of the bodies (based on side,group and unitName).
-Included the possibility of "Crucial Bodies found by Crucial Finders", which means that you can check if the two are combined... defined Body found by defind Finder.
-Structured the init.sqf a little better.
-Updated example mission to be more informative and pedagogical.
Implementation: unit addEventHandler ["killed",{_this execVM "FindBody.sqf"}]Options and Parameters:
All EH units are when killed and found put in an array that can be called.
An array to include specified units to be killed and found with specified effects.
An array to include specified units that might find bodies and with specified effects.
Check if the specified bodies are found by specified finders and with specified effects.
Check for different combinations of "corpse side" and "finder side".
Possibility to change the "searched" radius around the corpses.
Possibility to choose "awareness level" of the searchers (based on knowsAbout command).
Possibility to limit the search to bodies that are killed by enemy fire, not by collisions or friendly fire.
KNOWN ISSUES:
The dead units side still has to be checked through config, since all dead units become CIVILIAN. Not much I can do about that.
This means that if you change the side somehow on a unit having this eventhandler, when it dies the "original config side" will be active as side of dead unit.
This is a minor issue I think. In those rare occasions, just name the unit and include his name in the array LAGGY_CrucialBodies. He will then be treated as special (see init.sqf).
The array LAGGY_CrucialFinders can help too, as well as putting LAGGY_FindBody_checkaccidents to true.
Just make sure his "side change" doesn't conflict with other interests in your mission.
DISCLAIMER: Use at your own risk, you know the drill.
Hope you find it useful.
Laggy
OFPEC DOWNLOAD