BIS fnc selectRandomWeighted: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\|( *\[\[[a-zA-Z]+\]\]) * \| *s2 *=" to "|r1=$1 |s2=") |
Lou Montana (talk | contribs) m (Text replacement - " +" to " ") |
||
Line 42: | Line 42: | ||
|seealso= [[selectRandomWeighted]] | |seealso= [[selectRandomWeighted]] | ||
}} | }} | ||
[[Category:{{Name|arma2oa}}: Functions|{{uc:selectRandomWeighted}}]] | [[Category:{{Name|arma2oa}}: Functions|{{uc:selectRandomWeighted}}]] | ||
[[Category:{{Name|arma3}}: Functions|{{uc:selectRandomWeighted}}]] | [[Category:{{Name|arma3}}: Functions|{{uc:selectRandomWeighted}}]] | ||
[[Category:{{Name|tkoh}}: Functions|{{uc:selectRandomWeighted}}]] | [[Category:{{Name|tkoh}}: Functions|{{uc:selectRandomWeighted}}]] |
Revision as of 23:07, 10 June 2021
Description
- Description:
- Description needed
- Execution:
- call
- Groups:
- Arrays
Syntax
- Syntax:
- Syntax needed
- Parameters:
- itemsAndWeights: Array - array of items and weights [item, weight, item, weight...]
- Return Value:
- Anything
Alternative Syntax
- Syntax:
- [items, weights] call BIS_fnc_selectRandomWeighted
- Parameters:
- [items, weights]: Array
- items: Array - items array of Anything
- weights: Array - weights array of Numbers
- Return Value:
- Anything
Examples
- Example 1:
["apples",.3,"pears",.2,"bananas",.4,"diamonds",.1,"unicorns",.00001] call BIS_fnc_selectRandomWeighted;
- Example 2:
[["apples","pears","bananas","diamonds"],[0.3,0.2,0.4,0.1]] call BIS_fnc_selectRandomWeighted;
Additional Information
- See also:
- selectRandomWeighted
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