Jump to content
ArmaMan360

Random value between a min and max figure for perfectly round AO?

Recommended Posts

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

Is this correct:

_posaxis = round(random 200) +600;

???

Share this post


Link to post
Share on other sites
_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
_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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×