AddDatabase() and ResetDatabase() clarification

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
RooseViper
Posts: 2
Joined: Tue Jul 15, 2025 5:20 pm

AddDatabase() and ResetDatabase() clarification

Post 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.
User avatar
Tony Li
Posts: 23446
Joined: Thu Jul 18, 2013 1:27 pm

Re: AddDatabase() and ResetDatabase() clarification

Post 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.
RooseViper
Posts: 2
Joined: Tue Jul 15, 2025 5:20 pm

Re: AddDatabase() and ResetDatabase() clarification

Post by RooseViper »

Thank you so much for all the useful information. The ExtraDatabases component was just what I needed.
User avatar
Tony Li
Posts: 23446
Joined: Thu Jul 18, 2013 1:27 pm

Re: AddDatabase() and ResetDatabase() clarification

Post by Tony Li »

Glad to help!
Post Reply