Hi!
I would like to know what would be the best way to tie dialogues save with custom save system I implemented.
The save system uses odinserializer and I have a class GameState with a bunch of subclasses saved info is going into.
I want to save dialogues in the GameState class, specifically, I want to save where in the conversation the player was, what dialogue line etc.
I'm really knew to the dialogue system and it's hard for me to grasp how everything works
I tried this, gameState.PlayerData.DialogueSaveData = PersistentDataManager.GetSaveData(), because in the docs it says, that I can bypass using save system this way, but I think it doesn't include conversation info. I'm just not sure how to tie everything together, I see conversation state saver, should I write my own saver for this or is there a way to not use save system?
Dialogues save with custom save system
Re: Dialogues save with custom save system
Hi -
Set up the full save system. It's just a few components on the Dialogue Manager GameObject:
Store that string in your custom save system.
To restore the Dialogue System to a saved state:
Set up the full save system. It's just a few components on the Dialogue Manager GameObject:
- Save System: UNtick "Save Current Scene".
- Json Data Serializer
- PlayerPrefs Saved Game Data Storer: Not used, but its presence silences a warning.
- Dialogue System Saver: Saves Dialogue System variables, quest states, etc. Assign a unique key such as "ds".
- Conversation State Saver: Saves the position in the current conversation. Assign a unique key such as "conversationState".
Code: Select all
using PixelCrushers;
...
string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());
To restore the Dialogue System to a saved state:
Code: Select all
SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(s));
-
- Posts: 3
- Joined: Mon Dec 04, 2023 5:17 am
Re: Dialogues save with custom save system
Hey,
Thanks a lot, works like a charm! Just wanted to clarify is this all I have to do, to save quest progress from QuestMachine too or does it require some more setup?
Thanks a lot, works like a charm! Just wanted to clarify is this all I have to do, to save quest progress from QuestMachine too or does it require some more setup?
Re: Dialogues save with custom save system
To save Quest Machine, inspect the player's Quest Journal. In Save Settings, make sure Include In Saved Games is ticked and a unique key is assigned (e.g., "playerJournal"). You can also configure Quest Giver components to save their info if needed -- for example, if a Quest Giver has a quest with a cooldown before it can offer it again.
-
- Posts: 3
- Joined: Mon Dec 04, 2023 5:17 am
Re: Dialogues save with custom save system
Awesome, thanks!
Re: Dialogues save with custom save system
Glad to help!