ArmaMan360 94 Posted December 1, 2015 I need to define a random size for AO that is perfectly round. In the below example, how do I set _posaxis a random value between 600 - 800 so that it copies the same number in the _posaxis repeated twice in the next line? _posaxis = ? [_sidepos,_posaxis,_posaxis,0,0,_values] call DAC_fNewZone; Thank you :) Share this post Link to post Share on other sites
ArmaMan360 94 Posted December 1, 2015 Is this correct: _posaxis = round(random 200) +600; ??? Share this post Link to post Share on other sites
Sniperwolf572 758 Posted December 1, 2015 _posaxis = 600 + floor (random 201); Edit: Yes. But floor instead of round because with round(random 200), 0 and 200 will be only half as likely as other numbers. And 201 instead of 200 because the number provided to random is non inclusive and with floor, you need a value 1 higher to actually ever get 200. Share this post Link to post Share on other sites
ArmaMan360 94 Posted December 2, 2015 _posaxis = 600 + floor (random 201);Edit: Yes. But floor instead of round because with round(random 200), 0 and 200 will be only half as likely as other numbers. And 201 instead of 200 because the number provided to random is non inclusive and with floor, you need a value 1 higher to actually ever get 200. Thanks a ton sniperworlf ! Share this post Link to post Share on other sites
jshock 513 Posted December 2, 2015 https://community.bistudio.com/wiki/BIS_fnc_randomInt Share this post Link to post Share on other sites
ArmaMan360 94 Posted December 2, 2015 https://community.bistudio.com/wiki/BIS_fnc_randomInt Thank you J ! :) Share this post Link to post Share on other sites