Page 1 of 1

Random numbers?

Posted: Thu Mar 13, 2003 4:14 am
by ShadowX
I looked in the SDK material and found two commands for random numbers:

RandomFloat

and

Randomint

Does ANYONE know what the parameters are for these? I need to generate a random number b/w 1 and $targetname.size. If this isn't possible, does anyone know of another way to generate random numbers? Thanks.

ShadowX

Posted: Thu Mar 13, 2003 4:47 am
by bdbodger
randon float is a number that has a decimal place in it like 1.25 where randomint is a integer or whole number like 1 or 5 etc

randomfloat(10) is every number includeing decimals between 0 and 9.99.... not sure how many decimal places it goes to

randomint(10) is an integer in the range 0 to 9 ten possible numbers all together so if you need a random integer between 1 and $targetname.size what you need to do is randomint($targetname.size)+1