Alice Community  

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

Reply
 
Thread Tools Display Modes
True and False functions
Old
Tone13
Junior Member
 
Tone13's Avatar
 
Status: Offline
Posts: 9
Join Date: Oct 2010
Location: Nevada, Ia
Default True and False functions - 10-21-2010, 01:12 PM

Hey I was just wondering what kind of things you can use the true or false buttons. We want to make something raise up from the ground and we figured out how to have them do that but then when you click the button again it goes back into the ground. Could we use true or false functions to have it only do it once.
   
Reply With Quote
Old
Tone13
Junior Member
 
Tone13's Avatar
 
Status: Offline
Posts: 9
Join Date: Oct 2010
Location: Nevada, Ia
Default 11-04-2010, 12:42 PM

Okay sincerely what do I have to do to have one of those 150 views answer my question.... I would really like to know
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow 11-04-2010, 02:06 PM

You can, but in certain instances which may apply to this one, you could just have a wait after the rise.

object.Rise
wait <infinity> seconds

To get the infinity, in the custom number popup, type the word "infinity."

So, after the method, it just waits before it can do it again, and since that wait is infinite, it will never occur again.


You can use a true/false function though.

First, make the boolean (true/false) variable. For my purposes, I'm just going to call it "boolean," but you can name it whatever you want.

Next, place your method in an If/Else statement.

In the "If" part, drag "boolean" there, so the top part reads "If <boolean>"

Place your method underneath the "If part."

Underneath that, put "<boolean> set value to <false>"


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.

Last edited by debussybunny563; 11-04-2010 at 02:09 PM.
   
Reply With Quote
Old
Akira101
Guest
 
Status:
Posts: n/a
Default 11-04-2010, 03:36 PM

Well i made some pictures that may help, if you want two buttons to make one go up and one go down, do this:



Make a variable, "Above Ground" to represent if its above ground. Now make an If/Else statement like shown and and make it == false, so if its not above ground, it will come up. And the events are shown up top.



Left are just the methods used, and this picture shows the vice versa of the image above this to do the opposite.



Now, if you want it to be so that it just does it once and only once, make it like shown above, so if its pressed, it moves the cube down and only does it once, since the variable would be changed, pretty much doing the "Cube Down" method in the images above this, but just only doing that not including the other.

Hope this helps.
   
Reply With Quote
Thanks
Old
Tone13
Junior Member
 
Tone13's Avatar
 
Status: Offline
Posts: 9
Join Date: Oct 2010
Location: Nevada, Ia
Default Thanks - 11-12-2010, 05:47 PM

Thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!
   
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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.