"Possible infinite loop" error on choice menu?
Posted: Mon Mar 02, 2020 9:42 am
Hey all! I programmed the first choices into the game and wanted to make the menu options disappear once you've been through that option. Everything works splendid up until all options have been through and the game should jump to the next scene. The game lags out (not responding) and then this shows up:
```
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 168, in script
jump choice1 #if menuset doesn't have enough length, go back to menu
Exception: Possible infinite loop.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 168, in script
jump choice1 #if menuset doesn't have enough length, go back to menu
File "C:\Users\Ches\Downloads\renpy-7.3.5-sdk\renpy\execution.py", line 59, in check_infinite_loop
raise Exception("Possible infinite loop.")
Exception: Possible infinite loop.
Windows-8-6.2.9200
Ren'Py 7.3.5.606
LOVESICK 1.0
Mon Mar 02 15:39:28 2020
```
I understand the reasoning behind it, but I've done it in a way that should make the transition seamless, using another tutorial that has worked well before.
I wonder what's wrong?
```
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 168, in script
jump choice1 #if menuset doesn't have enough length, go back to menu
Exception: Possible infinite loop.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 168, in script
jump choice1 #if menuset doesn't have enough length, go back to menu
File "C:\Users\Ches\Downloads\renpy-7.3.5-sdk\renpy\execution.py", line 59, in check_infinite_loop
raise Exception("Possible infinite loop.")
Exception: Possible infinite loop.
Windows-8-6.2.9200
Ren'Py 7.3.5.606
LOVESICK 1.0
Mon Mar 02 15:39:28 2020
```
I understand the reasoning behind it, but I've done it in a way that should make the transition seamless, using another tutorial that has worked well before.
Code: Select all
menu choice1:
set menuset
"Where should I head to next?"
"Explore school grounds":
jump explore_school_grounds
"Go back inside":
jump back_inside
"Go to the cafeteria":
jump cafeteria
if len(menuset) == 3: #number of possibilities
$menuset = set() #I guess you'd need to reset to 0 or use different variable set to use this trick somewhere else
jump scene2 #name of your label after events
else:
jump choice1 #if menuset doesn't have enough length, go back to menu