Hi, I’m using Dialogue System for Unity and I have a question about switching the database and UI at runtime.
In my scene, I have a shared Dialogue Manager that handles the conversations.
At the beginning of the game, I’m using the default StoryData database for story dialogues, with the NovelDialogue UI.
Later in the game, I enter a Challenge phase, where I want to switch to using ChallengeData as the database and Bubble UI for the conversations.
Currently:
The story part (StoryData + NovelDialogue UI) works perfectly.
I activate different DialogueSystemTrigger GameObjects by enabling/disabling them.
But I have two problems:
Q1.
When I enable the Challenge trigger, how can I also switch the Dialogue Manager’s database to use ChallengeData?
Right now, it stays on StoryData and doesn’t switch automatically.
Q2.
I tried to follow the template and set Custom Panel Settings on the Dialogue Actor to use Bubble UI.
But even with that setup, the Dialogue System still uses the NovelDialogue UI and doesn’t switch to Bubble UI as expected.
Am I missing something about how to correctly change the database and UI at runtime?
What’s the correct workflow to achieve this?
Thank you for your help!
Help! CanI ask how to Switch Database and Dialogue UI at Runtime in Dialogue System?
Re: Help! CanI ask how to Switch Database and Dialogue UI at Runtime in Dialogue System?
Hi,
The easiest way to do this is to:
1. Read Working With Multiple Databases so you know how multiple databases interact in the Dialogue System.
2. Set your ChallengeData database's Base ID to a value that won't conflict with StoryData.
3. Use the Unique ID Tool to ensure that existing IDs don't conflict.
4. Use one version of your Dialogue Manager -- the first one that exists during play. Add an Extra Databases component and assign StoryData to it. Save this version of your Dialogue Manager as a prefab variant that you can put into other scenes if you want Dialogue Managers in other scenes. Note: You can put instances of the Dialogue Manager prefab variant in other scenes so you can test those scenes directly in play mode, but at runtime the Dialogue Manager survives scene changes and replaces any Dialogue Managers in subsequently-loaded scenes.
5. You don't need to worry about switching databases because they'll both be loaded at runtime.
6. To use a different dialogue UI for challenges, you have these options:
The easiest way to do this is to:
1. Read Working With Multiple Databases so you know how multiple databases interact in the Dialogue System.
2. Set your ChallengeData database's Base ID to a value that won't conflict with StoryData.
3. Use the Unique ID Tool to ensure that existing IDs don't conflict.
4. Use one version of your Dialogue Manager -- the first one that exists during play. Add an Extra Databases component and assign StoryData to it. Save this version of your Dialogue Manager as a prefab variant that you can put into other scenes if you want Dialogue Managers in other scenes. Note: You can put instances of the Dialogue Manager prefab variant in other scenes so you can test those scenes directly in play mode, but at runtime the Dialogue Manager survives scene changes and replaces any Dialogue Managers in subsequently-loaded scenes.
5. You don't need to worry about switching databases because they'll both be loaded at runtime.
6. To use a different dialogue UI for challenges, you have these options:
- Assign the Basic Standard Dialogue UI to the Dialogue System Trigger's Override Dialogue UI field. (Also see: How To: Show Overhead Conversation Bubble Text.)
- Or add an Override Dialogue UI component to one of the primary participants of the conversation. (See: Character GameObject Assignments.)
- Or manually call the C# method DialogueManager.UseDialogueUI().