Questions about custom GUI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
DragoonHP
Posts: 62
Joined: Tue Jan 15, 2019 8:17 am

Questions about custom GUI

Post by DragoonHP »

I want to completely customise how my dialogue box looks so I had a few questions

* I want my dialogue box to pop-in during the start of the conversation. Is there any event that fires when a conversation is started? (Is OnConversationStart the event I want? Also, should I attach Dialogue System Events to Dialogue Manager?)
* I want the player portrait to only be visible when the player is speaking. What's the best way to do it?
* I want all characters (NPC and players) to share just one subtitle panel/portrait space where the old portrait image is replaced everytime a new character speaks. What's the best way to achieve that?
* Right now every player line is a selectable choice. Is there a way to show this behaviour only when player has a choice? A workaround I found is to make a second player character as NPC.
* Is making continue button full screen with alpha zero still the best way to allow player to click anywhere on the screen to continue.

PS: For 2 and 3, is setting Default NPC subtitle and Default Player subtitle to the same subtitle panel the best way?
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions about custom GUI

Post by Tony Li »

DragoonHP wrote: Thu Feb 07, 2019 3:35 am* I want my dialogue box to pop-in during the start of the conversation. Is there any event that fires when a conversation is started? (Is OnConversationStart the event I want? Also, should I attach Dialogue System Events to Dialogue Manager?)
When a conversation starts, the Dialogue System calls any OnConversationStart() methods on any scripts on the Dialogue Manager and primary participants. (See Script Methods.) If the Dialogue Manager or primary participants have Dialogue System Events components, their OnConversationStart() events are also invoked. The dialogue UI's Open() method is also called; if you make a subclass of StandardDialogueUI for example, you can override its Open() method to do extra tasks.

However, you probably don't need any of this. The StandardDialogueUI component has a Main Panel field:

Image

You can configure Show and Hide animation triggers, and also assign events to its OnOpen() and OnClose() events:

Image

Most of the UI prefabs use an animator controller that fades in the main panel. You can assign a different animator controller that pops in instead.
DragoonHP wrote: Thu Feb 07, 2019 3:35 am* I want the player portrait to only be visible when the player is speaking. What's the best way to do it?
Inspect the player's subtitle panel, and set Visibility to Only During Content. However, this may not be relevant given your next question.
DragoonHP wrote: Thu Feb 07, 2019 3:35 am* I want all characters (NPC and players) to share just one subtitle panel/portrait space where the old portrait image is replaced everytime a new character speaks. What's the best way to achieve that?
Take a look at the JRPG and WRPG prefabs in Plugins / Pixel Crushers / Dialogue System / Prefabs / Standard UI Prefabs / Templates. (The Pro folder also has a version of WRPG called Runic that has professionally-designed graphics.) Use one subtitle panel for all characters, and assign it to the Standard Dialogue UI's Subtitle Panels list, Default NPC Subtitle Panel, and Default PC Subtitle Panel, just like you mentioned in your PS.
DragoonHP wrote: Thu Feb 07, 2019 3:35 am* Right now every player line is a selectable choice. Is there a way to show this behaviour only when player has a choice?
Untick the Dialogue Manager's Display Settings > Input Settings > Always Force Response Menu checkbox.
DragoonHP wrote: Thu Feb 07, 2019 3:35 am* Is making continue button full screen with alpha zero still the best way to allow player to click anywhere on the screen to continue.
Yes.
DragoonHP
Posts: 62
Joined: Tue Jan 15, 2019 8:17 am

Re: Questions about custom GUI

Post by DragoonHP »

Thanks a lot :)
Tony Li wrote: Thu Feb 07, 2019 8:38 am However, you probably don't need any of this. The StandardDialogueUI component has a Main Panel field:
The pop-in effect is done via code so need to use the event triggers. Thank you very much for telling me about the animation triggers; they will definitely come in handy :)
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions about custom GUI

Post by Tony Li »

Great! That's one of the reasons those events exist. Mecanim is relatively easy to set up, but it's not always the most performant way to animate UIs when you're constrained on low-end devices. The Dialogue System's UI panels also recognize simple Animation components, which are more performant for UIs, but if you're using a tweening system or some other non-animation system then the events are the way to go.
Post Reply