configProperties: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (includes classes) |
Killzone Kid (talk | contribs) (warning + example corrected) |
||
Line 8: | Line 8: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Returns an array of config entries which meet criteria in condition code. Command iterates through available classes and config properties for given config entry. If 3rd param is [[true]] the search also includes inherited properties. 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 property to be added to the resulting array. |= Description | | Returns an array of config entries which meet criteria in condition code. Command iterates through available classes and config properties for given config entry. If 3rd param is [[true]] the search also includes inherited properties. 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 property to be added to the resulting array. | ||
{{warning| The condition code passed to configProperties should only be used for '''simple filter expressions''' and nothing more}}|= Description | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 26: | Line 27: | ||
|x3= Get all hitpoints of a truck:<code>_hitPoints = []; | |x3= Get all hitpoints of a truck:<code>_hitPoints = []; | ||
_hitPointsCfgs = [[configProperties]] [ | |||
[[configFile]] >> "CfgVehicles" >> "O_Truck_02_box_F" >> "HitPoints", | [[configFile]] >> "CfgVehicles" >> "O_Truck_02_box_F" >> "HitPoints", | ||
" | "[[true]]", | ||
[[true]] | [[true]] | ||
]; | ]; | ||
[[hint]] [[str]] | [[hint]] [[str]] _hitPointsCfgs;</code> |= Example 2 | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Revision as of 17:02, 24 December 2015
Description
- Description:
- Returns an array of config entries which meet criteria in condition code. Command iterates through available classes and config properties for given config entry. If 3rd param is true the search also includes inherited properties. 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 property to be added to the resulting array.
- Groups:
- Uncategorised
Syntax
- Syntax:
- configProperties [config, condition, inherit]
- Parameters:
- [config, condition, inherit]: Array
- config: Config - config entry to search
- condition: String - (optional, default: "true") code, which if returns true, adds current property to result
- inherit: Boolean - (optional, default: true) include inherited properties
- Return Value:
- Array - Array of Configs
Examples
- Example 1:
_configs = configProperties [configFile >> "CfgVehicles" >> "O_Truck_02_box_F"];
- Example 2:
_configs = configProperties [configFile >> "RscText", "true", true];
- Example 3:
- Get all hitpoints of a truck:
_hitPoints = []; _hitPointsCfgs = configProperties [ configFile >> "CfgVehicles" >> "O_Truck_02_box_F" >> "HitPoints", "true", true ]; hint str _hitPointsCfgs;
Additional Information
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