RuntimeError: maximum recursion depth exceeded while calling a Python object

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
catskulls
Newbie
Posts: 3
Joined: Sat Nov 27, 2021 8:46 am
itch: catskullspng
Discord: catskulls#7257
Contact:

RuntimeError: maximum recursion depth exceeded while calling a Python object

#1 Post by catskulls »

Hey there folks!
I've been trying to make this sort of chatbot type of project, and due to being a total newbie at this game development stuff, I've ran into quite a bit of problems, this being the one stumping me the most, which is this "RuntimeError" apparently.

Here's my code:

Code: Select all

define c = Character("Nell")
define p = Character('[p]')
define prns = ('[q]')

define persistent.intros = 0


label start:

    $_game_menu_screen = None

    if persistent.intros:

         jump chatbase

    show nell

    c "Hey there."
    c "My name is Nell, it's very nice to meet you."
    c "I'd love to get to know you, what's your name?"

    $ p = renpy.input("What is your name?").strip()

    c "Your name is [p]?"
    c "May I ask what pronouns you use?"

    $ q = renpy.input("What pronouns do you use?").strip()

    c "Thank you, I'll use [q] from now on."
    c "If you want me to use other pronouns for you, please let me know."

    $ persistent.intros = 1

label chatbase:

    c "Hello, [p]!"
And right after the [p] (or [q, neither worked]), I get the error.

Code: Select all

While running game code:
  File "game/script.rpy", line 41, in script
    c "Hello, [p]!"
RuntimeError: maximum recursion depth exceeded while calling a Python object
From what I know of, this error means the game is going in a sort of loop thing? Not sure, but I haven't found a way to stop the loop.

I've tried looking everywhere on the internet for help but everything I've found is tutorials for Python, which (due to my massive lack of knowledge in code) I can't really use here.

Any tips? Thanks :)

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: RuntimeError: maximum recursion depth exceeded while calling a Python object

#2 Post by rayminator »

don't use the same letter as the define character

Code: Select all

define p = Character('[person_name]')
$ person_name = renpy.input("What is your name?").strip()

catskulls
Newbie
Posts: 3
Joined: Sat Nov 27, 2021 8:46 am
itch: catskullspng
Discord: catskulls#7257
Contact:

Re: RuntimeError: maximum recursion depth exceeded while calling a Python object

#3 Post by catskulls »

Thanks for the help, this solved it!
Though, now I keep getting this "KeyError u'p'", but I'll get to solving that now.
Thanks again, you really helped me out! :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Ocelot, voluorem