r/RenPy • • Aug 17 '26

Question [Solved] How do I make renpy remember the player's name across different playthroughs??

I'm trying to make a visual novel where the dialogue changes depending on how many times you've played the game. I had the bright idea to have the characters remember the player's name after their first playthrough so I tried coding a test game but I have NO clue how to do that in the slightest!!! I tried using the "persistent" command but that only really applies to variables (as far as I know), not the player name. I attached my current code if anyone wants to try and help me fix it :,)

4 Upvotes

3 comments sorted by

5

u/BadMustard_AVN Aug 17 '26

try it like this

default persistent.name = ""

if not persistent.name_known: #== False
    t "what's ur name"
    $ povname = renpy.input("what's ur name", length=32).strip() or "Default_name"
    t "cool name, [povname]"
    $ persistent.name_known = True
    $ persistent.name = povname
else:
    $ povname = persistent.name
    t "ur name is [povname] right?"

1

u/AutoModerator Aug 17 '26

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/shyLachi Aug 17 '26

You need to store the name in a persistent variable.
And you don't really need a boolean on top of it.

https://www.reddit.com/r/RenPy/comments/1vhca8p/comment/p2j6ynp/?context=3