"Linear" auto save/load functionality

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
cppietime
Newbie
Posts: 10
Joined: Mon Feb 09, 2015 11:45 am
Contact:

"Linear" auto save/load functionality

#1 Post by cppietime » Fri Sep 11, 2020 10:28 am

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?

User avatar
RicharDann
Veteran
Posts: 239
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: "Linear" auto save/load functionality

#2 Post by RicharDann » Fri Sep 11, 2020 11:10 am

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
The most important words a man can say are, “I will do better.”

cppietime
Newbie
Posts: 10
Joined: Mon Feb 09, 2015 11:45 am
Contact:

Re: "Linear" auto save/load functionality

#3 Post by cppietime » Fri Sep 11, 2020 2:04 pm

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.

Post Reply

Who is online

Users browsing this forum: djinius