[Nevermind...] Break out of a Ren'Py while loop
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
[Nevermind...] Break out of a Ren'Py while loop
Is their any way to break out of a standard Ren'Py while loop? It's obviously doable in Python code, but Ren'Py doesn't seem to support anything that can break out of a loop altogether. Is there something I'm missing?
Last edited by Ivlivs on Thu Aug 26, 2010 8:52 pm, edited 1 time in total.
Re: Break out of a Ren'Py while loop
Not quite what I'm looking for; I need a break statement that can take me out of a loop as soon as its called.
Re: Break out of a Ren'Py while loop
I don't think I understand what you want to do.
You want to have a logical check whether you should loop or not, right after you called the loop?
Shouldn't you check it before, and if True send the player looping?
Side note, I couldn't find an end loop command, which would have been better than all those variables.
You want to have a logical check whether you should loop or not, right after you called the loop?
Shouldn't you check it before, and if True send the player looping?
Side note, I couldn't find an end loop command, which would have been better than all those variables.
Re: [Nevermind...] Break out of a Ren'Py while loop
Never mind. I haven't found a way to do a break statement the way Python does, but I found an alternative solution to my own problem -- a solution that didn't involve a break statement.
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: [Nevermind...] Break out of a Ren'Py while loop
The way I suggest doing this is to put a label after the loop, and then jump to that label.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]