frankie86ph 0 Posted December 30, 2022 Hi, I've been working the last few days on a shop GUI for an upcoming mission - this allows the player to upgrade AI squads with better equipment, weapons etc. I'm trying to figure out a condition that would count the number of NVGoggles in a specific group (since the GUI enables the player to reinforce groups), I need a dynamic pricing - so first I need to count the number of existing nvgoggles within the group. What condition script would return the total number of NVGoggles in the inventory of units in a specific group. Share this post Link to post Share on other sites
pierremgi 4905 Posted December 30, 2022 2 hours ago, frankie86ph said: . What condition script would return the total number of NVGoggles in the inventory of units in a specific group. A condition returns a boolean (FALSE or TRUE), not a number. Number of NVGoogles in a specific group: - for most of the cases (when mods/DLCs are smart for naming NVG with "goggles" in class names!): {"goggles" in toLowerANSI str assignedItems _x} count units yourGroup; - unfortunately, there is no will for standardization in DLCs/mods in Arma and the authors do what they want with names, categories, factions... example: NVGs in CSLA Iron Curtain can be: "CSLA_nokto" class.... So, the above code doesn't work here, but you can mount an array with all possible classes in your scenario: private _NVGArray = ["CSLA_nokto","O_NVGoggles_grn_F",....]; {_NVGArray findAny assignedItems _x >-1} count units yourGroup; - Last general method (without array of NVGs but slower): {assignedItems _x findIf {getNumber (configFile / "cfgWeapons" / _x / "type") == 4096} >-1} count units yourGroup; 1 Share this post Link to post Share on other sites
frankie86ph 0 Posted December 30, 2022 Got it, appreciate the feedback and explanation. Share this post Link to post Share on other sites