Question about Continue Mode, Sequence, and Typewriter

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
golden1yaki
Posts: 17
Joined: Tue Dec 08, 2020 6:33 am

Question about Continue Mode, Sequence, and Typewriter

Post by golden1yaki »

Hi,

I'm implementing a function to allow players to toggle Continue Mode between "Always" and "Never." However, I've noticed an issue where some subtitles advance too quickly when Continue Mode is set to "Never," even if the typewriter has just started displaying a few words.

After looking up the forum, I found that this happens because a dialogue entry advances as soon as its sequence finishes. I hav some custom sequencer commands that aren't time-based and invoke a stop at the end of those methods. So dialogue entries with these sequencers get skipped(kind of) too quickly.

Is there a workaround to ensure dialogue entries only advance when the typewriter effect (or the line itself) is finished, regardless of the sequencer timing, when Continue Mode is set to "Never"?

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

Re: Question about Continue Mode, Sequence, and Typewriter

Post by Tony Li »

Hi,

Yes. Listen for the "Typed" sequencer message. The typewriter effect sends this message when it's done.

More info: How To: Control the Duration of Subtitle Text

Note: If you're using Text Animator, see the integration. You'll need to use TextAnimatorSubtitlePanel to get the Typed message from Text Animator.
golden1yaki
Posts: 17
Joined: Tue Dec 08, 2020 6:33 am

Re: Question about Continue Mode, Sequence, and Typewriter

Post by golden1yaki »

Hi Tony,

Thanks for the reply!
Sorry I wasn't very clear about my question. Here is a sample walkthrough of my database.
sample.jpg
sample.jpg (293.13 KiB) Viewed 1148 times
Sequencers "DoSomething1", "DoSomething2", "DoSomething3" aren't time-based and should be called as soon as the subtitle shows.
In this sample, dialogue quickly advances to node 4 when Continue Button Mode is "Never", and node 4, 5 display normally.

I've tried using @Message(Typed) but sequencers execute at the end of subtitle, and it's not ideal for me.
I've also tried typewriter's OnEnd() method(from this post), like this:

Code: Select all

void OnEnd()
{
  typewriter.onEnd.RemoveListener(OnEnd);
  dialogueUI.OnContinue();
}
typewriter.onEnd.AddListener(OnEnd);
It works as expected, but not with when Continue Button Mode set to "Never."
This raises a new question: If I prefer to use the typewriter's OnEnd event, what’s the best way to control continue button to achieve an auto-play function?
User avatar
Tony Li
Posts: 23259
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Continue Mode, Sequence, and Typewriter

Post by Tony Li »

Hi,

I recommend setting entry 1's Sequence to:

Code: Select all

DoSomething1();
DoSomething2();
{{default}}
The {{default}} keyword will pull in the text of the Dialogue Manager GameObject's Display Settings > Camera & Cutscene Settings > Default Sequence.

Then leave the Default Sequence to its initial value: Delay({{end}})
or change it to wait for the typewriter: WaitForMessage(Typed)

Or, if you don't know ahead of time whether continue mode will be Always or Never, set the Default Sequence to: Continue()@{{end}} or Continue()@Message(Typed)

That should always work. If it's not working in your scene, possible culprits are:
  • Subtitle Text GameObject doesn't have a typewriter effect.
  • Or the typewriter effect's Play On Enable checkbox is ticked. This should be UNticked. The dialogue UI will take care of playing the typewriter effect instead.
golden1yaki
Posts: 17
Joined: Tue Dec 08, 2020 6:33 am

Re: Question about Continue Mode, Sequence, and Typewriter

Post by golden1yaki »

Hi Tony,

All solutions work!
I end up using {{default}} + WaitForMessage(Typed).
Continue()@Message(Typed) also works but I need to do some modifications, so WaitForMessage(Typed) is the easier way.

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

Re: Question about Continue Mode, Sequence, and Typewriter

Post by Tony Li »

Glad to help!
Post Reply