BIS fnc selectRandom: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (template:command argument fix)
Line 8: Line 8:
|version2= 1.00|=
|version2= 1.00|=


|arg= |= MPARGUMENTS
|arg= |MPARGUMENTS=  
|eff= local |= Effects in MP
|eff= local |= Effects in MP
____________________________________________________________________________________________
____________________________________________________________________________________________
Line 18: Line 18:
| var1 call '''BIS_fnc_selectRandom'''  |=
| 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 |PARAMETER1=  


| [[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 /> |RETURNVALUE=


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


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


|  |= MPBEHAVIOUR
|  |MPBEHAVIOUR=  
____________________________________________________________________________________________
____________________________________________________________________________________________
}}
}}

Revision as of 10:29, 7 April 2019

Hover & click on the images for description

Description

Description:
Selects one of the arguments at random. There is now a dedicated script command selectRandom, use that instead.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
var1 call BIS_fnc_selectRandom
Parameters:
var1: Array - array of values of which one will be selected at random
Return Value:
Any Value - One of the values you passed, chosen at random

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

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