Skip to next line without delay

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
tomraegan
Posts: 5
Joined: Sat Nov 26, 2022 11:56 pm

Skip to next line without delay

Post by tomraegan »

Hi Tony,

I use this script, which is working well. Its purpose is to not show the player typewriter effect.

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;
public class SkipTypewriterForPlayer : MonoBehaviour
{
    void OnConversationLine(Subtitle subtitle)
    {
        if (subtitle.speakerInfo.isPlayer)
        {
            subtitle.formattedText.text = @"\^" + subtitle.formattedText.text;            
        }
    }
}
What I need is for the next line of dialogue to show immeidately after the player selects theirs. As it is, with this above code, the manager waits for the duration that the typewriter would have taken to display the text. In other words, a long player repsonse will mean a long wait for the next line of dialogue to show.

Many thanks for the help.
User avatar
Tony Li
Posts: 21957
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip to next line without delay

Post by Tony Li »

Hi,

Instead of:

Code: Select all

subtitle.formattedText.text = @"\^" + subtitle.formattedText.text; 
you could use:

Code: Select all

subtitle.sequence = "Continue()@0";
This will act like a continue button was clicked to skip ahead, which will jump the typewriter to the end and immediately progress to the next step in the conversation.

Or you can set the Dialogue Manager GameObject's Display Settings > Camera & Cutscene Settings > Default Player Sequence to: Continue()@0

This will make it apply to all player lines whose Sequence fields are blank or include "{{default}}".
tomraegan
Posts: 5
Joined: Sat Nov 26, 2022 11:56 pm

Re: Skip to next line without delay

Post by tomraegan »

Cheers! Perfect.
Post Reply