Saving a game with no save buttons or screens at all. (help)

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
User avatar
beastcarving
Regular
Posts: 139
Joined: Mon May 13, 2019 5:03 pm
Completed: Pulse Cage https://beastcarving.itch.io/pulse-cage-the-full-series
Projects: Your Brother's Religion
Organization: BeastCarving Studio
IRC Nick: BeastCarving
Tumblr: beastcarving
Deviantart: beastcarving
Github: beastcarving
itch: beastcarving
Contact:

Saving a game with no save buttons or screens at all. (help)

#1 Post by beastcarving » Sun Jan 12, 2020 9:45 pm

Instead of making a save screen and a quick save button, is there a way to make the game save on it's own and remember your spot in the game even when the game is abruptly closed. Is there a way to do this?
Image Pulse Cage (full game)Image Your Brother's Religion (Demo)
PLAY HERE: https://beastcarving.itch.io/
Love my work: https://www.patreon.com/beastcarving

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Saving a game with no save buttons or screens at all. (help)

#2 Post by Imperf3kt » Sun Jan 12, 2020 11:02 pm

If you only ever intend to have a single save file, you could set up the game to autoload the most recent auto save.

I've never tried so couldn't suggest a way to do it, but I have made a button that loads the most recent (non auto) save file upon being pressed.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
beastcarving
Regular
Posts: 139
Joined: Mon May 13, 2019 5:03 pm
Completed: Pulse Cage https://beastcarving.itch.io/pulse-cage-the-full-series
Projects: Your Brother's Religion
Organization: BeastCarving Studio
IRC Nick: BeastCarving
Tumblr: beastcarving
Deviantart: beastcarving
Github: beastcarving
itch: beastcarving
Contact:

Re: Saving a game with no save buttons or screens at all. (help)

#3 Post by beastcarving » Mon Jan 13, 2020 5:38 am

So I tied it out. I made one save slot mainly the auto save one. Then I got stuck and I'm not too sure where I got lost.

# I think I might have got lost defining the autosave and autoload. But this is where I've gotten to.

Code: Select all

init python:
    config.has_autosave = True
    config.autosave_slots = 10
    config.autosave_on_choice = True
    config.autosave_on_quit = True


# So the code here is placed in the script.

Code: Select all

        screen book1():
        # I have some imagemaps here: "..."
            ...
            ...
            ...
            if chapter1:
                if persistent.s == "autosave":
                    textbutton _"Read Story" action Start ("chapter1")

                else:
                    textbutton _"continue" action "autoload"  
                            
Image Pulse Cage (full game)Image Your Brother's Religion (Demo)
PLAY HERE: https://beastcarving.itch.io/
Love my work: https://www.patreon.com/beastcarving

Post Reply

Who is online

Users browsing this forum: No registered users