Robustcolor 30 Posted July 17, 2021 Hi, which is the simpliest way to fetch each units from a group into an array using configFile? I'm trying it like this but it's not working. _enemyUnits = [[configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfAssault"]]; _group = createGroup [east,true]; _unit = _group createUnit [selectRandom _enemyUnits,getMarkerPos "Marker1",[],0,"CAN_COLLIDE"]; Share this post Link to post Share on other sites
gc8 970 Posted July 17, 2021 should be something like: _enemyUnits = getArray (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfAssault"); Share this post Link to post Share on other sites
Robustcolor 30 Posted July 17, 2021 1 hour ago, gc8 said: _enemyUnits = getArray (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfAssault"); Gives a empty array []. Can't selectRandom _enemyUnits; Share this post Link to post Share on other sites
gc8 970 Posted July 17, 2021 sorry my bad, it's more like: _groupCfg = configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfAssault"; for "_i" from 0 to 100 do { _unitCfg = _groupCfg >> (format["unit%1",_i]); if(isnull _unitCfg) then { break; }; systemchat format["Unit type: %1", getText (_unitCfg >> "vehicle")]; }; 1 Share this post Link to post Share on other sites
panther42 40 Posted July 17, 2021 another option: Spoiler _enemyUnits = ("true" configClasses (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfAssault") apply {getText (_x >> "vehicle")}); //systemchat format["Unit type array: %1", _enemyUnits]; remove comment if you want _group = createGroup [east,true]; _unit = _group createUnit [selectRandom _enemyUnits,getMarkerPos "Marker1",[],0,"CAN_COLLIDE"]; 2 Share this post Link to post Share on other sites