How to properly write narrative conversation line, including stopping the previous Npc audio?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
doneykoo
Posts: 7
Joined: Fri Sep 29, 2017 4:29 am

How to properly write narrative conversation line, including stopping the previous Npc audio?

Post by doneykoo »

(I'm newbie in using this.) How to properly write narrative conversation line?

Now I've setup a conversation, a part of it is like this:

Npc: text-aaa...
Sequence: Audio(aaa); AnimatorInt(action, 1)

Npc: text-bbb...
Sequence: Audio(bbb); AnimatorInt(action, 2)

Player choice: choice-a, choice-b

Narrative: text-ccc...
(configuring the line by setting Actor and Conversant to both '(None)')


Here are the problems for this narrative line.
1, If the previous Npc Audio(bbb) is long, the audio is still playing there. I want the previous Npc Audio(bbb) to properly stop when the narrative line starts. (could be same effect if we can stop it when the player choice is made). How to stop it properly?
2, The portrait UI is still displayed. How to hide it for narrative?
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to properly write narrative conversation line, including stopping the previous Npc audio?

Post by Tony Li »

Hi,

Create a "Narrator" actor. Assign an invisible portrait image (e.g., a single pixel with alpha zero). Assign the "Narrator" actor to the narrative lines.

Then replace your Audio() commands with AudioWait() commands. This command waits until the audio is finished or the player clicks Continue, whereas the Audio() command just starts the audio and forgets about it.
doneykoo
Posts: 7
Joined: Fri Sep 29, 2017 4:29 am

Re: How to properly write narrative conversation line, including stopping the previous Npc audio?

Post by doneykoo »

Tony Li wrote:Hi,

Create a "Narrator" actor. Assign an invisible portrait image (e.g., a single pixel with alpha zero). Assign the "Narrator" actor to the narrative lines.

Then replace your Audio() commands with AudioWait() commands. This command waits until the audio is finished or the player clicks Continue, whereas the Audio() command just starts the audio and forgets about it.
Thanks Tony, it works as you suggested in many ways.

I found a small issue in it, though not a big deal.
By naming the narrative actor as "Narrator" will cause the dialogue ui to display the string "Narrator".
So I need to change the DisplayName. But setting a "" (empty string) will cause the system think there's no DisplayName, which will still display "Narrator" in dialogue ui.
So finally, I set the "Narrator" actor to DisplayName of " " (string with a space).
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to properly write narrative conversation line, including stopping the previous Npc audio?

Post by Tony Li »

Glad it's working now.

Another way to handle the "Narrator" display is to use an Override Unity UI Dialogue Controls component:

1. Inspect your dialogue UI, and tick Find Actor Overrides.

2. Create a GameObject named "Narrator" (or add an Override Actor Name component, and set the Override Name to "Narrator").

3. Add an Override Unity UI Dialogue Controls component. Assign all the Subtitle and Subtitle Reminder UI elements from your dialogue UI, except leave Portrait Name and Portrait Image unassigned. When the Dialogue System shows lines for Narrator, it won't show the Portrait Name or Portrait Image.
Post Reply