Page 1 of 1

[HOWTO] How To: Control the Duration of Subtitle Text

Posted: Mon Jan 22, 2024 8:17 pm
by Tony Li
When the Dialogue System processes a dialogue entry in an active conversation, it displays it as a subtitle. (If your PC entries aren't appearing as subtitles, see this post.)

Each subtitle stays onscreen for the duration of its Sequence, after which time it advances to the next stage of the conversation, which may be another subtitle, a player response menu, or the end of the conversation. (More info: Cutscene Sequences.) If the dialogue entry's Sequence field is blank, it uses the Dialogue Manager GameObject's Display Settings > Camera & Cutscene Settings > Default Sequence. The initial value of Default Sequence is:

Code: Select all

Delay({{end}})
This delays for the duration specified by the special keyword {{end}}, which is based on the text length, the Dialogue Manager GameObject's Display Settings > Subtitle Settings > Subtitle Chars Per Second, and Min Subtitle Seconds.

You can change an individual dialogue entry's Sequence or the Dialogue Manager's Default Sequence -- or even the Default Sequence in an individual conversation using Menu > Conversation Properties in the Dialogue Editor. For example, to always delay for 2 seconds, set Default Sequence to: Delay(2).

Side tip: If your dialogue UI uses a typewriter effect and you want to do something as soon as the typewriter finishes, listen for the sequencer message "Typed". Example:

Code: Select all

AnimatorPlay(MoveMouth);
required AnimatorPlay(CloseMouth)@Message(Typed)
More info: How To: Match Typewriter Speed & Subtitle Display Duration

Note 1: If you want to include the Dialogue Manager's Default Sequence (or the conversation's Default Sequence if you've set it specifically in conversation properties), include {{default}}; in the sequence. Example:

Code: Select all

{{default}}; Audio(Hello)
Note 2: If you have set the Dialogue Manager's Subtitle Settings > Continue Button mode to a mode that requires a continue button click, the subtitle will also wait for the player to click a continue button, or for a Continue() sequencer command which simulates a continue button click.