Difference between revisions of "BIS fnc configExtremes"

From Bohemia Interactive Community
Jump to navigation Jump to search
(username removed)
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
(Created page with " {{Function|= Comments ____________________________________________________________________________________________ | arma3 |= Game name |1.36|= Game version |arg= |= MPARG...")
Line 5: Line 5:
 
| arma3 |= Game name
 
| arma3 |= Game name
  
|1.00|= Game version
+
|1.36|= Game version
 +
 
 +
|arg= |= MPARGUMENTS
 +
|eff= local |= Effects in MP
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| <pre>/*
+
|Scan config paths and return min and max values for each property.
Author: Karel Moricky
+
<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). |= Description
 +
____________________________________________________________________________________________
  
Description:
+
| <nowiki>[paths, properties, (propertyTypes, propertyDefaults)]</nowiki> call [[BIS_fnc_configExtremes]] |= Syntax
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):
+
|p1= paths: [[Array]] of [[Config]]s - paths to be scanned. |= Parameter 1
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:
+
|p2= properties: [[Array]] of [[String]]s - class names of properties to be evaluated. |= Parameter 2
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
+
|p3= propertyTypes (Optional): [[Array]] of [[Boolean]]s - whether the property at the respective index should be evaluated and returned as a [[log]]arithmic number. Default: [[false]] |= Parameter 3
____________________________________________________________________________________________
 
  
| <!-- [] call [[BIS_fnc_configExtremes]]; --> |= Syntax
+
|p4= propertyDefaults (Optional): [[Array]] of [[Number]]s - value to be used in cases where the property at the respective index is not defined. Default: 0 |= Parameter 4
|p1= |= Parameter 1
 
  
| |= Return value
+
| [[Array]] - [minValues, maxValues] where minValues and maxValues are arrays respective to the properties array. |= Return Value
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
|x1= <code></code> |=  
+
|x1= <code>[([[configFile]] >> "cfgWeapons") call [[BIS_fnc_returnChildren]], ["maxRange","reloadTime"]] call [[BIS_fnc_configExtremes]];</code> |= Example 1
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  

Revision as of 16:54, 16 December 2014


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:
Uncategorised

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 (Optional): Array of Booleans - whether the property at the respective index should be evaluated and returned as a logarithmic number. Default: false
propertyDefaults (Optional): Array of Numbers - value to be used in cases where the property at the respective index is not defined. Default: 0
Return Value:
Array - [minValues, maxValues] where minValues and maxValues are arrays respective to the properties array.

Examples

Example 1:
[(configFile >> "cfgWeapons") call BIS_fnc_returnChildren, ["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

Notes

Bottom Section