Skip to main content

Save Data

These functions allow you to create save data. When save data is loaded, the game will load the scene that was active when the save was created, and resume the scene from the specific State or Choice node that created the save data. In other words, the script that caused save data to be created, will run again from the top. (The save dialog will not be presented again.)

If you're looking for the functions for changing the actual save data contents, check Variables & Persistent Storage.

Note that if the user creates a manual save using the save menu presented by SaveData.ShowSaveDialog(), any checkpoint save data created using SaveData.TakeCheckpoint() is deleted. This is done to avoid the potentially confusing scenario where the user could be led to believe that their checkpoint is more recent than their last manual save.

SaveData.ShowSaveDialog
Opens a screen where the player can choose to save their progress to disk.
SaveData.TakeCheckpoint
quiet
  • quiet (boolean) - optional - if true, suppress 'checkpoint reached' message. defaults to false.
Create a checkpoint (auto-save). The player may load this checkpoint if their game ends. If there already is a checkpoint file, it is overwritten.
SaveData.IsRestoringGame
  • (boolean) - save restore flag
For advanced users. Indicates whether a game is currently starting up, including starting a new game. This will return true between the time gameplay starts, and the first State has finished running. In all other cases, this will return false. So it will return true during the first State's Actions Taken script, or Choice node's Appears When scripts (but not Actions Taken, because they run later, when the player clicks them), or in Script asset main bodies. You can use this function to detect that the player reloaded save data.