Alice Community  

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

Reply
 
Thread Tools Display Modes
Setting variable as random number
Old
kaufill
Member
 
Status: Offline
Posts: 18
Join Date: Dec 2015
Post Setting variable as random number - 12-24-2015, 08:45 PM

Simple question:

I have declared a variable, and have given it a starting value of 1. Now I would like to, within a method, set the variable to a randomly generated number. Where do I find the function to do this??
I know it's staring me in the face and I just can't see it!
   
Reply With Quote
Figured it out!
Old
kaufill
Member
 
Status: Offline
Posts: 18
Join Date: Dec 2015
Default Figured it out! - 12-24-2015, 09:46 PM

I figured it out, but wanted to post how in case someone else was having this silly problem.

So my issue was I still had an object highlighted in the object tree. So, when I went to the function menu, all I had were functions of that particular object. When I switched to the World being selected, I then had the basic functions! I knew it had to be a simple problem and solution! :P
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default 12-28-2015, 12:27 PM

Yeah, there is 2 sets of functions in Alice, the local functions which deal with a specific object, and the world functions which deal with everything that doesnt require an object to be used.


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.