ESCSaveManager

Constants Descriptions

CRASH_SAVE_NAME_TEMPLATE

const CRASH_SAVE_NAME_TEMPLATE: String = "crash_autosave_%s_%s.tres"

Template for crash savegames filenames

SAVE_NAME_TEMPLATE

const SAVE_NAME_TEMPLATE: String = "save_%03d.tres"

Template for savegames filenames

SETTINGS_TEMPLATE

const SETTINGS_TEMPLATE: String = "settings.tres"

Template for settings filename

Property Descriptions

save_enabled

var save_enabled: bool = true

If true, saving a game is enabled. Else, saving is disabled

save_folder

var save_folder: String

Variable containing the saves folder obtained from Project Settings

crash_savegame_filename

var crash_savegame_filename: String

Filename of the latest crash savegame file

settings_folder

var settings_folder: String

Variable containing the settings folder obtained from Project Settings

Method Descriptions

get_saves_list

func get_saves_list() -> Dictionary

Return a list of savegames metadata (id, date, name and game version)

save_game_exists

func save_game_exists(id: int) -> bool

Returns true whether the savegame identified by id does exist

## Parameters

  • id: integer suffix of the savegame file

save_game

func save_game(id: int, p_savename: String)

Save the current state of the game in a file suffixed with the id value. This id can help with slots development for the game developer.

## Parameters

  • id: integer suffix of the savegame file

  • p_savename: name of the savegame

save_game_crash

func save_game_crash()

Performs an emergency savegame in case of crash.

load_game

func load_game(id: int)

Load a savegame file from its id.

## Parameters

  • id: integer suffix of the savegame file

save_settings

func save_settings()

Save the game settings in the settings file.

load_settings

func load_settings() -> Resource

Load the game settings from the settings file Returns The Resource structure loaded from settings file