Page 1 of 1
How to make a save game and load game?
Posted: Mon Jan 23, 2017 2:51 am
by HaiiroMukuro
Good day!
Is there a guide for making a save game and load game for dialogue system?
It seems like I'm lost.
The save and load game are in a panel which contains 10 buttons, and those buttons where you can save the game and load the game.
I'm also trying to modify the in feature demo script. I replace the clear game save to Settings, then the save and load game opens a panel having 10 buttons.
Thank you and have a great day!

Re: How to make a save game and load game?
Posted: Mon Jan 23, 2017 10:00 am
by Tony Li
You can download the Menu Framework from the
Dialogue System Extras page. It's the first download button under EXTRAS. This provides an entire menu framework, including a title menu, in-game pause menu, and save/load game menus.
I recommend
not using FeatureDemo.cs. This script was designed just to drive the demo scenes. You can use it as a base, but I think there are better solution now, such as the Menu Framework above.
If you don't want to do that, try these steps:
1. Add a
GameSaver and a
LevelManager to your Dialogue Manager.
2. Set up a Unity UI button to save a slot. Set the UI button's OnClick() event to GameSaver.SaveSlot, and specify a slot number.
3. Set up a Unity UI button to load a slot. Set the UI button's OnClick() event to GameSaver.LoadSlot, and specify a slot number.
Re: How to make a save game and load game?
Posted: Wed Jan 25, 2017 12:32 pm
by HaiiroMukuro
Instead of using the feature demo, I tried what you recommend which is putting a game saver and level manager in dialogue manager and it work.
Now I understand, thanks to your help.

But I still have a question.
Does it save and load variables?
Re: How to make a save game and load game?
Posted: Wed Jan 25, 2017 12:47 pm
by Tony Li
Yes, it saves and loads variables. The complete list of what it saves is on the
Saved Game Data page.
Re: How to make a save game and load game?
Posted: Wed Jan 25, 2017 1:49 pm
by HaiiroMukuro
Thank you!

Re: How to make a save game and load game?
Posted: Wed Feb 08, 2017 11:17 am
by HaiiroMukuro
Gamesaver and Levelmanager can save/load the gameobjects that is set on active or not?
For example, I have a school gate and there are 2 gameobjects on the schoolgate. Those gameobjects are "GateClosed" and "GateOpen". If the player enters the gate, the gameobject "GateClosed" will be set on true and the gameobject "GateOpen" will be set on false.
if not, this should be done by scripting? Any help will be appreciated, thank you!

Re: How to make a save game and load game?
Posted: Wed Feb 08, 2017 12:15 pm
by Tony Li
Hi,
You don't need to do any scripting. The Feature Demo scene contains an example. In the middle of the room, there is a terminal. This is actually two GameObjects: "TerminalActive" and "TerminalInactive". The save system controls them using a
Persistent Active Data component and a Dialogue System variable.
I recommend this:
1. Add a Dialogue System variable named "SchoolGateIsOpen". Set the Type to Boolean, and set the Value to True.
2. Add a
Persistent Active Data component to the schoolgate. Set the Target to GateOpen. Expand Condition > Lua Conditions, and add this Lua condition:
Code: Select all
Variable["SchoolGateIsOpen"] == true
3. Add
another Persistent Active Data component to the schoolgate. Set the Target to GateClosed. Expand Condition > Lua Conditions, and add this Lua condition:
Code: Select all
Variable["SchoolGateIsOpen"] == false
When the player enters the gate, set the variable "SchoolGateIsOpen" false. For example, you can add a Lua Trigger set to OnTriggerEnter.
Re: How to make a save game and load game?
Posted: Fri Feb 10, 2017 3:13 am
by HaiiroMukuro
Good day!
How can I delete a save game?
What will I do to make the game object such as Text records the time and date when the player saves the game?
Also, What will I do to make a panel appear that tells if the player wants to overwrite a game data?
Thank you for the help!

Re: How to make a save game and load game?
Posted: Fri Feb 10, 2017 9:13 am
by Tony Li
Hi,
For text records and a overwrite panel, I recommend using the free Menu Framework on the
Dialogue System Extras page. It's the first download button under the EXTRAS section. It also lets players delete saved games.
To delete a saved game without the Menu Framework, you'll have to delete the PlayerPrefs keys. You can use a
PlayerPrefs editor tool or write a script that uses
PlayerPrefs.DeleteKey().