Question about Dialog UI

Announcements, support questions, and discussion for the Dialogue System.
Morgank
Posts: 14
Joined: Fri May 13, 2022 5:29 pm

Question about Dialog UI

Post by Morgank »

Hello!
I bought Dialog System not so long ago, but still wasn't able to find out if it's possible to set things up so that every new dialog entry would be shown on new GameObject with TextMeshPro. Is it possible to do this? Can someone give me advice how to realise this if it's possible? Thsnk.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Dialog UI

Post by Tony Li »

Hi,

You can use the SMS Dialogue UI prefab. Despite its name and appearance as a text messaging UI, you can restyle it to look however you want.
Morgank
Posts: 14
Joined: Fri May 13, 2022 5:29 pm

Re: Question about Dialog UI

Post by Morgank »

Thanks! I've never used it, so will try to figure out how to restyle it.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Dialog UI

Post by Tony Li »

As a first step, I recommend trying out the SMS Dialogue UI as-is just to see how it works.

Then duplicate it and use your duplicate. NPC lines will use copies of the NPC Message Template. Player lines will use copies of the PC Message Template.
Morgank
Posts: 14
Joined: Fri May 13, 2022 5:29 pm

Re: Question about Dialog UI

Post by Morgank »

Thanks for the advice. Can I ask some more question. Is there any way to trigger animations for 4 GameObjects at start of conversation and at the end? One by another at the begining and all at once at the end.

Sorry if this is commonly known information. I'm only trying to understand Dialogue system. Thanks.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Dialog UI

Post by Tony Li »

Morgank wrote: Sat May 14, 2022 4:09 pmIs there any way to trigger animations for 4 GameObjects at start of conversation and at the end? One by another at the begining and all at once at the end.
Yes. Use sequencer commands (tutorial). For example, in the first node you could set the Sequence to something like:

Code: Select all

{{default}};  // Also play Dialogue Manager's Default Sequence.
AnimatorPlayWait(Anim1, Object1)->Message(Done1);
AnimatorPlayWait(Anim2, Object2)@Message(Done1)->Message(Done2);
AnimatorPlayWait(Anim3, Object3)@Message(Done2)->Message(Done3);
AnimatorPlayWait(Anim4, Object4)@Message(Done3)
And in the last node:

Code: Select all

{{default}};
AnimatorPlay(Anim1b, Object1);
AnimatorPlay(Anim2b, Object2);
AnimatorPlay(Anim3b, Object3);
AnimatorPlay(Anim4b, Object4)
Morgank
Posts: 14
Joined: Fri May 13, 2022 5:29 pm

Re: Question about Dialog UI

Post by Morgank »

Thanks for your help, Tony. I'll be sure to look into the sequences tomorrow.

Can I ask you one more question? Is there any way to assign the continuation of the dialog to the mouse button click through the new input system?
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Dialog UI

Post by Tony Li »

Morgank wrote: Sat May 14, 2022 5:58 pmIs there any way to assign the continuation of the dialog to the mouse button click through the new input system?
Yes, it's the same as Unity's built-in input manager.

1. Inspect the Dialogue Manager GameObject. Set Display Settings > Subtitle Settings > Continue Button to Always.

2. Make sure your scene has an EventSystem.

3. Add a continue button to your dialogue UI's subtitle panels if they don't already have one. All of the prefab dialogue UIs that ship with the Dialogue System have continue buttons.

If you want mouse clicks to advance the conversation no matter where the cursor is, set the continue button's size to cover the whole screen, and set its Image color alpha to zero so it's invisible. This allows the player to click/tap anywhere onscreen to continue. You can usually move it to be a direct child of the Dialogue Panel and/or add a Layout Element and tick Ignore Layout. This will make it easier to configure the Rect Transform to cover the whole screen.
Morgank
Posts: 14
Joined: Fri May 13, 2022 5:29 pm

Re: Question about Dialog UI

Post by Morgank »

Thanks alot! One last question and the template for my game will be completed. When I close the dialog the system does not load the closing animation of all objects with NPC and PC messages. Is there any way to change this? I tried to enter the trigger name to the Dialogue Panel GameObject, NPC Message Template and PC Message Template GameObjects, but nothing changed.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Dialog UI

Post by Tony Li »

Hi,

The SMSDialogueUI / TextlineDialogueUI is not designed to play "hide" animations on every single message instance that the conversation has added to the dialogue UI.

It should, however, play the main dialogue panel's hide animation if you've configured one. Make sure your dialogue panel has an Animator component with an animator controller. If you're playing the conversation while the game is paused (i.e., Time.timeScale == 0), set the Animator's Update Mode to Unscaled. Set the UIPanel component's Hide Animation Trigger to the name of the "hide" trigger parameter in the animator controller. Also tick the main StandardDialogueUI component's Conversation UI Elements > Wait For Close checkbox.
Post Reply