Ice_Rhino 3 Posted September 5, 2013 Is it possible and if so how, to count the amount of remaining enemies within a trigger area and display the result? Thanks in advance Share this post Link to post Share on other sites
kylania 568 Posted September 5, 2013 (edited) _aliveInTrigger = {[triggerName, _x] call BIS_fnc_inTrigger && side _x == opfor && alive _x} count AllUnits; hint format ["There are %1 bad dudes alive in the trigger", _aliveInTrigger]; Edited September 5, 2013 by kylania Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 5, 2013 Thanks kylania, Where do I place the code and how does it fire, Radio Call?? Share this post Link to post Share on other sites
kylania 568 Posted September 5, 2013 Depends on when you want it to run I guess. When and how should you see this count get displayed? Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 5, 2013 I tried to put it into an OPFOR Present Repeat trigger but it keeps coming up missing ; Share this post Link to post Share on other sites
KevsNoTrev 44 Posted September 5, 2013 Ice, it won't work as shown above as there a local variables in a public space. remove all the _ from the front of the aliveInTrigger Share this post Link to post Share on other sites
kylania 568 Posted September 5, 2013 Oops, was missing a = in there. and the _ local variable thing KevsnoTrev mentioned :) Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 5, 2013 You have both lost me now. I understand the remove _ from in front of the aliveInTrigger obviously nut the a= I don't get? Share this post Link to post Share on other sites
kylania 568 Posted September 5, 2013 i edited my post. I had side _x = opfor instead of side _x == opfor Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 5, 2013 OK, working in a trigger, however it says that there 0 units in the trigger area when there are about 25 opfor present Share this post Link to post Share on other sites
kylania 568 Posted September 5, 2013 Change triggerName to thisTrigger Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 5, 2013 Perfect, thanks KYL. One last question, what trigger parameters would you use in order to get this to display say every minute. I tried a repeat OPFOR present but that does nothing so at the moment it is on OPFOR detecting BLUFOR which is not ideal. Thanks Share this post Link to post Share on other sites
kylania 568 Posted September 6, 2013 I wouldn't put it in a trigger, I'd run it from a script as it was originally written. Just a while true, that code, then sleep 60. :) Share this post Link to post Share on other sites
hajimoto 10 Posted September 6, 2013 Question: Is there an equally powerful command like " BIS_fnc_inTrigger" to determine the amount of enemy units that exist within a given marker? Share this post Link to post Share on other sites
kylania 568 Posted September 6, 2013 The exact same command. :) ["someMarker", unitObject] call BIS_fnc_inTrigger; Share this post Link to post Share on other sites
hajimoto 10 Posted September 6, 2013 The exact same command. :) ["someMarker", unitObject] call BIS_fnc_inTrigger; I assumed because I was receiving a "0" count when entering a marker name that the command "BIS_fnc_inTrigger" was only for triggers only. Thank you Kylania! Share this post Link to post Share on other sites
Ice_Rhino 3 Posted September 6, 2013 (edited) KYL. how would I do that then and only count the guys within the specific trigger area? Edited September 6, 2013 by Ice_Rhino Share this post Link to post Share on other sites
hajimoto 10 Posted September 6, 2013 (edited) Moved to separate post so as not to hijack this post http://forums.bistudio.com/showthread.php?163341-Enemy-reinforcement-based-on-amount-of-remaining-forces-chopper Edited September 6, 2013 by Hajimoto Made dedicated post Share this post Link to post Share on other sites