![]() |
Getting Loopy
No lie! I got REAL loopy, in fact the first time I couldn't get out of the loop. I still can't figure out how to make the response not true and have something different happen and end the method with a definitive response like "Goodbye" or "Thanks for playing"
|
[QUOTE=HoffmanFarmsTx;56449]No lie! I got REAL loopy, in fact the first time I couldn't get out of the loop. I still can't figure out how to make the response not true and have something different happen and end the method with a definitive response like "Goodbye" or "Thanks for playing"[/QUOTE]
If you need help just post the world and I take a look at it. |
Often it simply requires the use of a single test.
Say, for instance, that you have a method with a single "while loop" that continues based on the value of a Boolean value. Then simply add an "If" that does whatever needs to be done until another condition is satisfied, and uses the "else" to set the Boolean variable to false. While loop terminated :cool: |
^^ Good advice.
|
Using the Event System
While [variable] is true Begin [method] During [do nothing] End [method2] Begin will run your method 1 time when your condition becomes true End will run a different method 1 time when the condition becomes false. e.g. While [objA] is within 5 meters of [objB] is true Begin [objA] say hello During: do nothing End [objA] say Goodbye in this simple loop when object is within 5 meters of each other the first will say hello, then if you move the objects apart the first will say goodbye. alternatively if you want to run a method on loop while the condition is met, place it in the During slot |
All times are GMT -5. The time now is 06:15 PM. |
Copyright ©2021, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.