How to have choices without subtitle text

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Nokinori
Posts: 9
Joined: Tue Jun 27, 2023 5:11 pm

How to have choices without subtitle text

Post by Nokinori »

Hello,

I'm trying to set up dialogue to allow the player to make choices without any corresponding dialogue / subtitle text. My end goal is to have two options for the player: To be able to select between options without displaying any image or name, and to be able to converse while displaying a name but no image. My current strategy is to create a 'Choices' Actor that is designated as the player, and a 'Player' actor that is designated as an NPC.

The conversation should go something like:

NPC > Player Choice > NPC > NPC 2 > NPC > Player Choice > NPC 2 > etc.

My current setup has the Choices actor with their own subtitle panel. The Standard UI Subtitle Panel component has no references to Panel, Image, Name, or Subtitle Text. There are also no events on Open, Close, etc.

I've also added Continue() in the sequence for each 'Choices' node containing menu text with no dialogue text.

When the player selects a choice, the subtitle text disappears and the menu text flashes for just a moment, and then the next subtitle text is displayed. Which is obviously not ideal.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to have choices without subtitle text

Post by Tony Li »

Hi,

I'm not sure I fully understand. But if you want to run a conversation without any visual UI, it might be simpler to duplicate the starter script named TemplateDialogueUI.cs. Move the duplicate to your own scripts folder, rename it, and fill in your code where the comments indicate. Then add this script to your dialogue UI GameObject, and assign that GameObject to the Dialogue Manager's Display Settings > Dialogue UI field.

This way you have complete control over what you show or don't show.

If you want some of the functionality of the Standard Dialogue UI scripts instead -- for example, only showing the menu panel but not the subtitle panel -- you could make a subclass of StandardDialogueUI. Override the ShowSubtitle() and HideSubtitle() methods to either do nothing:

Code: Select all

public class MyDialogueUI : StandardDialogueUI
{
    public override void ShowSubtitle(Subtitle subtitle) {}
    public override void HideSubtitle(Subtitle subtitle) {}
}
Or show just subtitle.speakerInfo.Name, or whatever you want. Then replace the StandardDialogueUI component with your subclass (possibly like this).
Post Reply