Page 1 of 1

AddDatabase() and ResetDatabase() clarification

Posted: Tue Jul 15, 2025 5:34 pm
by RooseViper
I have an initial database set in the inspector of the DialogueManager. I add a specific database everytime I interact with certain things so that I can make these certain objects bark from said database. Here is the method below:

Code: Select all

    public void Interact()
    {
        DialogueManager.AddDatabase(sessionsManager.InvestigateBarksDatabase);
        DialogueManager.Bark(conversationTitle, transform,null,barkEntryTag);
    }
When closing the interaction, I then use DialogueManager.ResetDatabase() to reset the database back to the initial database.

Code: Select all

   private void CloseInvestigation()
    {
        DialogueManager.ResetDatabase();
    }
All this is working as expected but I just wanted to confirm if the ResetDatabase() removes the database I just added and if I'm doing this the right way?

Your help would be very much appreciated.

Thank you so much in advance Tony.

Cheers.

Re: AddDatabase() and ResetDatabase() clarification

Posted: Tue Jul 15, 2025 7:38 pm
by Tony Li
Hi,

DialogueManager.ResetDatabase() will reset the values in the database, such as Lua variables, but it won't remove any extra databases that you've added using DialogueManager.AddDatabase(). To remove the extra database, use DialogueManager.RemoveDatabase().

Or just keep all of the databases loaded from the start so you don't have to worry about adding and removing. To do this, add an Extra Databases component to the Dialogue Manager and assign your extra database to it.

Make sure to also read Working With Multiple Databases.

Re: AddDatabase() and ResetDatabase() clarification

Posted: Thu Jul 17, 2025 2:28 am
by RooseViper
Thank you so much for all the useful information. The ExtraDatabases component was just what I needed.

Re: AddDatabase() and ResetDatabase() clarification

Posted: Thu Jul 17, 2025 9:51 am
by Tony Li
Glad to help!