BIS fnc configExtremes: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Some wiki formatting)
 
(31 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.36


| arma3 |= Game name
|gr1= Configs


|1.00|= Game version
|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).


| <pre>/*
|s1= [paths, properties, propertyTypes, propertyDefaults] call [[BIS_fnc_configExtremes]]
Author: Karel Moricky


Description:
|p1= paths: [[Array]] of [[Config]]s - paths to be scanned.
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 geometric mean of all numbers in the array)


Parameter(s):
|p2= properties: [[Array]] of [[String]]s - class names of properties to be evaluated.
0: ARRAY of CONFIGs - scanned paths. Most often result of configClasses command
1: ARRAY or STRINGs - properties, e.g., ["maxRange","reloadTime"]
2 (Optional): ARRAY of BOOLs - property types. False for normal number, true for logarithmic)
2 (Optional): ARRAY of NUMBERs - default values in case a property is not found


Returns:
|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
ARRAY in format [minValues,maxValues]
Number of items in each array is the same as number of properties
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|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
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_configExtremes]]; --> |= Syntax
|r1= [[Array]] - [minValues, maxValues] where minValues and maxValues are arrays respective to the properties array.
|p1= |= Parameter 1


| |= Return value
|x1= <sqf>
____________________________________________________________________________________________
private _paths = [configFile >> "CfgWeapons"] call BIS_fnc_returnChildren;
 
[_paths, ["maxRange", "reloadTime"]] call BIS_fnc_configExtremes;
|x1= <code></code> |=
</sqf>
____________________________________________________________________________________________
 
| |= See also


|seealso=
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Configs|{{uc:configExtremes}}]]
[[Category:Functions|{{uc:configExtremes}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:configExtremes}}]]

Latest revision as of 13:09, 13 July 2022

Hover & click on the images for description

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