Is it possible to make a player name persistent? So, if you close the game, it would retain your name when you came back?
Going off of that, is it possible to put player names in the settings, rather than having it as a prompt within the script?
Thanks!
[SOLVED] Persistent Player Data
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.
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.
[SOLVED] Persistent Player Data
Last edited by 4listair on Sun Aug 05, 2018 9:17 pm, edited 2 times in total.
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Persistent Player Data
1. With this code the game will ask for the players name the first time a new game is started.
The following times new games are started the game will go directly to welcome (pname)
Code: Select all
default pname=""
if not persistent.playername:
$ pname= renpy.input("What is your name?")
$ pname=pname.strip()
$ persistent.playername = pname
$ renpy.save_persistent()
else:
$ pname=persistent.playername
"Welcome [pname]."
2. Yes you could add an input element to the settings screen - or another screen- and collect the input data for the player name from that.
Who is online
Users browsing this forum: apocolocyntose, Bing [Bot], Majestic-12 [Bot], Semrush [Bot]