Ren'Py Help with Menuset [SOLVED]

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,364
15,281
Edit: I've just seen you've fixed it with default, and yeah... I can imagine that. Except as long as the $ menuset1 = [] type lines were immediately before the first menu: statement, it should have been fine.
Ideally, when you use a menuset with your menu, you should have two entry points for the said menu, using inner labels at your advantage. Something that would looks like that :

Python:
label whatever:
    [...]
    jump myMenu

#  Entry point with initialization, 
# intended for call/jump coming from the outside.
label myMenu:
    # Ensure to have a clean /menuset/ variable.
    $ menuset = set()
    #  Entry point without the initialization,
    # intended for jump coming from the inside.
    menu .inside:
        set menuset
        "choice 1":
            [...]
            jump .inside
        "choice 2":
            [...]
            jump .inside
        "take a shower":
            # Once again, ensure to have a clean variable.
            $ menuset1 = set()
            menu .shower:
                set menuset1
                "Use soap":
                    [...]
                    # Jump on the inside menu
                    jump .shower
                "Use shampoo":
                    [...]
                    # Jump on the inside menu
                    jump .shower
                "I've finished":
                    [...]
                    # Return to the main menu
                    jump .inside
The advantage is that ".inside" and ".shower" are local to the current label. Whatever if you have more than one "label .inside", using it this way will always send you to the right part of your code. But in the same time, if you want you still can access the label from the outside by using the Fully Qualified form of the label (label.innerLabel):
Python:
label whatever:
    "In whatever label"
    $ count = 0
    label .inside:
       $ count += 1
       "whatever - iteration [count]"
       if count < 3:
           # Will sent you to /whatever.inside/
           jump .inside
       jump otherLabel

label otherLabel:
    "In otherLabel label"
    $ count = 0
    label .inside:
       $ count += 1
       "otherLabel - iteration [count]"
       if count < 3:
           # Will sent you to /otherLabel.inside/
           jump .inside
       $ count = 0
       # Will sent you to /whatever.inside/
       jump whatever.inside
       return
This permit you, by example, to have inner menus, but without effectively putting their code inside your menu ; and without having to call them if you don't feel at ease with that :
Python:
label start:
    jump menuTest

label myMenu:
    $ menuset = set()
    menu .inside:
        set menuset
        "choice 1":
            [...]
            jump .inside
        "choice 2":
            [...]
            jump .inside
        "take a shower":
            # Ensure that /menuset1/ is clean.
            $ menuset1 = set()
            # Jump to the deported inner menu.
            jump menuShower

menu menuShower:
    set menuset1
    "Use soap":
        [...]
        #  Here you can directly jump to the main label
        # since the /menuset/ is initialized outside.
        jump menuShower
    "Use shampoo":
        [...]
        jump menuShower
    "Finished":
        [...]
        #  Return directly to the previous menu
        # without passing by the /menuset/ initialization.
        jump myMenu.inside
 
  • Like
Reactions: _13_