Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.SaveSystem Class Reference
Inheritance diagram for AC.SaveSystem:

Public Member Functions

void GatherSaveFiles ()
 
void GatherImportFiles (string projectName, string filePrefix, int boolID)
 Searches the filesystem for all available import files, and stores them in foundImportFiles. More...
 
void SetSelectiveLoadOptions (SelectiveLoad selectiveLoad)
 Sets the local instance of SelectiveLoad, which determines which save data is restored the next time (and only the next time) LoadGame is called. More...
 
void ClearAllData ()
 
void ReceiveDataToImport (SaveFile saveFile, string fileData)
 Processes the save data requested by ImportSaveGame More...
 
void ReceiveDataToLoad (SaveFile saveFile, string fileData)
 Processes the save data requested by LoadSaveGame More...
 
PlayerData GetPlayerData (int playerID)
 Gets all recorded data related to a given Player. This should typically be an inactive Player - otherwise the active Player should just be read directly More...
 
void InitAfterLoad (int saveID=-1)
 
void SwitchToPlayerInDifferentScene (int playerID, int sceneIndex, bool doOverlay)
 Switches to a new Player in a different scene More...
 
void SwitchToPlayerInDifferentScene (int playerID, string sceneName, bool doOverlay)
 Switches to a new Player in a different scene More...
 
void OnCompleteSaveOperation (SaveFile saveFile, bool wasSuccesful, SaveOperation saveOperation)
 
void SaveCurrentPlayerData ()
 Stores the PlayerData of the active Player. More...
 
void SaveNonPlayerData (bool stopFollowCommands)
 
bool DoImportCheck (string fileData, int boolID)
 Checks that another game's save file data is OK to import, by checking the state of a given boolean variable More...
 
string GetSlotLabel (int elementSlot, int saveID, bool useSaveID, SaveFile[] saveFiles)
 Gets the label of a save file. More...
 
Texture2D GetScreenshot (int elementSlot, int saveID, bool useSaveID, SaveFile[] saveFiles)
 Gets the screenshot of a save file. More...
 
int GetPlayerSceneIndex (int ID)
 Gets the current scene index that a Player is in. More...
 
string GetPlayerSceneName (int ID)
 Gets the current scene name that a Player is in. More...
 
void MoveInactivePlayerToCurrentScene (int ID, TeleportPlayerStartMethod teleportPlayerStartMethod, PlayerStart newPlayerStart=null, System.Action onComplete=null)
 Updates the internal record of an inactive Player's position to the current scene, provided that player-switching is allowed. If that Player has an Associated NPC, then it will be spawned or teleported to the Player's new position More...
 
void MoveInactivePlayer (int ID, int newSceneIndex, TeleportPlayerStartMethod teleportPlayerStartMethod, int newPlayerStartConstantID=0, System.Action onComplete=null)
 Moves an inactive Player to a new scene More...
 
void MoveInactivePlayer (int ID, string newSceneNamex, TeleportPlayerStartMethod teleportPlayerStartMethod, int newPlayerStartConstantID=0, System.Action onComplete=null)
 Moves an inactive Player to a new scene More...
 
IEnumerator AssignPlayerData (Player player)
 Updates a Player object with its associated saved data, if it exists. More...
 
InvCollection GetItemsFromPlayer (int _playerID)
 Returns a collection of inventory items currently carried by a particular Player. More...
 
void AssignItemsToPlayer (InvCollection invCollection, int _playerID)
 Re-assigns the inventory items currently carried by a particular Player. More...
 
void SetInitialPlayerID ()
 
IEnumerator SpawnAllPlayers ()
 
IEnumerator SpawnFollowingPlayers ()
 
void AssignObjectivesToPlayer (string dataString, int _playerID)
 
void RenameSave (string newLabel, int saveIndex)
 Renames the label of a save game file. More...
 
void RenameSaveByID (string newLabel, int saveID)
 Renames the label of a save game file. More...
 
void DeleteProfile (int profileIndex=-2, bool includeActive=true)
 Deletes a player profile by referencing its entry in a MenuProfilesList element. More...
 
void DeleteProfileID (int profileID)
 Deletes a player profile ID. More...
 
void DeleteSave (int elementSlot, int saveID, bool useSaveID)
 Deletes a save game file. More...
 
int GetNumSaves (bool includeAutoSaves=true)
 Gets the number of save game files found. More...
 
SaveFile GetSaveFile (int saveID)
 Gets an existing SaveFile found on the system More...
 

Static Public Member Functions

static string GetSaveExtension ()
 Gets the extension of the current save method. More...
 
static bool DoesImportExist (int saveID)
 Checks if an import file with a particular ID number exists. More...
 
static bool DoesSaveExist (int elementSlot, int saveID, bool useSaveID)
 Checks if a save file with a particular ID number exists More...
 
static bool DoesSaveExist (int saveID)
 Checks if a save file with a particular ID number exists More...
 
static void LoadAutoSave ()
 
static void ImportGame (int elementSlot, int saveID, bool useSaveID)
 Imports a save file from another Adventure Creator game. More...
 
static bool ContinueGame ()
 Loads the last-recorded save game file. More...
 
static bool LoadGame (int saveID)
 Loads a save game file. More...
 
static void LoadGame (SaveFile saveFile)
 Loads a save game file. More...
 
static bool LoadGame (int elementSlot, int saveID, bool useSaveID)
 Loads a save game file. More...
 
static SaveData ExtractMainData (string saveFileContents)
 Extracts global data from a save game file's raw (serialized) contents More...
 
static List< SingleLevelDataExtractSceneData (string saveFileContents)
 Extracts all scene data from a save game file's raw (serialized) contents More...
 
static void ExtractSaveFileVariables (SaveFile saveFile, System.Action< List< GVar >> callback)
 Extracts the Global Variables data of from a save file More...
 
static void SaveNewGame (bool overwriteLabel=true, string newLabel="")
 Create a new save game file. More...
 
static void SaveAutoSave ()
 Overwrites the AutoSave file. More...
 
static void SaveGame (int saveID, bool overwriteLabel=true, string newLabel="")
 Saves the game. More...
 
static void SaveGame (int elementSlot, int saveID, bool useSaveID, bool overwriteLabel=true, string newLabel="")
 Saves the game. More...
 
static int GetNumImportSlots ()
 Gets the number of found import files. More...
 
static int GetNumSlots ()
 Gets the number of found save files. More...
 
static string GenerateSaveSuffix (int saveID, int profileID=-1)
 Creates a suffix for save filenames based on a given save slot and profile More...
 
static string GetImportSlotLabel (int elementSlot, int saveID, bool useSaveID)
 Gets the label of an import file. More...
 
static string GetSaveSlotLabel (int elementSlot, int saveID, bool useSaveID)
 Gets the label of a save file. More...
 
static Texture2D GetImportSlotScreenshot (int elementSlot, int saveID, bool useSaveID)
 Gets the screenshot of an import file. More...
 
static Texture2D GetSaveSlotScreenshot (int elementSlot, int saveID, bool useSaveID)
 Gets the screenshot of a save file. More...
 
static void AssignVariables (string runtimeVariablesData, bool fromOptions=false)
 Unloads stored global variable data back into the RuntimeVariables script. More...
 
static string CreateVariablesData (List< GVar > vars, bool isOptionsData, VariableLocation location)
 Condenses the values of a List of variables into a single string. More...
 
static List< GVarUnloadVariablesData (string data, bool updateExistingVars, List< GVar > existingVars, bool fromOptions=false)
 Updates a list of Variables with value data stored as a string. More...
 
static void DeleteSave (int saveID)
 Deletes a save game file. More...
 

Public Attributes

List< SaveFilefoundSaveFiles = new List<SaveFile> ()
 
List< SaveFilefoundImportFiles = new List<SaveFile> ()
 

Static Public Attributes

const string pipe = "|"
 
const string colon = ":"
 
const string mainDataDivider = "||"
 
const string mainDataDivider_Replacement = "*DOUBLEPIPE*"
 

Protected Member Functions

void OnEnable ()
 
void OnDisable ()
 
virtual Texture2D GetScreenshotTexture ()
 
void OnAddSubScene (SubScene subScene)
 

Static Protected Member Functions

static int GetDivider (string saveFileContents)
 

Protected Attributes

LoadingGame _loadingGame
 

Properties

virtual int ScreenshotWidth [get]
 
virtual int ScreenshotHeight [get]
 
int CurrentPlayerID [get, set]
 
bool IsTakingSaveScreenshot [get]
 
static iSaveFileHandler SaveFileHandler [get, set]
 
static iFileFormatHandler FileFormatHandler [get, set]
 
static iFileFormatHandler OptionsFileFormatHandler [get, set]
 
LoadingGame loadingGame [get]
 
static string PersistentDataPath [get]
 
static string SaveLabel [get]
 
static string ImportLabel [get]
 
static string AutosaveLabel [get]
 

Detailed Description

Processes save game data to and from scene objects.

Member Function Documentation

◆ AssignItemsToPlayer()

void AC.SaveSystem.AssignItemsToPlayer ( InvCollection  invCollection,
int  _playerID 
)

Re-assigns the inventory items currently carried by a particular Player.

Parameters
invCollectionThe collection of items representing the inventory items
_playerIDThe ID number of the Player to assign the inventory of

◆ AssignPlayerData()

IEnumerator AC.SaveSystem.AssignPlayerData ( Player  player)

Updates a Player object with its associated saved data, if it exists.

Parameters
playerThe Player to load animation data for

◆ AssignVariables()

static void AC.SaveSystem.AssignVariables ( string  runtimeVariablesData,
bool  fromOptions = false 
)
static

Unloads stored global variable data back into the RuntimeVariables script.

Parameters
runtimeVariablesDataThe values of all global variables, combined into a stingle string
fromOptionsIf true, only global variables that are linked to OptionsData will be affected

◆ ClearAllData()

void AC.SaveSystem.ClearAllData ( )

Clears all save data stored in the SaveData class.

◆ ContinueGame()

static bool AC.SaveSystem.ContinueGame ( )
static

Loads the last-recorded save game file.

Returns
True if a save-game file was found to load, False otherwise

◆ CreateVariablesData()

static string AC.SaveSystem.CreateVariablesData ( List< GVar vars,
bool  isOptionsData,
VariableLocation  location 
)
static

Condenses the values of a List of variables into a single string.

Parameters
varsA List of variables (see GVar) to condense
isOptionsDataIf True, only global variables that are linked to OptionsData will be included
locationThe variables' location (Local, Variable)
Returns
The variable's values, condensed into a single string

◆ DeleteProfile()

void AC.SaveSystem.DeleteProfile ( int  profileIndex = -2,
bool  includeActive = true 
)

Deletes a player profile by referencing its entry in a MenuProfilesList element.

Parameters
profileIndexThe index in the MenuProfilesList element that represents the profile to delete. If it is set to its default, -2, the active profile will be deleted
includeActiveIf True, then the MenuProfilesList element that the profile was selected from also displays the active profile

◆ DeleteProfileID()

void AC.SaveSystem.DeleteProfileID ( int  profileID)

Deletes a player profile ID.

Parameters
profileIDThe profile ID to delete

◆ DeleteSave() [1/2]

void AC.SaveSystem.DeleteSave ( int  elementSlot,
int  saveID,
bool  useSaveID 
)

Deletes a save game file.

Parameters
elementSlotThe slot index of the MenuProfilesList element that was clicked on
saveIDThe save ID to delete
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to delete

◆ DeleteSave() [2/2]

static void AC.SaveSystem.DeleteSave ( int  saveID)
static

Deletes a save game file.

Parameters
saveIDThe save ID of the file to load

◆ DoesImportExist()

static bool AC.SaveSystem.DoesImportExist ( int  saveID)
static

Checks if an import file with a particular ID number exists.

Parameters
saveIDThe import ID to check for
Returns
True if an import file with a matching ID number exists

◆ DoesSaveExist() [1/2]

static bool AC.SaveSystem.DoesSaveExist ( int  elementSlot,
int  saveID,
bool  useSaveID 
)
static

Checks if a save file with a particular ID number exists

Parameters
elementSlotThe slot index of the MenuSavesList element
saveIDThe save ID to check for
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to check for
Returns
True if a save file with a matching ID number exists

◆ DoesSaveExist() [2/2]

static bool AC.SaveSystem.DoesSaveExist ( int  saveID)
static

Checks if a save file with a particular ID number exists

Parameters
saveIDThe save ID to check for
Returns
True if a save file with a matching ID number exists

◆ DoImportCheck()

bool AC.SaveSystem.DoImportCheck ( string  fileData,
int  boolID 
)

Checks that another game's save file data is OK to import, by checking the state of a given boolean variable

Parameters
fileDataThe de-serialized data string from the file
boolIDThe ID number of the Boolean Global Variable that must be True in the fileData for the import check to pass
Returns
True if the other game's save file data is OK to import

◆ ExtractMainData()

static SaveData AC.SaveSystem.ExtractMainData ( string  saveFileContents)
static

Extracts global data from a save game file's raw (serialized) contents

Parameters
saveFileContentsThe raw contents of the save file
Returns
The global data stored within the save file

◆ ExtractSaveFileVariables()

static void AC.SaveSystem.ExtractSaveFileVariables ( SaveFile  saveFile,
System.Action< List< GVar >>  callback 
)
static

Extracts the Global Variables data of from a save file

Parameters
saveFileThe save file to extract Global Global Variables from
callbackA callback with the resulting List of GVar variables

◆ ExtractSceneData()

static List<SingleLevelData> AC.SaveSystem.ExtractSceneData ( string  saveFileContents)
static

Extracts all scene data from a save game file's raw (serialized) contents

Parameters
saveFileContentsThe raw contents of the save file
Returns
All scene data stored within the save file

◆ GatherImportFiles()

void AC.SaveSystem.GatherImportFiles ( string  projectName,
string  filePrefix,
int  boolID 
)

Searches the filesystem for all available import files, and stores them in foundImportFiles.

Parameters
projectNameThe project name of the game whose save files we're looking to import
filePrefixThe "save filename" of the game whose save files we're looking to import, as set in the Settings Manager
boolIDIf >= 0, the ID of the boolean Global Variable that must be True for the file to be considered valid for import

◆ GatherSaveFiles()

void AC.SaveSystem.GatherSaveFiles ( )

Searches the filesystem for all available save files, and stores them in foundSaveFiles.

◆ GenerateSaveSuffix()

static string AC.SaveSystem.GenerateSaveSuffix ( int  saveID,
int  profileID = -1 
)
static

Creates a suffix for save filenames based on a given save slot and profile

Parameters
saveIDThe ID of the save slot
profileIDThe ID of the profile

<return>A save file suffix based on the slot and profile

◆ GetImportSlotLabel()

static string AC.SaveSystem.GetImportSlotLabel ( int  elementSlot,
int  saveID,
bool  useSaveID 
)
static

Gets the label of an import file.

Parameters
elementSlotThe slot index of the MenuProfilesList element that was clicked on
saveIDThe save ID to import
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to import
Returns
The label of the import file.

◆ GetImportSlotScreenshot()

static Texture2D AC.SaveSystem.GetImportSlotScreenshot ( int  elementSlot,
int  saveID,
bool  useSaveID 
)
static

Gets the screenshot of an import file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to get the screenshot of
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to look for
Returns
The import files's screenshots as a Texture2D. If the save file is not found, null is returned.

◆ GetItemsFromPlayer()

InvCollection AC.SaveSystem.GetItemsFromPlayer ( int  _playerID)

Returns a collection of inventory items currently carried by a particular Player.

Parameters
_playerIDThe ID number of the Player to check the inventory of
Returns
A collection representing the inventory items

◆ GetNumImportSlots()

static int AC.SaveSystem.GetNumImportSlots ( )
static

Gets the number of found import files.

Returns
The number of found import files

◆ GetNumSaves()

int AC.SaveSystem.GetNumSaves ( bool  includeAutoSaves = true)

Gets the number of save game files found.

Parameters
includeAutoSavesIf True, then autosave files will be included in the result
Returns
The number of save games found

◆ GetNumSlots()

static int AC.SaveSystem.GetNumSlots ( )
static

Gets the number of found save files.

Returns
The number of found save files

◆ GetPlayerData()

PlayerData AC.SaveSystem.GetPlayerData ( int  playerID)

Gets all recorded data related to a given Player. This should typically be an inactive Player - otherwise the active Player should just be read directly

Parameters
playerIDThe ID of the Player to get data for
Returns
All recorded data related to the Player

◆ GetPlayerSceneIndex()

int AC.SaveSystem.GetPlayerSceneIndex ( int  ID)

Gets the current scene index that a Player is in.

Parameters
IDThe ID number of the Player to check
Returns
The current scene index that the Player is in.

◆ GetPlayerSceneName()

string AC.SaveSystem.GetPlayerSceneName ( int  ID)

Gets the current scene name that a Player is in.

Parameters
IDThe ID number of the Player to check
Returns
The current scene name that the Player is in.

◆ GetSaveExtension()

static string AC.SaveSystem.GetSaveExtension ( )
static

Gets the extension of the current save method.

Returns
The extension of the current save method

◆ GetSaveFile()

SaveFile AC.SaveSystem.GetSaveFile ( int  saveID)

Gets an existing SaveFile found on the system

Parameters
saveIDThe ID number of the save to retrieve
Returns
The SaveFile class instance

◆ GetSaveSlotLabel()

static string AC.SaveSystem.GetSaveSlotLabel ( int  elementSlot,
int  saveID,
bool  useSaveID 
)
static

Gets the label of a save file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to save
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to save
Returns
The label of the save file. If the save file is not found, an empty string is returned.

◆ GetSaveSlotScreenshot()

static Texture2D AC.SaveSystem.GetSaveSlotScreenshot ( int  elementSlot,
int  saveID,
bool  useSaveID 
)
static

Gets the screenshot of a save file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to get the screenshot of
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to look for

<return>The save files's screenshots as a Texture2D. If the save file is not found, null is returned.

◆ GetScreenshot()

Texture2D AC.SaveSystem.GetScreenshot ( int  elementSlot,
int  saveID,
bool  useSaveID,
SaveFile[]  saveFiles 
)

Gets the screenshot of a save file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to get the screenshot of
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to look for
saveFilesAn array of SaveFile instances that the save file to retrieve is assumed to be in
Returns
The save files's screenshots as a Texture2D. If the save file is not found, null is returned.

◆ GetSlotLabel()

string AC.SaveSystem.GetSlotLabel ( int  elementSlot,
int  saveID,
bool  useSaveID,
SaveFile[]  saveFiles 
)

Gets the label of a save file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to save
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to save
saveFilesAn array of SaveFile instances that the save file to retrieve is assumed to be in
Returns
The label of the save file. If the save file is not found, an empty string is returned.

◆ ImportGame()

static void AC.SaveSystem.ImportGame ( int  elementSlot,
int  saveID,
bool  useSaveID 
)
static

Imports a save file from another Adventure Creator game.

Parameters
elementSlotThe slot index of the MenuProfilesList element that was clicked on
saveIDThe save ID to import
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to import

◆ LoadAutoSave()

static void AC.SaveSystem.LoadAutoSave ( )
static

Loads the AutoSave save file. If multiple save profiles are used, the current profiles AutoSave will be loaded.

◆ LoadGame() [1/3]

static bool AC.SaveSystem.LoadGame ( int  elementSlot,
int  saveID,
bool  useSaveID 
)
static

Loads a save game file.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to load
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to load
Returns
True if a file was found

◆ LoadGame() [2/3]

static bool AC.SaveSystem.LoadGame ( int  saveID)
static

Loads a save game file.

Parameters
saveIDThe save ID of the file to load
Returns
True if a file was found

◆ LoadGame() [3/3]

static void AC.SaveSystem.LoadGame ( SaveFile  saveFile)
static

Loads a save game file.

Parameters
saveFileThe save file to load
Returns
True if a file was found

◆ MoveInactivePlayer() [1/2]

void AC.SaveSystem.MoveInactivePlayer ( int  ID,
int  newSceneIndex,
TeleportPlayerStartMethod  teleportPlayerStartMethod,
int  newPlayerStartConstantID = 0,
System.Action  onComplete = null 
)

Moves an inactive Player to a new scene

Parameters
IDThe inactive Player's ID number
newSceneIndexThe new scene to switch to
teleportPlayerStartMethodHow to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere)
newPlayerStartConstantIDIf teleportPlayerStartMethod = EnteredHere, the Constant ID number of the associated PlayerStart to appear at in the new scene

◆ MoveInactivePlayer() [2/2]

void AC.SaveSystem.MoveInactivePlayer ( int  ID,
string  newSceneNamex,
TeleportPlayerStartMethod  teleportPlayerStartMethod,
int  newPlayerStartConstantID = 0,
System.Action  onComplete = null 
)

Moves an inactive Player to a new scene

Parameters
IDThe inactive Player's ID number
newSceneNamexThe new scene to switch to
teleportPlayerStartMethodHow to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere)
newPlayerStartConstantIDIf teleportPlayerStartMethod = EnteredHere, the Constant ID number of the associated PlayerStart to appear at in the new scene

◆ MoveInactivePlayerToCurrentScene()

void AC.SaveSystem.MoveInactivePlayerToCurrentScene ( int  ID,
TeleportPlayerStartMethod  teleportPlayerStartMethod,
PlayerStart  newPlayerStart = null,
System.Action  onComplete = null 
)

Updates the internal record of an inactive Player's position to the current scene, provided that player-switching is allowed. If that Player has an Associated NPC, then it will be spawned or teleported to the Player's new position

Parameters
IDThe ID number of the Player to affect, as set in the Settings Manager's list of Player prefabs
teleportPlayerStartMethodHow to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere)
newPlayerStartIf teleportPlayerStartMethod = EnteredHere, a PlayerStart to use as the basis for the Player's new position and rotation

◆ ReceiveDataToImport()

void AC.SaveSystem.ReceiveDataToImport ( SaveFile  saveFile,
string  fileData 
)

Processes the save data requested by ImportSaveGame

Parameters
saveFileA data container for information about the save file to import. Its saveID and profileID need to match up with that requested in the iSaveFileHandler's Import function in order for the data to be processed
saveFileContentsThe file contents of the save file. This is empty if the import failed.

◆ ReceiveDataToLoad()

void AC.SaveSystem.ReceiveDataToLoad ( SaveFile  saveFile,
string  fileData 
)

Processes the save data requested by LoadSaveGame

Parameters
saveFileA data container for information about the save file to load. Its saveID and profileID need to match up with that requested in the iSaveFileHandler's Load function in order for the data to be processed
saveFileContentsThe file contents of the save file. This is empty if the load failed.

◆ RenameSave()

void AC.SaveSystem.RenameSave ( string  newLabel,
int  saveIndex 
)

Renames the label of a save game file.

Parameters
newLabelThe new label to give the save game file
saveIndexThe index of the foundSaveFiles List that represents the save file to affect

◆ RenameSaveByID()

void AC.SaveSystem.RenameSaveByID ( string  newLabel,
int  saveID 
)

Renames the label of a save game file.

Parameters
newLabelThe new label to give the save game file
saveIDThe ID that represents the save file to affect

◆ SaveAutoSave()

static void AC.SaveSystem.SaveAutoSave ( )
static

Overwrites the AutoSave file.

◆ SaveCurrentPlayerData()

void AC.SaveSystem.SaveCurrentPlayerData ( )

Stores the PlayerData of the active Player.

◆ SaveGame() [1/2]

static void AC.SaveSystem.SaveGame ( int  elementSlot,
int  saveID,
bool  useSaveID,
bool  overwriteLabel = true,
string  newLabel = "" 
)
static

Saves the game.

Parameters
elementSlotThe slot index of the MenuSavesList element that was clicked on
saveIDThe save ID to save
useSaveIDIf True, the saveID overrides the elementSlot to determine which file to save
overwriteLabelTrue if the label should be updated
newLabelThe new label, if it can be set. If blank, a default label will be generated.

◆ SaveGame() [2/2]

static void AC.SaveSystem.SaveGame ( int  saveID,
bool  overwriteLabel = true,
string  newLabel = "" 
)
static

Saves the game.

Parameters
saveIDThe save ID to save
overwriteLabelTrue if the label should be updated
newLabelThe new label, if it can be set. If blank, a default label will be generated.

◆ SaveNewGame()

static void AC.SaveSystem.SaveNewGame ( bool  overwriteLabel = true,
string  newLabel = "" 
)
static

Create a new save game file.

Parameters
overwriteLabelTrue if the label should be updated
newLabelThe new label, if it can be set

◆ SetSelectiveLoadOptions()

void AC.SaveSystem.SetSelectiveLoadOptions ( SelectiveLoad  selectiveLoad)

Sets the local instance of SelectiveLoad, which determines which save data is restored the next time (and only the next time) LoadGame is called.

Parameters
selectiveLoadAn instance of SelectiveLoad the defines what elements to load

◆ SwitchToPlayerInDifferentScene() [1/2]

void AC.SaveSystem.SwitchToPlayerInDifferentScene ( int  playerID,
int  sceneIndex,
bool  doOverlay 
)

Switches to a new Player in a different scene

Parameters
playerIDThe ID of the Player to switch to
sceneIndexThe new scene to switch to
doOverlayIf True, then a screenshot of the existing scene will be overlaid on top of the camera to mask the transition

◆ SwitchToPlayerInDifferentScene() [2/2]

void AC.SaveSystem.SwitchToPlayerInDifferentScene ( int  playerID,
string  sceneName,
bool  doOverlay 
)

Switches to a new Player in a different scene

Parameters
playerIDThe ID of the Player to switch to
sceneNameThe new scene to switch to
doOverlayIf True, then a screenshot of the existing scene will be overlaid on top of the camera to mask the transition

◆ UnloadVariablesData()

static List<GVar> AC.SaveSystem.UnloadVariablesData ( string  data,
bool  updateExistingVars,
List< GVar existingVars,
bool  fromOptions = false 
)
static

Updates a list of Variables with value data stored as a string.

Parameters
dataThe save-data string, serialized in the save file
updateExistingVarsIf True, the variabels stored in the existingVars parameter List will be updated, as opposed to merely used for reference
existingVarsA list of existing Variables whose values will be updated.
Parameters
fromOptionsIf True, the only Variables that are linked to Options Data will be updated
Returns
The updated list of Variables

Member Data Documentation

◆ foundImportFiles

List<SaveFile> AC.SaveSystem.foundImportFiles = new List<SaveFile> ()

A List of SaveFile variables, storing all available import files.

◆ foundSaveFiles

List<SaveFile> AC.SaveSystem.foundSaveFiles = new List<SaveFile> ()

An List of SaveFile variables, storing all available save files.

Property Documentation

◆ FileFormatHandler

iFileFormatHandler AC.SaveSystem.FileFormatHandler
staticgetset

The iFileFormatHandler class that handles the serialization and deserialzation of data

◆ IsTakingSaveScreenshot

bool AC.SaveSystem.IsTakingSaveScreenshot
get

If True, then a save-game screenshot is being taken

◆ loadingGame

LoadingGame AC.SaveSystem.loadingGame
get

What type of load is being performed (No, InNewScene, InSameScene, JustSwitchingPlayer)

◆ OptionsFileFormatHandler

iFileFormatHandler AC.SaveSystem.OptionsFileFormatHandler
staticgetset

The iFileFormatHandler class that handles the serialization and deserialzation of Options data. If this is not explicitly set, it will return the same value as FileFormatHandler

◆ SaveFileHandler

iSaveFileHandler AC.SaveSystem.SaveFileHandler
staticgetset

The iSaveFileHandler class that handles the creation, loading, and deletion of save files

◆ ScreenshotHeight

virtual int AC.SaveSystem.ScreenshotHeight
get

The height of save-game screenshot textures

◆ ScreenshotWidth

virtual int AC.SaveSystem.ScreenshotWidth
get

The width of save-game screenshot textures