Page 1 of 1

"Linear" auto save/load functionality

Posted: Fri Sep 11, 2020 10:28 am
by cppietime
I'm wondering if it is possible to replace RenPy's default saving/loading behavior with an autosave that only keeps track of one state and, upon restarting the game, automatically loads the save file.
In other words, when starting a new game, it starts from the beginning like normal. While the player is playing, it autosaves regularly and/or upon quitting to a single save file, then, when the player starts up the game again, instead of manually loading the save file, the game automatically loads the singular save file it automatically created.
Is there any simple-ish way to achieve this, or do I need to pretty much write my own saving/loading handling?

Re: "Linear" auto save/load functionality

Posted: Fri Sep 11, 2020 11:10 am
by RicharDann
You could try setting a few configuration variables to achieve that. Something like the following code:

Code: Select all

# set autosave_slots to 1 so Ren'Py uses only one save file.
define config.autosave_slots = 1

# set the autosave frequency per interaction. Interaction is any time the game waits for user input, like every say (dialogue) statement.
define config.autosave_frequency = 10

# make it so the game auto saves upon the player quitting
define config.autosave_on_quit = True

# define the name of the save file that will be auto loaded. 
define config.auto_load = "auto-1"
You can check the documentation about those here:
https://www.renpy.org/doc/html/config.html

Re: "Linear" auto save/load functionality

Posted: Fri Sep 11, 2020 2:04 pm
by cppietime
That doesn't seem to quite work. Even if I set frequency to 1, sometimes when I make progress then close the program, when I restart, it for some reason goes back to an old save.