Ren'Py infinite loop ?

Aug 20, 2018
18
5
I was trying to make conditional statements with if/else for different path choices and now I'am stuck with this error what i'am I not seeing?
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,559
2,175
Same with the label Wait:

Usual convention would be to use the menu itself as a label and jump back to that, if you absolutely need to.

You don't have permission to view the spoiler content. Log in or register now.

Hopefully something in there will be more or less what you are looking for.
 
Last edited:

f95zoneuser463

Member
Game Developer
Aug 14, 2017
219
1,016
You have two infinite loops in your script that raise this exception.

Code:
label wait:
    jump wait

label shout:
    jump shout
Not sure what you are trying to do. If you want a choice to be visible based on a condition it should look like this:

Code:
$ allow_shout = False      # declare variable
menu:
    "wait":
        jump wait
    "shout" if allow_shout == True:
        jump shout

label wait:
    "waiting ..."
    "Code is more readable if long dialogues are not placed inside indented menu-choices."
    jump continue_story

label shout:
    "LOOOOUD NOISE !!!"
    jump continue_story

label continue_story:
    $ del allow_shout     # delete variable
    "... and at the end everybody died in pain. *roll credits*"
Usual convention would be to use the menu itself as a label and jump back to that
Damn, I did not even know that using a menu as label was possible. I've always placed custom label before the menu if I wanted to jump back.

edit: forum seems to ignore custom-color-tags :unsure: code is suppose to be green, only works in preview
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,130
14,809
Though, if you really want to start getting more complex, then you could use something more like this...
You don't have permission to view the spoiler content. Log in or register now.
This is a little more involved.
Menu options for "Wait" and "Shout" are only shown if the menuopt1 and menuopt2 variables are set to True.
Initially that's true for both.
This can be done in a more simpler way, by using the set property of the menu statement.

You don't have permission to view the spoiler content. Log in or register now.
Ren'py will automatically use the myMenu01 list to store the chosen options and decide if one should be displayed or not.

This don't invalidate the fact that you can still condition the option, and you can also have a condition based on the said list :
You don't have permission to view the spoiler content. Log in or register now.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,559
2,175
This can be done in a more simpler way, by using the set property of the menu statement.

You don't have permission to view the spoiler content. Log in or register now.
Ren'py will automatically use the myMenu01 list to store the chosen options and decide if one should be displayed or not.
Ohhhh... I like that. :love:
I'm not entirely sure I understand WHY it works... but I can fix my ignorance by typing it in and opening the console.
Cheers.
 
Last edited: