Difference between revisions of "configFile"

From Bohemia Interactive Community
Jump to navigation Jump to search
Line 57: Line 57:
 
<code>
 
<code>
 
my_array = [];  
 
my_array = [];  
[(configfile >> "BombCrater"),{my_array set [count my_array,(_this select 2) call bis_fnc_getcfgdata]}] call BIS_fnc_uniqueClasses;
+
[(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]]
 
//return [[0,0,0],[0,0,0],[0,0,0]]
 
</code>
 
</code>

Revision as of 17:42, 2 April 2014

Introduced with Armed Assault version 1.001.00
Hover & click on the images for descriptions

Description

Description:
Return root of config entries hierarchy.
See AllInOne Config for a full config extract as example.

Syntax

Syntax:
Config = configFile
Return Value:
Config

Examples

Example 1:
_isMyClassActive = isClass (configFile / "CfgPatches" / "MyClass");

Additional Information

See also:
missionConfigFilecampaignConfigFileconfig/nameconfig >> nameconfigNamecountgetArraygetTextgetNumberinheritsFromisArrayisClassisNumberisTextselect
Groups:
Uncategorised

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.

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