Page 1 of 1

Adding a fast forward function for a Dialogue Scene

Posted: Sat Jan 22, 2022 11:15 pm
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!

Re: Adding a fast forward function for a Dialogue Scene

Posted: Sun Jan 23, 2022 8:21 am
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.