- Aug 28, 2018
- 1,896
- 2,875
I grabbed some code from the Ren'py documentation to allow my player to enter their name and then use it as a variable in the game.
This is the code, in script lines 13-22:
When I try to run the game, I get a runtime error of maximum recursion depth exceeded in __instancecheck__ on line 28, which is the first place I try to call that defined variable:
Do I need to terminate the Python code somehow, or is there something else wrong here? I am absolutely a NooB in both Ren'py and Python, so I appreciate any help that can be rendered here.
This is the code, in script lines 13-22:
Code:
define playername = Character("[playername]", color="#c8c8ff")
python:
playername = renpy.input("What is your name?")
playername = playername.strip()
if not playername:
playername = "Bob"
playername "My name is [playername]!"
# The game starts here.
label start:
playername "Phew!"
Code:
playername "Phew!"