View Full Version : Random Number and Objects
I have a project where I have to move an asteroid along a randomly chosen track. I've been tinkering with it and I can get the random number portion to work, but I can't get the object to move along the paths I've assigned the numbers to using If/Else statements...The asteroid just sits there doing nothing.
Any help/hints on making it work would be appreciated.
x2495iiii
11-03-2009, 09:47 PM
Exactly what method did you use? If you can't describe it, go ahead and post your world so I can see it myself.
Not sure if this is what you mean, but I have it set as thus (after major tinkering):
RandomNumber set value to random number max=4 min=1 intergerOnly=true
3D Text set text to RandomNumber as a string
If RandomNumber==1
sphereHighPoly move to pterodactyl 8
I'm just trying to even make it move at this point. If I can get the sphere to move as it should, then I can set up everything on my own.
EDIT:
I have tried inputing the numbers I need in double digit format (0.0) as I've read in other threads, but Alice seems to ignore it.
x2495iiii
11-03-2009, 10:56 PM
RandomNumber set value to random number max=4 min=1 intergerOnly=true
3D Text set text to RandomNumber as a string
If RandomNumber==1
sphereHighPoly move to pterodactyl 8
With that setup, you should get a good assortment of 1's, 2's, and 3's (no 4's, since there is a slight glitch which sometimes locks out the maximum number when intergerTrue is set to true. Set the maximum to 5 if you want a 1 in 4 chance of 1 being chosen). However, the way you have it set up, the number is only chosen once, so you have a 1/3 chance of the shpere moving ONCE, and a 2/3 chance of it sitting there like a lemon. Put that code in a loop or a while statement and it should work.
Thanks. I wound up solving my issue a slightly different way. I decided to allow non integers and use relational operators, to make sure everything was neatly inside my boundaries