BIS fnc configExtremes: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| *arma3 * * *\| *([0-2]\.[0-9]{2}) * " to "|game1= arma3 |version1= $1 ") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
|gr1= Configs | |gr1= Configs | ||
| | |descr= Scan config paths and return min and max values for each property.<br> | ||
Can be used only for properties of type [[Number]] and [[Array]] (value is considered to be the geometric mean of all numbers in the array). | |||
|s1= [paths, properties, propertyTypes, propertyDefaults] call [[BIS_fnc_configExtremes]] | |||
|s1= | |||
|p1= paths: [[Array]] of [[Config]]s - paths to be scanned. | |p1= paths: [[Array]] of [[Config]]s - paths to be scanned. | ||
Line 17: | Line 15: | ||
|p2= properties: [[Array]] of [[String]]s - class names of properties to be evaluated. | |p2= properties: [[Array]] of [[String]]s - class names of properties to be evaluated. | ||
|p3= propertyTypes | |p3= propertyTypes: [[Array]] of [[Boolean]]s - (Optional, default [[false]]) whether the property at the respective index should be evaluated and returned as a [[log]]arithmic number | ||
|p4= propertyDefaults: [[Array]] of [[Number]]s - (Optional, default 0) value to be used in cases where the property at the respective index is not defined | |||
| | |r1= [[Array]] - [minValues, maxValues] where minValues and maxValues are arrays respective to the properties array. | ||
| | |x1= <sqf> | ||
private _paths = [configFile >> "CfgWeapons"] call BIS_fnc_returnChildren; | |||
[_paths, ["maxRange", "reloadTime"]] call BIS_fnc_configExtremes; | |||
</sqf> | |||
| | |seealso= | ||
}} | }} |
Latest revision as of 12:09, 13 July 2022
Description
- Description:
- Scan config paths and return min and max values for each property.
Can be used only for properties of type Number and Array (value is considered to be the geometric mean of all numbers in the array). - Execution:
- call
- Groups:
- Configs
Syntax
- Syntax:
- [paths, properties, propertyTypes, propertyDefaults] call BIS_fnc_configExtremes
- Parameters:
- paths: Array of Configs - paths to be scanned.
- properties: Array of Strings - class names of properties to be evaluated.
- propertyTypes: Array of Booleans - (Optional, default false) whether the property at the respective index should be evaluated and returned as a logarithmic number
- propertyDefaults: Array of Numbers - (Optional, default 0) value to be used in cases where the property at the respective index is not defined
- Return Value:
- Array - [minValues, maxValues] where minValues and maxValues are arrays respective to the properties array.
Examples
- Example 1:
- private _paths = [configFile >> "CfgWeapons"] call BIS_fnc_returnChildren; [_paths, ["maxRange", "reloadTime"]] call BIS_fnc_configExtremes;
Additional Information
- See also:
- See also needed
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