Page 1 of 1

Easy way to reset dialogue database?

Posted: Tue Jul 23, 2024 3:55 pm
by marafrass
Heya Tony,

I had a look through the forum to see if this had been solved, but I couldn't find anything definitive - is there a simple way to reset the dialogue database? The use case for this is basically that I want to reset all quests, variables, and sim statuses whenever the player goes to the main menu. Quitting the game does this fine, obviously, and loading/saving (using Adventure Creator's save system and your bridge) works without any issues - but if I were to start a new game, gain a few quests, quit out, and then start a new game, the database still retains information from the previous run; quests are still in the same state they were in the first, and dialogue options that were chosen in the last run are still marked.

Here are my settings for both the bridge and the saver components;
Image
Image

Let me know if there are any other details you'd need and as always, thanks for the help!

Re: Easy way to reset dialogue database?

Posted: Tue Jul 23, 2024 5:09 pm
by marafrass
Posted too soon - I think I have a solution for this already. Leaving this up in case someone else is looking for the same thing;

I just added an empty GameObject in my "main menu" Scene with the following script;

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PixelCrushers.DialogueSystem;

public class ResetDatabaseOnStart : MonoBehaviour
{
    void Start()
    {
        DialogueManager.ResetDatabase(DatabaseResetOptions.RevertToDefault);
    }
}
Everything seems to be working just fine now, including saving and loading.

Feel free to correct me or comment, in case there's a better way doing it or anything I should be aware of!

Re: Easy way to reset dialogue database?

Posted: Tue Jul 23, 2024 8:50 pm
by Tony Li
Hi,

Since you're using a Dialogue System Saver, I'm guessing that you're using the Dialogue System's full save system, tied into Adventure Creator through the Remember Dialogue System component.

If so, use this instead:

Code: Select all

PixelCrushers.SaveSystem.ResetGameState();
It will call the Dialogue System Saver component's ResetGameState() method, which will in turn call DialogueManager.ResetDatabase(). But it will also reset anything else that happens to be tied into the Dialogue System's save system.

Re: Easy way to reset dialogue database?

Posted: Thu Jul 25, 2024 2:45 pm
by marafrass
Got it - replaced the other line of code with yours, and everything seems to work fine now as well. Huge thanks!

Re: Easy way to reset dialogue database?

Posted: Thu Jul 25, 2024 4:02 pm
by Tony Li
Happy to help!