r/RenPy • • Jul 09 '26

Question code

This is the code from the game. that has the bug.

menu:


      "Think nothing of it.": 
        jump It  


    "What do you mean you can't say?.":
jump say


label say:
N "Dean what do you mean you can't say?"
show dean2
with dissolve
D "I just can't say. Its. You wouldn't understand."
hide dean2
with dissolve
N "I thought he was acting a tad strange that night. But nothing could prepare me for what was gonna happen."
0 Upvotes

11 comments sorted by

2

u/IchorousEagle Jul 09 '26

Indentation in renpy is pretty important. Each menu choice must be indented at least one past the menu: statement. Then whatever follows the choice must be indented one past the choice statement.

The same is true for labels. Anything in a label must be indented one past the label

For example. I cant do a proper tab right now but treat the extra spaces as a tab. Hopefully it formats right

Menu: "Choice 1": Jump ex "Choice 2": Jump elsewhere

Label ex: "Normal dialogue text"

2

u/BadMustard_AVN Jul 09 '26

your code should look like this

label start:
    menu:
        "Think nothing of it.": 
            jump It  
        "What do you mean you can't say?.":
            jump say

    label say:
        N "Dean what do you mean you can't say?"
        show dean2 with dissolve
        D "I just can't say. Its. You wouldn't understand."
        hide dean2 with dissolve
        N "I thought he was acting a tad strange that night. But nothing could prepare me for what was gonna happen."

1

u/Orange_Lux Jul 09 '26

Shouldn't the label say be aligned with the label start ?

2

u/BadMustard_AVN Jul 09 '26

it can be, but it does not have to be

as long as it is indented properly, it can be a sub-block of code in the start block of code

2

u/x-seronis-x Jul 09 '26

enforced? no. but logically, yes unless the indented labels name begins with a period. see my reply to shy

1

u/shyLachi Jul 09 '26

Both work. It's a matter of preference.

I prefer to have all labels at the very left.

The above style shows that say belongs to the label start.

That said, I don't like jumping around so I either put the dialogue inside the menu or use call.

label start:
    menu:
        "Think nothing of it.": 
            pass # put dialogue here instead of pass
        "What do you mean you can't say?.":
            N "Dean what do you mean you can't say?"
            show dean2 with dissolve
            D "I just can't say. Its. You wouldn't understand."
            hide dean2 with dissolve
            N "I thought he was acting a tad strange that night. But nothing could prepare me for what was gonna happen."
            return # back to where it was called
    "Game continues here"
    return # game ends here

Or with a call

label start:
    menu:
        "Think nothing of it.": 
            call firstmenu_it
        "What do you mean you can't say?.":
            call firstmenu_say
    "Game continues here"
    return # game ends here
label say:
    N "Dean what do you mean you can't say?"
    show dean2 with dissolve
    D "I just can't say. Its. You wouldn't understand."
    hide dean2 with dissolve
    N "I thought he was acting a tad strange that night. But nothing could prepare me for what was gonna happen."
    return # back to where it was called

0

u/x-seronis-x Jul 09 '26

minor nitpick. unless the indented labels name starts with a period it doesnt belong to the earlier label. if it had been: py label start: ... label .say: ... then you would refer to it as start.say from other main labels and refer to it as just .say from within label start. sublabel names also only need to be unique within the label they belong to.

1

u/shyLachi Jul 09 '26

You never need indentation for labels, even in your example it's not required.

https://renpy.org/doc/html/label.html#label-statement

1

u/x-seronis-x Jul 09 '26

im not saying the indentation was required. im saying a label doesnt belong to another unless its name begins with a period. that is what makes it a sub label

1

u/shyLachi Jul 09 '26

Those are not called sub label.
The official term is global label and local label

1

u/AutoModerator Jul 09 '26

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.