From Bohemia Interactive Community
Hover & click on the images for description
Description
- Description:
- Returns an array of config entries which meet criteria in condition code. Command iterates through all available config sub classes of the given config class. Current looked at config is stored in _x variable (similar to alternative count command implementation). Condition has to return true in order for the looked at config to be added to the resulting array. Slightly faster than configProperties, but doesn't account for config properties or inherited entries.
⚠
- The condition code passed to configClasses should only be used for simple filter expressions and nothing more
- Do not use "isClass _x" in the condition. The engine does this check already
- Arma 3 v2.02 brought specific engine optimisations for the following conditions:
- Groups:
- Config
Syntax
- Syntax:
- condition configClasses config
- Parameters:
- condition: String
- config: Config
- Return Value:
- Array - array of Configs
- Syntax:
- configClasses [config, depth, includeInherited, allSubclasses, classNames]
- Parameters:
- config: Config - target config
- depth: Number - how many levels of subclasses to go deep
- includeInherited: Boolean - true to look through inherited classes
- allSubclasses: Boolean - true to return all subclasses, false - to return only the last tier.
- classnames: (Optional) Boolean - when true class names Strings are retuned, when false - Configs are returned. Default: false
- Return Value:
- Array - array of Configs or Strings, which represent class names.
Examples
- Example 1:
- collect all CfgVehicles configs:
- Example 2:
- Return all classes that can transport 10 and more soldiers:
- Example 3:
- Return all classes that inherit from 'RscText':
- Example 4:
- Return children:
Additional Information
- See also:
- Config configFile missionConfigFile configProperties configHierarchy BIS_fnc_returnChildren
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
- Iceman77 - c
- Posted on Oct 19, 2014 - 12:24 (UTC)
-
A fantastic way to filter stuff. eg:
- Benargee - c
- Posted on May 28, 2016 - 20:28 (UTC)
-
configClasses does not account for inherited subclasses, use configProperties with isClass filter instead
- Nelis75733126 - c
- Posted on May 28, 2017 - 09:18 (UTC)
-
this will get a list of ALL locations on the currently loaded world