![]() |
Adventure Creator
1.77.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
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 () |
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< SingleLevelData > | ExtractSceneData (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< GVar > | UnloadVariablesData (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< SaveFile > | foundSaveFiles = new List<SaveFile> () |
List< SaveFile > | foundImportFiles = new List<SaveFile> () |
Static Public Attributes | |
const string | pipe = "|" |
const string | colon = ":" |
const string | mainDataDivider = "||" |
const string | mainDataDivider_Replacement = "*DOUBLEPIPE*" |
const int | MAX_SAVES = 50 |
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] |
Processes save game data to and from scene objects.
void AC.SaveSystem.AssignItemsToPlayer | ( | InvCollection | invCollection, |
int | _playerID | ||
) |
IEnumerator AC.SaveSystem.AssignPlayerData | ( | Player | player | ) |
|
static |
Unloads stored global variable data back into the RuntimeVariables script.
runtimeVariablesData | The values of all global variables, combined into a stingle string |
fromOptions | If true, only global variables that are linked to OptionsData will be affected |
void AC.SaveSystem.ClearAllData | ( | ) |
Clears all save data stored in the SaveData class.
|
static |
Loads the last-recorded save game file.
|
static |
Condenses the values of a List of variables into a single string.
vars | A List of variables (see GVar) to condense |
isOptionsData | If True, only global variables that are linked to OptionsData will be included |
location | The variables' location (Local, Variable) |
void AC.SaveSystem.DeleteProfile | ( | int | profileIndex = -2 , |
bool | includeActive = true |
||
) |
Deletes a player profile by referencing its entry in a MenuProfilesList element.
profileIndex | The 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 |
includeActive | If True, then the MenuProfilesList element that the profile was selected from also displays the active profile |
void AC.SaveSystem.DeleteProfileID | ( | int | profileID | ) |
Deletes a player profile ID.
profileID | The profile ID to delete |
void AC.SaveSystem.DeleteSave | ( | int | elementSlot, |
int | saveID, | ||
bool | useSaveID | ||
) |
Deletes a save game file.
elementSlot | The slot index of the MenuProfilesList element that was clicked on |
saveID | The save ID to delete |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to delete |
|
static |
Deletes a save game file.
saveID | The save ID of the file to load |
|
static |
Checks if an import file with a particular ID number exists.
saveID | The import ID to check for |
|
static |
Checks if a save file with a particular ID number exists
elementSlot | The slot index of the MenuSavesList element |
saveID | The save ID to check for |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to check for |
|
static |
Checks if a save file with a particular ID number exists
saveID | The save ID to check for |
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
fileData | The de-serialized data string from the file |
boolID | The ID number of the Boolean Global Variable that must be True in the fileData for the import check to pass |
|
static |
Extracts global data from a save game file's raw (serialized) contents
saveFileContents | The raw contents of the save file |
|
static |
Extracts all scene data from a save game file's raw (serialized) contents
saveFileContents | The raw contents of the save file |
void AC.SaveSystem.GatherImportFiles | ( | string | projectName, |
string | filePrefix, | ||
int | boolID | ||
) |
Searches the filesystem for all available import files, and stores them in foundImportFiles.
projectName | The project name of the game whose save files we're looking to import |
filePrefix | The "save filename" of the game whose save files we're looking to import, as set in the Settings Manager |
boolID | If >= 0, the ID of the boolean Global Variable that must be True for the file to be considered valid for import |
void AC.SaveSystem.GatherSaveFiles | ( | ) |
Searches the filesystem for all available save files, and stores them in foundSaveFiles.
|
static |
Creates a suffix for save filenames based on a given save slot and profile
saveID | The ID of the save slot |
profileID | The ID of the profile |
<return>A save file suffix based on the slot and profile
|
static |
Gets the label of an import file.
elementSlot | The slot index of the MenuProfilesList element that was clicked on |
saveID | The save ID to import |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to import |
|
static |
Gets the screenshot of an import file.
elementSlot | The slot index of the MenuSavesList element that was clicked on |
saveID | The save ID to get the screenshot of |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to look for |
InvCollection AC.SaveSystem.GetItemsFromPlayer | ( | int | _playerID | ) |
|
static |
Gets the number of found import files.
int AC.SaveSystem.GetNumSaves | ( | bool | includeAutoSaves = true | ) |
Gets the number of save game files found.
includeAutoSaves | If True, then autosave files will be included in the result |
|
static |
Gets the number of found save files.
PlayerData AC.SaveSystem.GetPlayerData | ( | int | playerID | ) |
int AC.SaveSystem.GetPlayerSceneIndex | ( | int | ID | ) |
string AC.SaveSystem.GetPlayerSceneName | ( | int | ID | ) |
|
static |
Gets the extension of the current save method.
SaveFile AC.SaveSystem.GetSaveFile | ( | int | saveID | ) |
|
static |
Gets the label of a save file.
elementSlot | The slot index of the MenuSavesList element that was clicked on |
saveID | The save ID to save |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to save |
|
static |
Gets the screenshot of a save file.
elementSlot | The slot index of the MenuSavesList element that was clicked on |
saveID | The save ID to get the screenshot of |
useSaveID | If 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.
Texture2D AC.SaveSystem.GetScreenshot | ( | int | elementSlot, |
int | saveID, | ||
bool | useSaveID, | ||
SaveFile[] | saveFiles | ||
) |
Gets the screenshot of a save file.
elementSlot | The slot index of the MenuSavesList element that was clicked on |
saveID | The save ID to get the screenshot of |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to look for |
saveFiles | An array of SaveFile instances that the save file to retrieve is assumed to be in |
string AC.SaveSystem.GetSlotLabel | ( | int | elementSlot, |
int | saveID, | ||
bool | useSaveID, | ||
SaveFile[] | saveFiles | ||
) |
Gets the label of a save file.
elementSlot | The slot index of the MenuSavesList element that was clicked on |
saveID | The save ID to save |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to save |
saveFiles | An array of SaveFile instances that the save file to retrieve is assumed to be in |
|
static |
Imports a save file from another Adventure Creator game.
elementSlot | The slot index of the MenuProfilesList element that was clicked on |
saveID | The save ID to import |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to import |
|
static |
Loads the AutoSave save file. If multiple save profiles are used, the current profiles AutoSave will be loaded.
|
static |
Loads a save game file.
elementSlot | The slot index of the MenuSavesList element that was clicked on |
saveID | The save ID to load |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to load |
|
static |
Loads a save game file.
saveID | The save ID of the file to load |
|
static |
Loads a save game file.
saveFile | The save file to load |
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
ID | The inactive Player's ID number |
newSceneIndex | The new scene to switch to |
teleportPlayerStartMethod | How to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere) |
newPlayerStartConstantID | If teleportPlayerStartMethod = EnteredHere, the Constant ID number of the associated PlayerStart to appear at in the new scene |
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
ID | The inactive Player's ID number |
newSceneNamex | The new scene to switch to |
teleportPlayerStartMethod | How to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere) |
newPlayerStartConstantID | If teleportPlayerStartMethod = EnteredHere, the Constant ID number of the associated PlayerStart to appear at in the new scene |
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
ID | The ID number of the Player to affect, as set in the Settings Manager's list of Player prefabs |
teleportPlayerStartMethod | How to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere) |
newPlayerStart | If teleportPlayerStartMethod = EnteredHere, a PlayerStart to use as the basis for the Player's new position and rotation |
void AC.SaveSystem.ReceiveDataToImport | ( | SaveFile | saveFile, |
string | fileData | ||
) |
Processes the save data requested by ImportSaveGame
saveFile | A 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 |
saveFileContents | The file contents of the save file. This is empty if the import failed. |
void AC.SaveSystem.ReceiveDataToLoad | ( | SaveFile | saveFile, |
string | fileData | ||
) |
Processes the save data requested by LoadSaveGame
saveFile | A 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 |
saveFileContents | The file contents of the save file. This is empty if the load failed. |
void AC.SaveSystem.RenameSave | ( | string | newLabel, |
int | saveIndex | ||
) |
Renames the label of a save game file.
newLabel | The new label to give the save game file |
saveIndex | The index of the foundSaveFiles List that represents the save file to affect |
void AC.SaveSystem.RenameSaveByID | ( | string | newLabel, |
int | saveID | ||
) |
Renames the label of a save game file.
newLabel | The new label to give the save game file |
saveID | The ID that represents the save file to affect |
|
static |
Overwrites the AutoSave file.
void AC.SaveSystem.SaveCurrentPlayerData | ( | ) |
Stores the PlayerData of the active Player.
|
static |
Saves the game.
elementSlot | The slot index of the MenuSavesList element that was clicked on |
saveID | The save ID to save |
useSaveID | If True, the saveID overrides the elementSlot to determine which file to save |
overwriteLabel | True if the label should be updated |
newLabel | The new label, if it can be set. If blank, a default label will be generated. |
|
static |
Saves the game.
saveID | The save ID to save |
overwriteLabel | True if the label should be updated |
newLabel | The new label, if it can be set. If blank, a default label will be generated. |
|
static |
Create a new save game file.
overwriteLabel | True if the label should be updated |
newLabel | The new label, if it can be set |
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.
selectiveLoad | An instance of SelectiveLoad the defines what elements to load |
void AC.SaveSystem.SwitchToPlayerInDifferentScene | ( | int | playerID, |
int | sceneIndex, | ||
bool | doOverlay | ||
) |
void AC.SaveSystem.SwitchToPlayerInDifferentScene | ( | int | playerID, |
string | sceneName, | ||
bool | doOverlay | ||
) |
|
static |
Updates a list of Variables with value data stored as a string.
data | The save-data string, serialized in the save file |
updateExistingVars | If True, the variabels stored in the existingVars parameter List will be updated, as opposed to merely used for reference |
existingVars | A list of existing Variables whose values will be updated.
|
A List of SaveFile variables, storing all available import files.
An List of SaveFile variables, storing all available save files.
|
staticgetset |
The iFileFormatHandler class that handles the serialization and deserialzation of data
|
get |
If True, then a save-game screenshot is being taken
|
get |
What type of load is being performed (No, InNewScene, InSameScene, JustSwitchingPlayer)
|
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
|
staticgetset |
The iSaveFileHandler class that handles the creation, loading, and deletion of save files
|
get |
The height of save-game screenshot textures
|
get |
The width of save-game screenshot textures