configHierarchy: Difference between revisions
Lou Montana (talk | contribs) m (Some wiki formatting) |
Killzone Kid (talk | contribs) No edit summary |
||
Line 6: | Line 6: | ||
|gr1= Config | |gr1= Config | ||
|descr= Returns hierarchy of the given config class. Just like with [[inheritsFrom]], only complete config classes are supported (before {{GVI|arma3|2.14|size= 0.75}}). | |descr= Returns hierarchy of the given config class. Just like with [[inheritsFrom]], only complete config classes are supported (before {{GVI|arma3|2.14|size= 0.75}}). Since {{GVI|arma3|2.22|size= 0.75}}, an alt syntax is added, which allows to return parents identical to [[BIS_fnc_returnParents]] only 10x faster (see Example 2) | ||
|s1= [[configHierarchy]] | |s1= [[configHierarchy]] config | ||
|p1= | |p1= config: [[Config]] - target config | ||
|r1= [[Array]] - array of parent | |r1= [[Array]] - array of parent [[Config]]s, ordered from parent to child | ||
|s2= [[configHierarchy]] [config, classesOnly, includeBases, reversedOrder, configNames] | |||
|s2since= arma 3 2.22 | |||
|p21= configClass: [[Config]] - target config | |||
|p22= classesOnly: [[Boolean]] - when [[true]], only classes are included in output and not properties | |||
|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 | |||
|p25= configNames: [[Boolean]] - when [[true]], the return is [[Array]] of [[String]]s, when [[false]] - [[Array]] of [[Config]]s | |||
|r2= [[Array]] - array of parent [[Config]]s or [[String]]s, representing config names | |||
|x1= <sqf> | |x1= <sqf> | ||
Line 19: | Line 32: | ||
</sqf> | </sqf> | ||
|seealso= [[configClasses]] [[configProperties]] [[missionConfigFile]] [[campaignConfigFile]] [[a / b]] [[config greater greater name|config >> name]] [[configName]] [[count]] [[getArray]] [[getText]] [[getNumber]] [[inheritsFrom]] [[isArray]] [[isClass]] [[isNumber]] [[isText]] [[select]] [[isKindOf]] | |x2= <sqf> | ||
_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"] | |||
</sqf> | |||
|seealso= [[configClasses]] [[configProperties]] [[missionConfigFile]] [[campaignConfigFile]] [[a / b]] [[config greater greater name|config >> name]] [[configName]] [[count]] [[getArray]] [[getText]] [[getNumber]] [[inheritsFrom]] [[isArray]] [[isClass]] [[isNumber]] [[isText]] [[select]] [[isKindOf]] [[BIS_fnc_returnParents]] | |||
}} | }} |
Revision as of 22:35, 10 October 2025
Description
- Description:
- Returns hierarchy of the given config class. Just like with inheritsFrom, only complete config classes are supported (before
2.14). Since
2.22, an alt syntax is added, which allows to return parents identical to BIS_fnc_returnParents only 10x faster (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
- Syntax:
- configHierarchy [config, classesOnly, includeBases, reversedOrder, configNames]
- Parameters:
- configClass: 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: Boolean - when true, the return is Array of Strings, when false - Array of Configs
- 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:
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