Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Random Number and Objects
Old
zezi
Guest
 
Status:
Posts: n/a
Default Random Number and Objects - 11-03-2009, 09:40 PM

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.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 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.


(')>
   
Reply With Quote
Old
zezi
Guest
 
Status:
Posts: n/a
Default 11-03-2009, 09:53 PM

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.

Last edited by zezi; 11-03-2009 at 10:17 PM. Reason: Additional info
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 11-03-2009, 10:56 PM

Quote:
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.


(')>
   
Reply With Quote
Old
zezi
Guest
 
Status:
Posts: n/a
Default 11-03-2009, 11:10 PM

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
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.