Page 1 of 1

Loading and managing Dialogue Databases

Posted: Wed Aug 07, 2024 3:34 pm
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

Re: Loading and managing Dialogue Databases

Posted: Wed Aug 07, 2024 3:55 pm
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.