PDA

View Full Version : True and False functions


Tone13
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.

Tone13
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

debussybunny563
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>"

Akira101
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:

http://i895.photobucket.com/albums/ac155/AkiraX101/AliceInstruction-TrueFalse-Pic1.jpg

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.

http://i895.photobucket.com/albums/ac155/AkiraX101/AliceInstruction-TrueFalse-Pic2.jpg

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

http://i895.photobucket.com/albums/ac155/AkiraX101/AliceInstruction-TrueFalse-Pic3.jpg

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.

Tone13
11-12-2010, 05:47 PM
Thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!