Doodle 10 Posted February 5, 2014 I am using the code below in a simple radio trigger hint format["There are %1 EAST units on this map.",{side _x == opfor} count allUnits]; Anyone any idea how I could then deduct a specified number from the result For example I may have 10 enemy troops but I only want say 6 to be displayed in the hint so something along the lines of hint format["There are %1 EAST units on this map.",{side _x == opfor} count allUnits -4]; Thnaks in advance Share this post Link to post Share on other sites
fusion13 11 Posted February 5, 2014 _cnt = {side _x == opfor} count allUnits; _fake = _cnt - 4; hint format ["There are %1 East units on this map", _fake]; Maybe??? Didn't test but it looks like it should work right :D Share this post Link to post Share on other sites
tryteyker 28 Posted February 5, 2014 You already have the correct code, OP. Add parentheses around the count so - 4 is alone outside of it. No need for extra vars. Share this post Link to post Share on other sites
Doodle 10 Posted February 6, 2014 Thanks guys. Worked perfectly. Of course as I solve one issue another arises but thats half the fun. On an unrelated matter but I think it maybe the same sort of solution. I am using the following code to display name above players heads. onEachFrame { { if ((side _x == west) && (_x != player)) then { drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1, 1, 1, 1], [visiblePosition _x select 0, visiblePosition _x select 1,(visiblePosition _x select 2)+3], 0.1, 0.1, 0, (format ["%2 - %1",player distance _x, name _x]), 1, 0.03, "EtelkaMonospacePro"]; }; } foreach allunits; }; Works perfecet but it displays the distance to the player down to 5 decimal places. EG "player 102.12345m" Any idea if its possible to remove the decimal place as accurate to the nearest metre is enough thanks in advance Share this post Link to post Share on other sites
fight9 14 Posted February 6, 2014 (edited) Use Floor to round it down to a whole integer http://community.bistudio.com/wiki/floor floor (Player distance _x) Edited February 7, 2014 by Fight9 corrected code mistake for future searches Share this post Link to post Share on other sites
Doodle 10 Posted February 6, 2014 Use Floor to round it down to a whole integerhttp://community.bistudio.com/wiki/floor Player distance floor _x Thanks but I cant figure it out tried player distance floor_x & player distance floor 1.0000 neither worked - dont suppose you could give any more pointers Thanks in advance Share this post Link to post Share on other sites
fight9 14 Posted February 6, 2014 (edited) try (format ["%2 - %1",floor (player distance _x), name _x]) I might have gotten my commands backwards. Edited February 6, 2014 by Fight9 Share this post Link to post Share on other sites
Doodle 10 Posted February 6, 2014 PERFECT! Thanks guys for helping me out on these two issues both have been bugging me for a while and are just nice little finnishing topuches to the mission THANKS Share this post Link to post Share on other sites
zapat 53 Posted February 7, 2014 You can use https://community.bistudio.com/wiki/countSide instead of looping through all units, which will give you somewhat better performance. Share this post Link to post Share on other sites