Loading and managing Dialogue Databases

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Miodek_ENT
Posts: 1
Joined: Wed Aug 07, 2024 3:24 pm

Loading and managing Dialogue Databases

Post by Miodek_ENT »

Hello,
I have an issue with managing Dialogue Databases and couldn't find any information how to solve this particular issue.

Basically I want to set via code, database from scriptableObject in Dialogue System Trigger

Code: Select all

public void OnPointerClick(PointerEventData eventData)
    {
        DialogueSystemTrigger dialogueSystemTrigger = GetComponent<DialogueSystemTrigger>();
        dialogueSystemTrigger.selectedDatabase = sideQuest.dialogueDatabase;        
    }
And this part is working just fine. I also set it to trigger OnDisable in mentioned component.

The problem is: it start conversation of my IntroDatabase not from Database that is attached to scriptableObject.
I've also tried to

Code: Select all

DialogueManager.Instance.gameObject.GetComponent<DialogueSystemController>().initialDatabase = sideQuest.dialogueDatabase; 
And after that start conversation, but it didn;t solve my issue. Any thoughts how to make it work?
Should I use ExtraDatabases component for this workflow and if yes, could you elaborate a bit more how to properly do this?
I appreciate any help.
Best,
Miodek_ENT
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Loading and managing Dialogue Databases

Post by Tony Li »

Hi,

DialogueSystemTrigger.selectedDatabase only specifies the database to use for the inspector's conversation dropdown menu. It has no effect at runtime. You must load the database into memory at runtime using an Extra Databases component or DialogueManager.AddDatabase(). Internal IDs should be unique across databases. Please see Working With Multiple Databases for important info.
Post Reply