Hello, I tried looking at a couple guides for loops and how they work but it confused me a bit because I'm trying to loop something for example 3 times then the loop breaks, the guides only showed how to do it an endless amount of times..
So can someone clear up how to loop a specific amount of times and then break that loop?
Also if it helps the loop will be for a move route to loop 3x.
How to Loop Something a Specific Amount of Times?
● ARCHIVED · READ-ONLY
-
-
You set a variable to 0 before the loop, then just before the Repeat Above, you add 1 to the variable, then do a Conditional Branch - if the variable is 3 or more, Break Loop.
-
This is pretty simple, once you know how its done.Hello, I tried looking at a couple guides for loops and how they work but it confused me a bit because I'm trying to loop something for example 3 times then the loop breaks, the guides only showed how to do it an endless amount of times..
So can someone clear up how to loop a specific amount of times and then break that loop?
Also if it helps the loop will be for a move route to loop 3x.
At the end of your evet commond string, make a variable add +1, then make a condition branch, if variable = 3(erase event, turn on switch, however you want it to be, if It's a one time event, use a switch/add a 2nd page to require switch on, if you want the event to happen every time you enter map, in the condition branch, set variable at 0/erase event).
To shaz, you don't set the variable at 0, there's no need, variables are 0 by default. -
Well, that was an extremely easy fix, thanks. :D
-
I know that :) My reply is based on the assumption that you might have used it for something else (I have a few "generic" variables that I use for many things, when I just need to calculate and use it within the same event), or might want to run this several times. If in doubt, it's ALWAYS best to set the initial value.To shaz, you don't set the variable at 0, there's no need, variables are 0 by default.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.