Alice Community  

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

Reply
 
Thread Tools Display Modes
How do you make a variable you make work?
Old
Jones989
Senior Member
 
Jones989's Avatar
 
Status: Offline
Posts: 61
Join Date: Jun 2011
Unhappy How do you make a variable you make work? - 06-13-2011, 01:34 PM

I need help with a game I am making. I want to make a variable that is called world.forever that will ask the player if he wants to play forever or not. I already know how to make Alice ask, but how do i make it go forever if the variable is true and and not if its false?
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 06-13-2011, 02:04 PM

Well, if the variable is a number variable, and the person says "yes" to play forever, then have the variable to set value to infinity. (just type infinity into the custom numbers)


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,143
Join Date: Dec 2010
Location: The Twilight Zone!
Default 06-13-2011, 02:12 PM

You could use an if/else method. See the attached program for an example. The text will tell you what the variable is set to, and to gurantee no errors, I have put a watch on the variable so you can see the actual variable.

I hope this helps.
Attached Files
File Type: a2w ExampleVariable.a2w (186.8 KB, 3 views)


██████████████████████
█░░░░░░░░░░░░░░░░░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓▓░█
█░▓░░░▓░░▓░▓░▓░░▓░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓░░█
█░▓░░░░░░▓░▓░▓░░▓░░░░█
█░▓░░░░░░░▓░▓░░░▓░░░░█
█░░░░░░░░░░░░░░░░░░░░█
██████████████████████

________________

Alice Hater? Rant Here!: http://tinyurl.com/HateAlice
   
Reply With Quote
Old
Jones989
Senior Member
 
Jones989's Avatar
 
Status: Offline
Posts: 61
Join Date: Jun 2011
Default 06-13-2011, 04:04 PM

Thanks both of you! Now I guarantee that the game will be finshed Eventually...
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,143
Join Date: Dec 2010
Location: The Twilight Zone!
Default 06-13-2011, 04:45 PM

Quote:
Originally Posted by Jones989 View Post
Thanks both of you! Now I guarantee that the game will be finshed Eventually...
Your welcome! Anytime you need help, just ask.


██████████████████████
█░░░░░░░░░░░░░░░░░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓▓░█
█░▓░░░▓░░▓░▓░▓░░▓░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓░░█
█░▓░░░░░░▓░▓░▓░░▓░░░░█
█░▓░░░░░░░▓░▓░░░▓░░░░█
█░░░░░░░░░░░░░░░░░░░░█
██████████████████████

________________

Alice Hater? Rant Here!: http://tinyurl.com/HateAlice
   
Reply With Quote
Reply

Tags
need help, true/false, variable

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.