Is there a way to hide data in dialogue options?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
perezbalen
Posts: 40
Joined: Mon May 24, 2021 7:22 pm

Is there a way to hide data in dialogue options?

Post by perezbalen »

Hi

I'm trying to implement something that gives additional context to a dialogue option, when the mouse hovers over it (using a tooltip.)

At this point, I have percentage checks working, like in fallout:

Image

But I don't want the [speech 25] in the text. I want it on another part of the gui. Like in Disco Elysium:

Image

My problem is that I need to tell the tooltip stuff about the dialogue option before the player chooses it. So far I've managed to send the Menu text to the tooltip by way of the UI Response Button's text component.

Is there a way to get "invisible" information out of the dialogue option before the player clicks on it? (something like, "this option needs 25 speech.")?

Thanks.
User avatar
Tony Li
Posts: 22032
Joined: Thu Jul 18, 2013 1:27 pm

Re: Is there a way to hide data in dialogue options?

Post by Tony Li »

Hi,

Yes - please see the Hover Response Button example on the Dialogue System Extras page.
perezbalen
Posts: 40
Joined: Mon May 24, 2021 7:22 pm

Re: Is there a way to hide data in dialogue options?

Post by perezbalen »

Thanks. That was very helpful.
I have it running now.
One question though, The example uses a custom field named "Activate on Hover" to activate an object, by name. Is there a way to set that field in code? Right now I'm manually typing the name of the object I want to show, and it works fine. But I can see that generating problems as the project grows.
User avatar
Tony Li
Posts: 22032
Joined: Thu Jul 18, 2013 1:27 pm

Re: Is there a way to hide data in dialogue options?

Post by Tony Li »

Hi,

If you're doing something like Disco Elysium, you could always just put all the content in the Description field. If you're using TextMesh Pro, you can include <sprite> tags in the Description text.

You can also set a field in code:

Code: Select all

// Works at runtime:
Conversation conversation = DialogueManager.masterDatabase.GetConversation("Some Conversation");
DialogueEntry entry = conversation.GetDialogueEntry("Entry Title");
Field.SetValue(entry.fields, "Activate on Hover", SomeGameObject.name);
Post Reply