BIS fnc selectRandom: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
{{Function


| arma2 |Game name=
| arma2


|1.00|Game version=
|1.00


|gr1= Arrays |GROUP1
|gr1= Arrays |GROUP1
Line 16: Line 16:


| Selects one of the arguments at random.
| Selects one of the arguments at random.
{{Feature|arma3 | Use [[selectRandom]] instead.}} |Description=
{{Feature|arma3 | Use [[selectRandom]] instead.}}


| var1 call [[BIS_fnc_selectRandom]] |Syntax=
| var1 call [[BIS_fnc_selectRandom]]


|p1= var1: [[Array]] - array of values of which one will be selected at random |PARAMETER1=
|p1= var1: [[Array]] - array of values of which one will be selected at random


| [[Any Value]] - One of the values you passed, chosen at random<br><br> |RETURNVALUE=
| [[Any Value]] - One of the values you passed, chosen at random<br><br>


|x1= <code>_bestShooter <nowiki>=</nowiki> [_rento, _ben, _trit] [[call]] BIS_fnc_selectRandom; {{cc|returns one of the variables}}
|x1= <code>_bestShooter <nowiki>=</nowiki> [_rento, _ben, _trit] [[call]] BIS_fnc_selectRandom; {{cc|returns one of the variables}}
_bestSeries <nowiki>=</nowiki> [["halo1","halo2"],["ofp","arma2"]] [[call]] BIS_fnc_selectRandom; {{cc|returns one of the arrays}}
_bestSeries <nowiki>=</nowiki> [["halo1","halo2"],["ofp","arma2"]] [[call]] BIS_fnc_selectRandom; {{cc|returns one of the arrays}}
</code>|EXAMPLE1=
</code>


|[[selectRandom]] |SEEALSO=
|[[selectRandom]]


|  |MPBEHAVIOUR=
|  |MPBEHAVIOUR=

Revision as of 00:44, 18 January 2021

Hover & click on the images for description

Description

Description:
GROUP1
Execution:
call
Groups:
Arrays

Syntax

Syntax:
Selects one of the arguments at random.
Arma 3
Use selectRandom instead.
Parameters:
var1: Array - array of values of which one will be selected at random
Return Value:
var1 call BIS_fnc_selectRandom

Examples

Example 1:
_bestShooter = [_rento, _ben, _trit] call BIS_fnc_selectRandom; // returns one of the variables _bestSeries = [["halo1","halo2"],["ofp","arma2"]] call BIS_fnc_selectRandom; // returns one of the arrays

Additional Information

See also:
Any Value - One of the values you passed, chosen at random

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

Bottom Section