Displaying additional information for each choice

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Displaying additional information for each choice

Post by Esylin »

Hi, I'm new to Dialogue System for Unity so I'm still learning how to use it.

I heard this tool is used in Disco Elysium. In that game when player's mouse cursor hover on a choice with dice rolls, additional information may display.

I'm wondering if it's possible to achieve this in DS? Or do I need additional scripting?
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Displaying additional information for each choice

Post by Tony Li »

Hi,

It may need a little bit of scripting depending on what information you want to display (e.g., pulling info from a separate skill system), but you can get a head start by examining the "Hover Response Button Example" scene on the Dialogue System Extras page.
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Re: Displaying additional information for each choice

Post by Esylin »

Hi, I downloaded the demo but I can't figure out how to use it.

I opened the scene Hover Response Button Example in the package file but it doesn't have any tooltip information displayed.

The read me file says "Tooltip text component to your dialogue UI", but I can't find any "Tooltip text component". Is this a text component called "Tooltip"?

Any detailed tutorials would be appreciated. :)
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Displaying additional information for each choice

Post by Tony Li »

Hi,

Does the included example scene work in your project? (Hover Response Button Example)

If so, then examine the scene's Customized Basic Standard Dialogue UI. The Response Menu Panel has a child GameObject named Tooltip Text. It's a GameObject with a regular UI Text component.

The Response Button Template has an Activate On Response Hover component (the script provided in this example package) and an Event Trigger component. The Event Trigger has UI events that call ActivateOnResponseHover.OnHover and OnUnhover.

The ActivateOnResponseHover script is custom-written for this example scene. It looks up two fields in the response's dialogue entry:
  • Description: Shows the value of the Description field in the Tooltip Text GameObject.
  • Activate On Hover: A custom-added field. Activates the GameObject named by this field.
You can use the script as-is or use it as a starting point for your own functionality.
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Re: Displaying additional information for each choice

Post by Esylin »

Tony Li wrote: Tue Dec 28, 2021 9:08 am Hi,

Does the included example scene work in your project? (Hover Response Button Example)

If so, then examine the scene's Customized Basic Standard Dialogue UI. The Response Menu Panel has a child GameObject named Tooltip Text. It's a GameObject with a regular UI Text component.

The Response Button Template has an Activate On Response Hover component (the script provided in this example package) and an Event Trigger component. The Event Trigger has UI events that call ActivateOnResponseHover.OnHover and OnUnhover.

The ActivateOnResponseHover script is custom-written for this example scene. It looks up two fields in the response's dialogue entry:
  • Description: Shows the value of the Description field in the Tooltip Text GameObject.
  • Activate On Hover: A custom-added field. Activates the GameObject named by this field.
You can use the script as-is or use it as a starting point for your own functionality.
I think I found the problem....I edited Customized Basic Standard Dialogue UI in my project so my imported the package won't function properly. I opened a new clean project for the package import and the demo works now.

Following the demo I got tooltip text working now. :)

By the way, are there anyway to activate a sprite window background that appear under the tooltip text when it's activated? Right now I had to use a static window background that always appears whenever the response menu appeared, similar to demo scene setup. But that window doesn't deactivate when tooltip text isn't on. So it looks kinda awkward.

Any advice would be great. :)
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Displaying additional information for each choice

Post by Tony Li »

Esylin wrote: Tue Dec 28, 2021 11:57 amBy the way, are there anyway to activate a sprite window background that appear under the tooltip text when it's activated? Right now I had to use a static window background that always appears whenever the response menu appeared, similar to demo scene setup. But that window doesn't deactivate when tooltip text isn't on. So it looks kinda awkward.
Yes. You can edit the ActivateOnHoverResponse script to also activate & deactivate a background GameObject along with the tooltip text GameObject.
Post Reply