Random numbers?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
ShadowX
Lance Corporal
Posts: 16
Joined: Sun Mar 09, 2003 9:10 am
Location: Ohio

Random numbers?

Post 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
You may have over 100 skydives, but until you've jumped into pitch black darkness at 1200 feet, carrying over 150lbs of equipment, you just haven't lived! Airborne.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
Post Reply