2 characters saying a line at the same time?

Announcements, support questions, and discussion for the Dialogue System.
ThomasDL
Posts: 9
Joined: Tue Jan 25, 2022 12:33 pm

2 characters saying a line at the same time?

Post by ThomasDL »

Hi Tony!

Please excuse me if this has already been answered somewhere else. I'm sure it has, but I can't find it.

With speech bubbles, is it possible to have 2 characters say a line at the same time from the same conversation?

Thanks in advance!
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: 2 characters saying a line at the same time?

Post by Tony Li »

Hi,

Yes. On your bubble subtitle panels, set the Standard UI Subtitle Panel component's Visibility dropdown to Always Once Shown. This will keep the first character's bubble visible when the second character's bubble appears.

If you set the first character's Sequence to advance after a very short time (e.g., set the Sequence field to "Delay(0.1)") then the second character won't have to wait for the first one.
ThomasDL
Posts: 9
Joined: Tue Jan 25, 2022 12:33 pm

Re: 2 characters saying a line at the same time?

Post by ThomasDL »

Alright thanks!

Last question (at least for now):
In the subtitle settings of the Dialogue Manager, the min seconds field is described as: "The guaranteed minimum amount of time that a subtitle is displayed (if the corresponding checkbox is ticked)."

Is that even if the player presses continue?
Also, where is said corresponding checkbox?
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: 2 characters saying a line at the same time?

Post by Tony Li »

Hi,

> Is that even if the player presses continue?

No. The continue button will instantly advance the conversation.


> Also, where is said corresponding checkbox?

On the Dialogue Manager's GameObject, in the Display Settings > Subtitle Settings section. If 'Show NPC Subtitles During Line' is ticked, then NPC subtitles will appear. If 'Show PC Subtitles During Line' is ticked, then player subtitles will appear -- unless 'Skip PC Subtitle After Reponse Menu' is also ticked and the subtitle was selected from a response menu.

(If you want single player nodes to automatically play as subtitles instead of appearing in response menus, untick Input Settings > Always Force Response Menu.)
ThomasDL
Posts: 9
Joined: Tue Jan 25, 2022 12:33 pm

Re: 2 characters saying a line at the same time?

Post by ThomasDL »

Aaah got it!

So if I want the player to have to wait before he can press continue, I have to do it with a custom script?
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: 2 characters saying a line at the same time?

Post by Tony Li »

You can use the player node's Sequence field.

The Sequence field holds sequencer commands. When the Dialogue System show the node's subtitle, it also runs the commands in the Sequence field. Sequencer commands are often used to play animation, activate GameObjects, etc., but you can also use the command SetContinueMode() to disable and enable the continue button. (More info: Sequences)

If a Sequence field is blank, the node will use the Default Sequence defined on the Dialogue Manager GameObject in Display Settings > Camera & Cutscene Settings > Default Sequence.

The most commonly used sequencer command is Delay({{end}}), which delays (keeping the subtitle visible) for a duration {{end}} that's based on text length. The Dialogue Manager's Default Sequence is initially set to Delay({{end}}).

If you want to hide the continue button until the duration of {{end}} for player nodes, you can set the Dialogue Manager's Default Player Sequence to:

Code: Select all

SetContinueMode(false);
SetContinueMode(true)@{{end}}
The first line hides the continue button.

The second line shows the continue button when the {{end}} duration has elapsed.

Note that, if your dialogue UI's subtitle panels use typewriter effects, the speed at which the typewriter effect shows characters may be different from the duration {{end}}. The typewriter speed is controlled on the dialogue UI's Subtitle Text GameObject > typewriter effect component. The value of {{end}} is based on the Dialogue Manager's Subtitle Settings > Subtitle Chars Per Second and Min Subtitle Seconds.
ThomasDL
Posts: 9
Joined: Tue Jan 25, 2022 12:33 pm

Re: 2 characters saying a line at the same time?

Post by ThomasDL »

Interesting!

But then if I do write a sequence, if I want to keep this behavior on top of it I'd have to add "{{default}}" to the sequence, correct?
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: 2 characters saying a line at the same time?

Post by Tony Li »

Yes, that's correct.

I didn't want to complicate things, but an improved version of that Default Player Sequence to:

Code: Select all

SetContinueMode(false);
required SetContinueMode(true)@{{end}}
The 'required' keyword guarantees that the command runs and continue button mode is turned back on even if something in your Sequence causes the conversation to advance before the {{end}} duration has elapsed. The only thing that would force the conversation to advance early would be the Continue() command. For example, if your player node's Sequence were:

Code: Select all

{{default}}; Continue()@0.5
Then the conversation would manually advance after 0.5 seconds because the Continue() command simulates a continue button click. Without 'required', SetContinueMode(true)@{{end}} would not run because the {{end}} duration wouldn't have elapsed yet.
ThomasDL
Posts: 9
Joined: Tue Jan 25, 2022 12:33 pm

Re: 2 characters saying a line at the same time?

Post by ThomasDL »

I have a weird recurring bug that for the life of me I can't explain. I don't think it's related to what we discussed earlier, but I'm not sure.

So I have a test conversation set up with a back-and-forth between the player and 2 NPCs. At the end of the conversation, the last line links to another conversation where a single line is spoken by the player (I was testing the link to parameter).

Sometimes, when I trigger the conversation, all the player's lines will be skipped except the first line from the linked conversation. Sometimes all the lines will be said. It seems random to me. Sometimes the behavior will switch within the same session. What could be causing this?
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: 2 characters saying a line at the same time?

Post by Tony Li »

Hi,

Is there a ConversationControl component in your scene? If so, is anything calling its SkipAll() method?

If there's no ConversationControl component, what are the Dialogue Manager's Display Settings > Camera & Cutscene Settings > Default Sequence and Default Player Sequence set to?
Post Reply