configProperties: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<tt>([^= ]+)<\/tt>" to "{{hl|$1}}")
m (Text replacement - "\|seealso= ?\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 $2")
Line 38: Line 38:
[[hint]] [[str]] _hitPointsCfgs;</code>
[[hint]] [[str]] _hitPointsCfgs;</code>


|seealso= [[Config]], [[configFile]], [[missionConfigFile]], [[configClasses]], [[configHierarchy]]
|seealso= [[Config]] [[configFile]], [[missionConfigFile]], [[configClasses]], [[configHierarchy]]
}}
}}

Revision as of 13:02, 20 January 2022

Hover & click on the images for description

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. A bit slower than configClasses but allows to access inherited entries.
The condition code passed to configProperties should only be used for simple filter expressions and nothing more.
Since Arma 3 logo black.png2.02 the following conditions are optimised for performance:
  • "true" (omitted condition)
  • "isClass _x"
  • "isClass _x && (...)"
Groups:
Config

Syntax

Syntax:
configProperties [config, condition, inherit]
Parameters:
config: Config - config entry to search
condition: String - (Optional, default "true") expression, 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

See also:
Config configFilemissionConfigFileconfigClassesconfigHierarchy

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