0

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?

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Carneval
  • 9
  • 1
  • 3
    Welcome to Stack Overflow. Please read [ask] and note well that this is **not a discussion forum**. We want questions to be asked **directly**, and not conversationally. Aside from that, I can't understand the title you have chosen for the question. What do you mean about "two ways"? Also: **what happens** when you try your existing code? **How is that different** from what you want to happen? – Karl Knechtel Feb 01 '23 at 22:06

1 Answers1

0

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
johannesmik
  • 731
  • 1
  • 8
  • 18
  • Isn't OP already doing that? What actually is wrong with the original code? – Karl Knechtel Feb 01 '23 at 22:07
  • It's difficult to see without seeing the whole source code, including what happens inside the `start` label. One potential problem is that OP is calling the `name` with `call name`. I'll edit my answer to make it clearer. – johannesmik Feb 01 '23 at 22:53