Double Dialogue Managers in Hierarchy

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Double Dialogue Managers in Hierarchy

Post by pegassy »

Hello,

I have started testing out the evaluation version of DS for my game project, and I am integrating several other assets in my game.

Currently DS seems to be having a problem with an asset named Easy Main Menu that I am also using in the same project. What happens is that after I go through the loading scene and main menu scene of the game, when the main game scene starts, there will be two Dialogue Managers created under "DontDestroyOnLoad" instead of one. This causes the main dialogue UI not to appear (I am using JRPG2) when the player engages in dialogue with the NPCs.

I narrowed down the problem to "Increment On Destroy" script which is used to detect when a quest objective is destroyed. If I take out that code out of that game object, then the second dialogue manager (the one with default dialgue UI(clone)) will not be loaded up, and the JRPG2 UI will show up.

Please advise on what I may do to fix the problem. Thanks in advance.

(Please see the attached photo for the two DM items in the hierarchy)
Attachments
2018-3-17-DS Multiple DMs Bug.png
2018-3-17-DS Multiple DMs Bug.png (36.27 KiB) Viewed 866 times
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Double Dialogue Managers in Hierarchy

Post by pegassy »

I was able to replicate the same condition in DS Quest Example scene. When I tied it to Easy Main Menu, following the: Loading > Main Menu > Loading > Game Scene, sequence, there will be two Dialogue Managers. The second dialogue manager does not appear if I directly load the example scene.
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Double Dialogue Managers in Hierarchy

Post by Tony Li »

Hi,

I'm importing Easy Main Menu now to test it out.

In the meantime, do all instances of Dialogue Manager in your scenes have the Allow Only One Instance checkbox ticked?

Also, it looks like some part of the Dialogue System is being called before it gets to the scene with your Dialogue Manager. The Dialogue System will automatically create a default Dialogue Manager in this case. It looks like that may be what's happening. To resolve this, add an instance of your Dialogue Manager to the first scene that uses any Dialogue System functionality. This is the instance that will carry through to other scenes in the game, as long as its Dont Destroy On Load and Allow Only One Instance checkboxes are ticked.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Double Dialogue Managers in Hierarchy

Post by pegassy »

Thank you so much for the tips. I will go give it a try and let you know what I found out.
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Double Dialogue Managers in Hierarchy

Post by Tony Li »

It looks like you just need to add the Dialogue Manager to LoadingScreen.

You can make it a prefab and also add instances of the prefab to any of your gameplay scenes (e.g., Maze) to make it easy to playtest those scenes.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Double Dialogue Managers in Hierarchy

Post by pegassy »

Yes, I just confirmed that adding it to the loading screen fixed the issue. I was just about to ask you what to do for prototyping on game levels, and then just seen your new post :)

I will try to prefab it and use it in the game levels. Thank you for the prompt support and beautiful asset. I am greatly enjoying DS and hoping to buy the full version as soon as I can.

Feel free to take a look at how it is working out in the game @chasetailgames on Twitter.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Double Dialogue Managers in Hierarchy

Post by pegassy »

Just confirming that prefabbing Dialogue Manager and adding it both on the Loading Screen and the game level at the same time still worked. I did not get a duplicate of the DM. I appreciate the help.
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Double Dialogue Managers in Hierarchy

Post by Tony Li »

Glad to help. And thanks for evaluating the Dialogue System!
Post Reply