Creating custom Dialogue UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mvanness
Posts: 2
Joined: Fri May 08, 2015 12:24 pm

Creating custom Dialogue UI

Post by mvanness »

When I try to create a custom UI, I keep receiving an error that "No Dialogue UI found on '<The name of my custom Dialogue UI.">  at which point the default UI is loaded.  But I can see that component is part of my Dialogue UI asset.



I thought, okay, I'm probably just an idiot and doing something wrong. (I have this thought several times a day.  :)



So I added the "SF Unity UI Dialogue UI" script, wired it up, ran a test, and everything worked the way I would expect.  But if I just change the name of that asset to "SF Test Dialogue UI," and don't touch anything else, I receive a"No Dialogue UI found on 'SF Test Dialogue UI (UnityEngine.GameObject)" error and the default UI is loaded.



I'm obviously missing something fundamental and banging my head against the desk hasn't shed any light on the situation.  Although it has amused my dogs.



Any help would be greatly appreciated!  I'm sure I'll feel dumb when someone types the one sentence answer, but as long as it works, that's a cross I'm willing to bear.



Cheers,



michael
User avatar
Tony Li
Posts: 21636
Joined: Thu Jul 18, 2013 1:27 pm

Creating custom Dialogue UI

Post by Tony Li »

Hi Michael,



I do things myself that raise this error, and I wrote the darn thing, so no worries. Here are a few things to check:







1. Make sure the Dialogue Manager's Dialogue UI field points to your dialogue UI GameObject. When the Dialogue Manager starts, it looks on this GameObject for a dialogue UI component (e.g., UnityUIDialogueUI, UnityDialogueUI, NGUIDialogueUI, etc.). The GameObject must be active, and the component must be enabled. (This is the one that usually gets me; I sometimes accidentally leave the GameObject inactive.)







2. If you're using Unity UI, the dialogue UI GameObject must be in the scene. The Dialogue Manager's Dialogue UI field can't point to a prefab in the Project view if you're using Unity UI.







3. Check for errors in the Console. If you rename a script (e.g., rename UnityUIDialogueUI.cs to MyDialogueUI.cs), Unity won't be able to use it properly because the name defined inside the script will no longer match its filename.







If none of that helps, please feel free to email an example project to tony (at) pixelcrushers.com. I'll be happy to take a look!
mvanness
Posts: 2
Joined: Fri May 08, 2015 12:24 pm

Creating custom Dialogue UI

Post by mvanness »

Thanks, Tony!  I had an inactive GameObject.  SMH







One other quick follow-up... When I use a Unity UI Dialogue UI, for some reason the "[a]" Chat Mapper dialog markup tag isn't having the desired effect; menu items aren't appearing in italics. I looked in the console and I can see that the markup tag is making its way into the link's text. (ex. "[a]Pummel the mime with a small herring.")







To ensure it wasn't something I screwed up in just my custom Dialogue UI, I used the "SF Unity UI Dialogue UI" prefab and it seemed to have the same problem. Unity GUI prefabs worked as I would expect.







Any thoughts? Thanks again for your help!
User avatar
Tony Li
Posts: 21636
Joined: Thu Jul 18, 2013 1:27 pm

Creating custom Dialogue UI

Post by Tony Li »

Sorry, that was just a plain old bug. I forgot to handle the "[a]" tag in Unity UI. You can download this updated unitypackage, which will also be in the next release:



Unity UI Support 2015-05-10.unitypackage

Post Reply