The Persistent Object on Renpy
I'm... really not back, I got a writers block almost all July and August and everything I had to add was way more that I anticipated.
BUT, I can talk about something I discovered about the framework while doing the visual novel.
Do you remember those parts in Undertale in which the characters muse about remembering something you did in another playthrough? Like Toriel remembering your pick for favorite pie? Well, I tried to add something similar to the game and I found a save system they use with an object called Persistent.
The way to use it is adding to the object persistent a new attribute, and since Python is dynamic is actually quite simple. You go:
$ persistent.value = "Value to save"
(The $ sign is used on Renpy as a escape system of sorts. Everything after the $ symbol is going to be interpreted as pure Python code, instead of some Renpy formatting)
After you add all the values you need to save, you need to call the function which is going to save this. Which is this one:
$ renpy.save_persistent()
Your save folder should have a new file now, called persistent.
The cool thing is the persistent file is going to be read always no matter which save you load or if you close the game and then open it. You can even call this variables BEFORE the main menu. By using the reserved label "splashscreen".
There you have it.
Get User Interface
User Interface
An Undertale Fan Visual Novel about trying really hard. And failure.
Status | Released |
Author | Ginny Neutron |
Genre | Interactive Fiction, Visual Novel |
Tags | Fangame |
Languages | English |
More posts
- User Interface v0.4.3Dec 13, 2020
- How to mark a button as already selected in RenpySep 20, 2020
- User Interface Vr 0.4.0Jul 17, 2020
- I'm not dead, just depressedJun 25, 2020
- User Interface Chapter 3, with Graphics!Dec 08, 2019
- How to put voice to Characters in Renpy (Character Callback)Nov 12, 2019
- My computer fried (Edit: Not anymore)Oct 22, 2019
- User Interface Chapter 3 (Text Only)Oct 07, 2019
- How to jump to the title screen in RenpyJul 31, 2019
Leave a comment
Log in with itch.io to leave a comment.