configProperties: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(optional params)
(example)
Line 15: Line 15:
|p1= [config, condition, inherit]: [[Array]] |= Parameter 1
|p1= [config, condition, inherit]: [[Array]] |= Parameter 1
|p2= config: [[Config]] - config entry to search|= Parameter 1
|p2= config: [[Config]] - config entry to search|= Parameter 1
|p3= condition: [[String]] - (optional) code, which if returns [[true]], adds current property to result |= Parameter 1
|p3= condition: [[String]] - (optional, default: "[[true]]") code, which if returns [[true]], adds current property to result |= Parameter 1
|p4= inherit: [[Boolean]] - (optional) include inherited properties |= Parameter 1
|p4= inherit: [[Boolean]] - (optional, default: [[true]]) include inherited properties |= Parameter 1


| [[Array]] - Array of [[Config]]s |= Return value
| [[Array]] - Array of [[Config]]s |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>_configs = [[configProperties]] <nowiki>[</nowiki>[[configFile]] >> "RscText", "[[true]]", [[true]]];</code> |= Example 1
|x1= <code>_configs = [[configProperties]] <nowiki>[</nowiki>[[configFile]] >> "CfgVehicles" >> "O_Truck_02_box_F"];</code> |= Example 1
 
|x2= <code>_configs = [[configProperties]] <nowiki>[</nowiki>[[configFile]] >> "RscText", "[[true]]", [[true]]];</code> |= Example 1


|x2= Get all hitpoints of a tuck:<code>_hitPoints = [];
|x3= Get all hitpoints of a tuck:<code>_hitPoints = [];
0 = [[configProperties]] [
0 = [[configProperties]] [
[[configFile]] >> "CfgVehicles" >> "O_Truck_02_box_F" >> "HitPoints",  
[[configFile]] >> "CfgVehicles" >> "O_Truck_02_box_F" >> "HitPoints",  

Revision as of 17:04, 4 December 2014

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 1.37|1.37]]
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 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 tuck:_hitPoints = []; 0 = configProperties [ configFile >> "CfgVehicles" >> "O_Truck_02_box_F" >> "HitPoints", "_hitPoints pushBack configName _x; true", true ]; hint str _hitPoints;

Additional Information

See also:
ConfigconfigFilemissionConfigFileconfigClasses

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

[[Category:Introduced with arma3dev version 1.37]][[ Category: arma3dev: New Scripting Commands | CONFIGPROPERTIES]][[ Category: arma3dev: Scripting Commands | CONFIGPROPERTIES]]