Keeping specific NPC responses on-screen

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
idoltraingold
Posts: 3
Joined: Tue Nov 15, 2022 12:22 pm

Keeping specific NPC responses on-screen

Post by idoltraingold »

Hi there, thank you in advance for your help! I am still learning DSFU, so apologies for any basic questions.

I am working on a game that consists entirely of a back-and-forth dialogue exchange between the player and an NPC narrator. I am using the Scrolling Dialogue UI.

NPC responses come in two different forms:
-- A simple ">" that the player clicks to progress the dialogue forward, without any choices or alternate responses
-- A choice of different responses, with full text sentences

Currently, by default, all of the responses disappear once the player clicks them, as the rest of the dialogue progresses forward. Is there a way where I can set it so that the ">" responses continue to disappear as they currently do, but the specific responses with full text responses stay on-screen after they are clicked? Including with the same font/style?

Please let me know if there's any additional info I can provide, and thank you again in advance for any help!
User avatar
Tony Li
Posts: 21962
Joined: Thu Jul 18, 2013 1:27 pm

Re: Keeping specific NPC responses on-screen

Post by Tony Li »

Hi,

Inspect the Dialogue Manager GameObject, and tick Subtitle Settings > Show PC Subtitles During Line and UNtick Skip PC Subtitle After Response Menu.

More info: How To: Bypass Response Menu When Player Has One Choice
idoltraingold
Posts: 3
Joined: Tue Nov 15, 2022 12:22 pm

Re: Keeping specific NPC responses on-screen

Post by idoltraingold »

Thank you so much for the quick response!

I changed those two settings, but there's two things I'm wondering if I can adjust. The first is that unfortunately it's keeping on-screen both the ">" responses as well as the multiple option full sentence responses. I'm hoping to change it so that only the full sentence options stay on-screen, but the ">" responses disappear once chosen. I saw the linked documentation on how to bypass response menus when there's only one choice, but ideally I would want to keep the ">" responses included so the player can manually control the pace at which new messages appear.

The other question is that once a response is chosen, the font/color switches to match the other subtitle lines as it stays on-screen. Is there a way for the responses to retain their original font/color?

Thank you SO much in advance for any help - this is an incredibly helpful tool and I really appreciate your responsiveness.
User avatar
Tony Li
Posts: 21962
Joined: Thu Jul 18, 2013 1:27 pm

Re: Keeping specific NPC responses on-screen

Post by Tony Li »

Hi,

Instead of showing ">" as an option to advance, you could configure the dialogue UI's continue button to look like ">". Then set the Dialogue Manager GameObject's Subtitle Settings > Continue Button dropdown to an appropriate mode such as Not For PC.

If you want to continue using ">" as a player response node, set the Sequence field to: Continue()
This will make it go away when the player clicks it.


The Scrolling Dialogue UI assumes one font appearance for all text. If you only need to change the color of the player's lines, you can add a Dialogue Actor component to the player GameObject and tick Dialogue UI Settings > Set Subtitle Color.

If you need to apply other formatting, add a script with an OnConversationLine method to the player or Dialogue Manager. Something like:

Code: Select all

public class FormatPlayerLines : MonoBehaviour
{
    public string beginFormat = "<font=\"Impact SDF\"><color=magenta><b>";
    public string endFormat = "</b></color></font>";
    
    void OnConversationLine(Subtitle subtitle)
    {
        if (subtitle.speakerInfo.isPlayer)
        {
            subtitle.formattedText.text = $"{beginFormat}{subtitle.formattedText.text}{endFormat}";
        }
    }
{
idoltraingold
Posts: 3
Joined: Tue Nov 15, 2022 12:22 pm

Re: Keeping specific NPC responses on-screen

Post by idoltraingold »

Tony, this all worked perfectly. Thank you so much for your quick and helpful responses! :D
User avatar
Tony Li
Posts: 21962
Joined: Thu Jul 18, 2013 1:27 pm

Re: Keeping specific NPC responses on-screen

Post by Tony Li »

Happy to help!
Post Reply