Page 1 of 1
Displaying additional information for each choice
Posted: Thu Dec 16, 2021 1:36 am
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?
Re: Displaying additional information for each choice
Posted: Thu Dec 16, 2021 8:34 am
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.
Re: Displaying additional information for each choice
Posted: Tue Dec 28, 2021 2:17 am
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.
Re: Displaying additional information for each choice
Posted: Tue Dec 28, 2021 9:08 am
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.
Re: Displaying additional information for each choice
Posted: Tue Dec 28, 2021 11:57 am
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.
Re: Displaying additional information for each choice
Posted: Tue Dec 28, 2021 1:49 pm
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.