Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: selmiak on Mon 19/12/2011 23:04:18

Title: Random and datatypes
Post by: selmiak on Mon 19/12/2011 23:04:18
I'm declaring an
int code = 0;
at the start of a room and later fill it with
code = 1000 + Random(998999);
but the highest random values I get from this is around the 32k for a short in AGS.

Can I trust AGS to only create random numbers below 32.767 ? Then I could just multiply the hell out of it (with random(30)). But if there ARE random values above 32.767 possible this could lead to unexpected and unpredictable results.
Out of 20 tries none were over 32.767(+1000). Are 20 tries enough or should I wake up Gauss and ask him?
Title: Re: Random and datatypes
Post by: Wyz on Mon 19/12/2011 23:50:08
Well actually there is a limit, I read about it in a topic (click) (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=44923.0) not too long ago. I guess that will answer your question. :)
Title: Re: Random and datatypes
Post by: selmiak on Tue 20/12/2011 13:11:24
thanks for the link this helped :)