configHierarchy: Difference between revisions

From Bohemia Interactive Community
mNo edit summary
mNo edit summary
 
Line 12: Line 12:
|p1= config: [[Config]] - target config  
|p1= config: [[Config]] - target config  


|r1= [[Array]] - array of parent [[Config]]s, ordered from parent to child
|r1= [[Array]] of [[Config]]s - ordered from parent to child




Line 25: Line 25:




|r2= [[Array]] - array of parent [[Config]]s or [[String]]s, representing config names
|r2= [[Array]] of [[Config]]s or [[String]]s - Strings represent config names


|x1= <sqf>
|x1= <sqf>

Latest revision as of 10:41, 1 January 2026

Hover & click on the images for description

Description

Description:
Returns hierarchy of the given config class. Just like with inheritsFrom, only complete config classes are supported (before Arma 3 logo black.png 2.14). Since Arma 3 logo black.png 2.22, an alt syntax is added, which allows to return parents identical to BIS_fnc_returnParents (see Example 2)
Groups:
Config

Syntax

Syntax:
configHierarchy config
Parameters:
config: Config - target config
Return Value:
Array of Configs - ordered from parent to child

Alternative Syntax

Syntax:
configHierarchy [config, classesOnly, includeBases, reversedOrder, configNames]
Parameters:
config: Config - target config
classesOnly: Boolean - when true, only classes are included in output and not properties
includeBases: Boolean - when true, returned parents will include base classes (see description)
reversedOrder: Boolean - when true, the return order is from child to parent
configNames: (Optional) Boolean - when true, the return is Array of Strings, when false - Array of Configs. Default: false
Return Value:
Array of Configs or Strings - Strings represent config names

Examples

Example 1:
_hierarchy = configHierarchy (configFile >> "CfgVehicles" >> "Car"); // Returns [bin\config.bin, bin\config.bin/CfgVehicles, bin\config.bin/CfgVehicles/Car]
Example 2:
_bis_fnc_returnParents = configHierarchy [configFile >> "CfgVehicles" >> "Land_FirePlace_F", true, true, true, true]; // Returns ["Land_FirePlace_F","House_F","House","HouseBase","NonStrategic","Building","Static","All"]

Additional Information

See also:
configClasses configProperties missionConfigFile campaignConfigFile a / b config >> name configName count getArray getText getNumber inheritsFrom isArray isClass isNumber isText select isKindOf BIS_fnc_returnParents

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note