Skip to content

Autosave

Saves the game by itself while its scene is played, in a slot of its own (“Auto”) that a Continue button loads like any other saved game, it being the latest: as the scene starts (a checkpoint as the player arrives), every few minutes of play, and as the game is closed. One anywhere in the scene is enough; put one in each scene that’s played (a prefab does), and none on the title screen or in menus, so Continue never goes back to them.

It saves as Game.SaveGame does, so the game saved is the same, and loading it doesn’t save it again as it starts. Minutes are of game time, so they don’t pass while the game is paused. Not in a network game.

Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.

  • everyMinutes: a number = 5. Minutes of play between saves (game time: not while paused). 0 saves only as the scene starts and as the game closes. (Field: a number.)
  • onArrive: true or false = true. Saves as its scene starts, once its scripts have: a checkpoint as the player arrives (not when a saved game is loaded). (Field: on or off.)
  • onQuit: true or false = true. Saves as the game is closed (or, in the editor, as Play is stopped). (Field: on or off.)
  • slot: text = “Auto”. The slot it saves in: “Auto” unless you name another. (Names a save slot: this entity’s own, which other fields can name.) (Field: a name.)
  • setting: text = null. A name in Game.SaveData that turns it off while it’s false: the player’s own switch, a Toggle with this Save As on the options screen (“settings.autosave”, kept by New Game). Empty is always on. (Names a name in the save data.) (Field: a name.)

Scripts use it as Autosave: its methods, events and values that aren’t saved with the scene.