Any way to automatically include a brief pause between sentences?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Tentakero
Posts: 48
Joined: Wed Sep 23, 2020 12:36 pm

Any way to automatically include a brief pause between sentences?

Post by Tentakero »

Hello!

https://www.pixelcrushers.com/phpbb/vie ... php?t=2818

I saw this thread mentioning that "\." can be used in the middle of a dialogue block, but is there anywhere that I can tweak to make it so that all sentences do this by default? I'm worried that I'll miss this bit of code when implementing large blocks of text and I'll have to backtrack too much to correct it.
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Any way to automatically include a brief pause between sentences?

Post by Tony Li »

Hi,

If you want to pause on periods and commas, you can configure the typewriter effect to do that. Add '.' to Full Pause Characters and ',' to Quarter Pause Characters.

If you want to pause on line breaks, you can add a script with an OnConversationLine method to your Dialogue Manager to preprocess the text:

Code: Select all

using PixelCrushers.DialogueSystem;
...
void OnConversationLine(Subtitle subtitle)
{
    subtitle.formattedText.text = subtitle.formattedText.text.Replace("\n", "\\.\n");
}
Tentakero
Posts: 48
Joined: Wed Sep 23, 2020 12:36 pm

Re: Any way to automatically include a brief pause between sentences?

Post by Tentakero »

Awesome, this is exactly what I was looking for. Thank you!
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Any way to automatically include a brief pause between sentences?

Post by Tony Li »

Glad to help!
Post Reply