Adding a fast forward function for a Dialogue Scene

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Adding a fast forward function for a Dialogue Scene

Post by fkkcloud »

Hello,

I am trying to add a fast forward function to move towards the dialogue really fast (not skipping!) until it meets the player choice.
What would be the most ideal way/case/example to do this with the Dialogue System?

Thank you!
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding a fast forward function for a Dialogue Scene

Post by Tony Li »

Hi,

If your dialogue UI does not use a typewriter effect, you can add a script with an OnConversationLine method to the Dialogue Manager. Something similar to:

Code: Select all

public class FastForwardManager : MonoBehaviour
{
    public bool fastForward;
    
    // Finish every subtitle after 0.5 seconds:
    void OnConversationLine(Subtitle subtitle)
    {
        if (fastForward)
        {
            subtitle.sequence = "Continue()@0.5; " + subtitle.sequence;
        }
    }
}
If your dialogue UI uses a typewriter effect and you want to speed up the typewriter, you can use a script to speed up the typewriter effect and set DialogueManager.displaySettings.subtitleSettings.subtitleCharsPerSecond and minSubtitleSeconds. See this post for information on how to change the typewriter speed in code.

The game Gestalt: Steam & Cinder, for example, lets you hold down a joystick button or key to speed up lines of dialogue. When you press the button, it sets the typewriter speed and subtitleCharsPerSecond to 200 characters per second, and adds Continue()@{{end}} to the sequence. When you release the button, it returns to the original speed and leaves the original sequence untouched.
Post Reply