retarded tryhard 0 Posted August 12, 2017 Hi! I'm working on an AI spawning script where it randomly selects from an array of units to create, and I want the array to include all the units from loaded mods instead of just vanilla units. Is there anyway to implement this? Are there any commands that can scan the game file and return such an array? Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted August 12, 2017 configClasses is what you want. Cheers Share this post Link to post Share on other sites
retarded tryhard 0 Posted August 12, 2017 5 minutes ago, Grumpy Old Man said: configClasses is what you want. Cheers I'm looking at this now, seems promising. Thx. Share this post Link to post Share on other sites
davidoss 550 Posted August 13, 2017 _getClasses = { params ["_faction", "_array"]; _array = []; { if ((configName _x) isKindoF "CAManBase") then { _array pushback (configName _x); }; } forEach ("getText (_x >> 'faction') == _faction" configClasses (configfile >> "CfgVehicles")); _array }; ["blu_F"] call _getClasses; Change "blu_F" to any faction you want, or for many factions of defined side: _getsideFactions = { params ["_side", "_array"]; _array = []; { _array pushback (configName _x); } forEach ("getNumber (_x >> 'side') isEqualTo _side" configClasses (configfile >> "CfgFactionClasses")); _array }; _getClasses = { params ["_faction", "_array"]; _array = []; { if ((configName _x) isKindoF "CAManBase") then { _array pushback (configName _x); }; } forEach ("getText (_x >> 'faction') == _faction" configClasses (configfile >> "CfgVehicles")); _array }; _factions = [1] call _getsideFactions; //0 = east, 1 = west, 2= IND, 3 = civ _allunitsofside = []; { _factionunits = [_x] call _getClasses; _allunitsofside = _allunitsofside + _factionunits; } forEach _factions; Share this post Link to post Share on other sites