Page 1 of 1

Is there a way to hide data in dialogue options?

Posted: Wed Jun 02, 2021 11:41 pm
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.

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

Posted: Thu Jun 03, 2021 8:56 am
by Tony Li
Hi,

Yes - please see the Hover Response Button example on the Dialogue System Extras page.

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

Posted: Fri Jun 04, 2021 10:15 pm
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.

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

Posted: Fri Jun 04, 2021 11:26 pm
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);