"Narrator" actor, avoid portrait image change

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
hearsedriver
Posts: 19
Joined: Tue Dec 17, 2019 6:16 am

"Narrator" actor, avoid portrait image change

Post by hearsedriver »

I've got an artificial "narrator" actor defined that I use for some explanatory text between PC/NPC subtitles. Is there any way to avoid NPC portrait image changes?

I already managed to toggle the portrait image on and off in OnConversationLine if subtitle.speakerInfo.nameInDatabase == "narrator", because the narrator doesn't have any portrait image or name. But ideally, I want to leave the last speaker's portrait image and name, and if the dialogue starts with a narrator text, I would like to show the portrait image and name of the next speaker.

How could I achieve this?

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

Re: "Narrator" actor, avoid portrait image change

Post by Tony Li »

Hi,

Add another subtitle panel for the narrator. It could be a duplicate of your regular NPC subtitle panel (e.g., pointing to the same subtitle text and continue button) but with no portrait name or portrait image assigned.

Remember to assign this new subtitle panel to the Standard Dialogue UI component's Subtitle Panels list. It'll have an element number, such as Element 2.

If your narrator has a GameObject, add a Dialogue Actor component to the GameObject, set the Actor dropdown to Narrator, and set Dialogue UI Settings > Subtitle Panel Number to that element number.

If your narrator doesn't have a GameObject and you don't want to create an empty one for it, you can use the [panel=#] markup tag or SetPanel() sequencer command to tell specific dialogue entry nodes to use that panel.
hearsedriver
Posts: 19
Joined: Tue Dec 17, 2019 6:16 am

Re: "Narrator" actor, avoid portrait image change

Post by hearsedriver »

Thanks, Tony, I added the second panel and changed the Dialogue Actor's subtitle panel number. I did it for both the Player and the Narrator, as I only want the NPC's portrait to appear. That worked nicely!

If the dialogue starts with the narrator, the standard portrait (as configured in the UI) is shown. I can disable it and keep my OnDialogueLine handling to only enable it once an NPC speaks, but maybe you've got a suggestion how I could initialize it with the correct portrait, i.e. the next NPC in the conversation that's going to speak, right from the start?

Thanks again for the fast response!
hearsedriver
Posts: 19
Joined: Tue Dec 17, 2019 6:16 am

Re: "Narrator" actor, avoid portrait image change

Post by hearsedriver »

One more thing, after the change I noticed that my dialogue text is now switching between the different actors (i.e. it appears as if it's cleared once the actor and dialogue panel changes) even though "accumulate text" is ticked on both subtitle panels and they're both referencing the same subtitle text object. I've also tried to untick "Clear Text on Close" without success.

Is there a way to avoid that? I want to have a continuous "Disco Elysium" style dialogue.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: "Narrator" actor, avoid portrait image change

Post by Tony Li »

hearsedriver wrote: Sun Oct 17, 2021 6:48 amIf the dialogue starts with the narrator, the standard portrait (as configured in the UI) is shown. I can disable it and keep my OnDialogueLine handling to only enable it once an NPC speaks, but maybe you've got a suggestion how I could initialize it with the correct portrait, i.e. the next NPC in the conversation that's going to speak, right from the start?
Set the standard portrait's subtitle panel Visibility dropdown to Always Once Shown. It's probably set to Always From Start right now. But first see below, since there's another consideration with "accumulate text".
hearsedriver wrote: Sun Oct 17, 2021 7:30 amOne more thing, after the change I noticed that my dialogue text is cleared once the actor and dialogue panel changes even though "accumulate text" is ticked on both subtitle panels and they're both referencing the same subtitle text object.

Is there a way to avoid that? I want to have a continuous "Disco Elysium" style dialogue.
That's a little trickier. "Accumulate text" depends on using a single subtitle panel. This is because subtitle panels don't share their content with each other, as that would cause issues with other styles of dialogue UIs. Instead, you can use a single subtitle panel, tick the panel's "Only Show NPC Portraits" checkbox, and make the Narrator a "player" actor. Here's an example scene:


DS_NarratorScrollingExample_2021-10-17.unitypackage


Some notes on how I set it up:
  • Dialogue Manager GameObject:
    • Ticked Subtitle Settings > Show PC Subtitles During Line
  • Conversation:
    • Used "[auto]" tags on the Narrator's lines so they don't appear as response menu options. If you've unticked the Dialogue Manager's Input Settings > Always Force Response Menu, this isn't necessary.
  • Subtitle Panel
    • Used the Scrolling Dialogue UI prefab.
    • Unassigned the portrait image and name from the Response Menu Panel.
    • On the subtitle panel, ticked Only Show NPC Portraits.
    • Configured the OnOpen() event to set the Portrait Image to a transparent sprite and Portrait Name to a blank string, to initialize them at the start of the conversation.
Post Reply