Search the Community
Showing results for tags 'upon'.
Found 1 result
-
Better alternative to "assignedTarget"
lawman_actual posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Looking for some advice on what functions to use. Currently I have attached a "FIRED" event handler to each member of a recon team. Once the trigger fires, it assesses what the unit is shooting at, and if the target belongs to the WEST side, it has 'positively identified' NATO in the area. //player sideChat (format ["%1",_this]); _unit = (_this select 0); _group = group _unit; _leader = leader _group; _target = assignedTarget _unit; player sideChat (format ["Target: %1",_target]); //player sideChat (format ["Side: %1",(side _target)]); //player sideChat (format ["Qrf1: %1",qrf1Sent]); //player sideChat (format ["Qrf2: %1",qrf2Sent]); if ((side _target) == WEST) then { if (reconOnSite) then { if (!qrf1Sent) then {_aaq = execVM "law\dispatchQrf1.sqf";}; if (!qrf2Sent) then {_aar = execVM "law\dispatchQrf2.sqf";}; }; } else { if ((reconOnSite) && (!qrf1Sent)) then {_aad = execVM "law\dispatchQrf1.sqf";}; }; Hence; if the recon team is only firing upon local militia, a small QRF is needed. If the recon team is in contact with NATO forces, a large one. The problem is that assignedTarget appears to rely upon the group leader specifically directing one of the units to fire upon the target. If the unit simply sees an enemy and fires of it's own initiative, the target is returned as 'objectNull' and the script fails. In most cases, this isn't a problem. But the recon team is only small, and if the group leader is killed before this happens it might cause problems. Is there a better way of assessing what the unit is firing at without having a target assigned?