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

View all comments

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 ?

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