Save System and PlayMaker
Posted: Tue Apr 26, 2022 8:58 am
(Posting for a Dialogue System user.) This is a reply to a question about setting up the save system and PlayMaker.
This is a typical setup:
In the main menu scene:
1. Set up the Dialogue Manager GameObject with the SaveSystem, JsonDataStorer, PlayerPrefsSavedGameDataStorer, DialogueSystemSaver, and PlayMakerGlobalVariableSaver.
2. Add a SaveSystemMethods component to your "New Game" button. Configure the button's OnClick() to call SaveSystemMethods.RestartGame, and specify the first gameplay scene.
3. Add a SaveSystemMethods component to your "Load Game"/"Continue" button. Set its Default Starting Scene Name to the name of the first gameplay scene. Configure OnClick() to call SaveSystemMethods.LoadOrRestart, and specify a saved game slot number.
In your gameplay scene(s):
1. Add a Dialogue System Trigger and SaveSystemMethods component to a GameObject. Set the Dialogue System Trigger to OnSaveDataApplied. Select Add Action > OnExecute() Event. Configure the OnExecute() event to call SaveSystemMethods.SaveSlot, and specify the same saved game slot number.
This is a typical setup:
In the main menu scene:
1. Set up the Dialogue Manager GameObject with the SaveSystem, JsonDataStorer, PlayerPrefsSavedGameDataStorer, DialogueSystemSaver, and PlayMakerGlobalVariableSaver.
2. Add a SaveSystemMethods component to your "New Game" button. Configure the button's OnClick() to call SaveSystemMethods.RestartGame, and specify the first gameplay scene.
3. Add a SaveSystemMethods component to your "Load Game"/"Continue" button. Set its Default Starting Scene Name to the name of the first gameplay scene. Configure OnClick() to call SaveSystemMethods.LoadOrRestart, and specify a saved game slot number.
In your gameplay scene(s):
1. Add a Dialogue System Trigger and SaveSystemMethods component to a GameObject. Set the Dialogue System Trigger to OnSaveDataApplied. Select Add Action > OnExecute() Event. Configure the OnExecute() event to call SaveSystemMethods.SaveSlot, and specify the same saved game slot number.