HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How do you make it pick a random number..

08-13-2004, 07:11 AM#1
Billy_Cat
Im trying to make a dice roller, but i dont know how to make it pick a random number..

please help!
08-13-2004, 07:17 AM#2
Anitarf
Under Integer and Real functions, there's a function called "math - random number". That gives you a random number. You can set a variable to it, for example, "set rndNum = math - random number between 1 and 100".
08-13-2004, 07:28 AM#3
Billy_Cat
Quote:
Originally Posted by Anitarf
Under Integer and Real functions, there's a function called "math - random number". That gives you a random number. You can set a variable to it, for example, "set rndNum = math - random number between 1 and 100".

how would i set my variable, would I use arrays?

thanks
08-13-2004, 07:34 AM#4
Pheonix-IV
make a interger Variable called "Dice" when the trigger to roll the dice is done have the following actions.

Code:
Actions
    Set Dice = (Random integer number between X and Y)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            Dice Greater than Z
        Then - Actions
           (Insert Actions Here)
        Else - Actions
           (Insert Actions Here)


Replace X, Y and Z with numbers of your choice.
08-13-2004, 07:57 AM#5
Billy_Cat
the Dice variable has an index next to it.. what should the index equal

btw: im trying to make a board game, and Im having trouble thinking how to make it so that when someone is on a space and rolls the dice he moves up that number of spaces on the board..