Page 1 of 1
Keeping specific NPC responses on-screen
Posted: Sun Dec 11, 2022 3:14 pm
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!
Re: Keeping specific NPC responses on-screen
Posted: Sun Dec 11, 2022 6:59 pm
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
Re: Keeping specific NPC responses on-screen
Posted: Sun Dec 11, 2022 8:30 pm
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.
Re: Keeping specific NPC responses on-screen
Posted: Mon Dec 12, 2022 7:37 am
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}";
}
}
{
Re: Keeping specific NPC responses on-screen
Posted: Mon Dec 12, 2022 2:20 pm
by idoltraingold
Tony, this all worked perfectly. Thank you so much for your quick and helpful responses!
Re: Keeping specific NPC responses on-screen
Posted: Mon Dec 12, 2022 2:26 pm
by Tony Li
Happy to help!