So umm ... Why can't the "While" loops (Forever IF) be stacked under eachother?
Shouldn't I be able to say
While this is happening ... do this.
But While this is happening ... do this other thing.
?
Instead of just While this is happening, and While this an this an this is happening too
... do this.
Or am I mistaking how the Forever Ifs function?
<shrugs>
Offline
The Forever if block is a loop that never ends - but it only performs its stuff when the boolean is true. You can't stack Forever ifs inside each other, because only the first one would get to be used.
Offline
Do you mean placing a Forever If inside of another one or place it underneath?
If you want something similar to placing them in sequence, you can put an If Else block inside of a Forever loop. Though I'm not too sure, I've never used Forever If blocks before.
A ninja!
Last edited by Ace-of-Spades (2010-08-02 02:21:40)
Offline
Or you can:
Forever
Forever if:<blah>
<blah>
*end Forever if*
Forever if: <second blah>
<second blah>
*end forever if*
*end forever*
Offline
What do you mean?
Forever blocks never end, so it will never get to the second thing.
If you want "While this is happening ... do this.But While this is happening ... do this other thing." you just do:
This is what the forever if block does:
Although it may seem like it since if keeps on doing the thing, it does not mean "If this, do this forever", It means "Keep on checking this, and if its true do it"
Last edited by colorfusion (2010-08-02 07:58:00)
Offline
Jonathanpb is right. Forever If is not a while block, because it will always check to see if its boolean is true, whereas While will continue on after its boolean is false.
Forever if <boolean> blocks EndForeverIf = Forever If <boolean> blocks EndIf EndForever
While <boolean> blocks EndWhile = Repeat Until <NOT <boolean> > blocks EndRepeatUntil
Offline
The problem is that I need something to know right away when a key is pressed.
I've been using the if else block within a forever block, but the problem with that is that in a long script a delay is created before the character moves when a button is pressed. I've fixed it only by creating duplicate code that checks if the key is pressed every so often throughout the script. I'd really like to find a better way and remove the duplicate code while still retaining the smooth motion functionality.
There is an idle animation (not just one frame standing still), a walking animation (this works smoothly if I have only one frame in the walking anim instead of two),
directions left and right, and an attack sequence that I have working currently.
Offline
Nevermind, I'm an idiot. :p ... I figured out a shorter way.
Still had to use a little bit of duplicate code though ...
Which leads me to another question ... I'll make a new post for it.
Offline