configHierarchy: Difference between revisions

From Bohemia Interactive Community
No edit summary
No edit summary
Line 22: Line 22:
|p23= includeBases: [[Boolean]] - when [[true]], returned parents will include base classes (see description)
|p23= includeBases: [[Boolean]] - when [[true]], returned parents will include base classes (see description)
|p24= reversedOrder: [[Boolean]] - when [[true]], the return order is from child to parent
|p24= reversedOrder: [[Boolean]] - when [[true]], the return order is from child to parent
|p25= configNames: (Optional)[[Boolean]] - when [[true]], the return is [[Array]] of [[String]]s, when [[false]] - [[Array]] of [[Config]]s. Default: [[false]]
|p25= configNames: (Optional) [[Boolean]] - when [[true]], the return is [[Array]] of [[String]]s, when [[false]] - [[Array]] of [[Config]]s. Default: [[false]]





Revision as of 13:00, 12 October 2025

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 - array of parent Configs, ordered from parent to child

Alternative Syntax

Syntax:
configHierarchy [configClass, 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 - array of parent Configs or Strings, representing config names

Examples

Example 1:
_hierarchy = configHierarchy (configFile >> "CfgVehicles" >> "Car"); // [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 or on the Forums.
Only post proven facts here! Add Note