Carneval
Carneval

Reputation: 9

Two ways to go about name choosing?

I have this RenPy code:

label name:
      $ mcname = renpy.input("What's your name?", default = "Sebastian")

        $ mcname = mcname.strip()
    
        if mcname == "":
            $ mcname = "Sebastian"

        if mcname == "Matthias": 
            jump twins

label twins:
    show matthias glitch
    Matthias "ℸ ̣ ⍑ᒷ∷ᒷ ᓵᔑリℸ ̣  ʖᒷ ℸ ̣ ∴𝙹 𝙹⎓ ⚍ᓭ, ℸ ̣ ⍑ᒷ∷ᒷ ∴𝙹リℸ ̣  ʖᒷ ℸ ̣ ∴𝙹 𝙹⎓ ⚍ᓭ"

    return

How can I make it so that, if the player chooses the name "Matthias", it triggers a quick end?

Upvotes: 0

Views: 193

Answers (1)

johannesmik
johannesmik

Reputation: 751

The return statement will end the game, when you have nothing on your call stack. So what you want to do, looks like follows:

label start:
    # Make sure to use "jump name" and not "call name"
    jump name

label name:
    $ mcname = renpy.input("What's your name?", default="Sebastian")
    $ mcname = mcname.strip()

    if mcname == "":    
        $mcname = "Sebastian"

    if mcname == "Matthias":
        "[mcname] isn't a proper name!"
        jump twins
    else:
        "[mcname] is a good name!"
        jump story

label twins:
    show matthias glitch
    "Matthias" "glitch..."
    return

label story:
    "The game continues"
    "Write more here"
    return

Upvotes: 0

Related Questions