Saves and autosaves

Dear people at intfiction.org.

Once again I require your help. It’s probably something absolutely silly to ask for, but anyway I’m afraid I have to expose how abysmal my ignorance still is.

As my project has advanced, I figure it’s time to set autosaves at some points, in order to avoid readers to lose all progress and restart from scratch if something unexpected happens.

For now, when I open the preset UIBar included save button, there’s no autosave [A] slot present, only the default [1-8] slots.
I’m pretty sur most people manage to move around this roadblock quite easily, but at the moment I can’t find in the documentation how to make this [A] slot appear.
I can’t find it neither with an internet search, nor with a forum search here. It probably means the answer is pretty straightforward…

To autosave only in certain passages, put the following code in your story JavaScript:

Config.saves.autosave = ["autosave"];

Then add the “autosave” tag to all passages you want to autosave in. I’ve been using this in my projects and it’s working fine (I also think it’s a good idea to inform the player whenever the game autosaves, simply by mentioning that in the particular passages).

(source: SugarCube v2 Documentation)

Oh, and if you want the player to be able to load the Autosave without opening the Saves menu, you can do it through a link:

<<link "Load Autosave">><<run Save.autosave.load()>><</link>>

You can then put

 #menu-item-saves {
    display: none;
  }

in your story stylesheet to get rid of the Saves button, if you want to.

3 Likes

Many thanks Agnieszka!

1 Like