Page 1 of 1

Skip to next line without delay

Posted: Mon Mar 06, 2023 2:47 pm
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.

Re: Skip to next line without delay

Posted: Mon Mar 06, 2023 3:02 pm
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}}".

Re: Skip to next line without delay

Posted: Mon Mar 06, 2023 4:21 pm
by tomraegan
Cheers! Perfect.