From Bohemia Interactive Community
Notes
- Posted on Apr 3, 2014 - 00:37
- ffur2007slx2_5
-
In ArmA3 ver 1.14 there’re several comfortable workarounds with configFile for collecting subclasses. As for traditional workaround like:
(configfile >> "CfgFaces") call {
private ["_classes"];
_classes = [];
for "_i" from 0 to ((count _this) - 1) do
{
if (isClass (_this select _i)) then
{
_classes set [count _classes, configName (_this select _i)];
};
};
_classes
};
//return: ["Default"……"O_Colonel"] 8 items
Alternative recommended workaround by using: BIS_fnc_getCfgSubClasses e.g.
(configfile >> "CfgFaces") call BIS_fnc_getCfgSubClasses
//Same as traditional workaround
Another powerful replacement is using BIS_fnc_returnChildren to collect grandchildren classes with desired level, e.g.
[(configfile >> "CfgFaces"),1,true,true] call BIS_fnc_returnChildren;
//Return all children faces with a total number at 68
And as for another advanced workaround for direct processing collected classes, use BIS_fnc_uniqueClasses. E.g.
my_array = [];
[(configfile >> "BombCrater"),
{
my_array set [count my_array,(_this select 2) call bis_fnc_getcfgdata]
}
] call BIS_fnc_uniqueClasses;
//return [[0,0,0],[0,0,0],[0,0,0]]
Bottom Section