Play multiple text lines in parallel?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jspro
Posts: 10
Joined: Tue Nov 24, 2020 5:33 am

Play multiple text lines in parallel?

Post by jspro »

Hello,

I'm hoping I can get some ideas on how to solve this, I've kinda hit a wall here. For reference, I'm using Ink to handle the text.

So my old dialogue system handled in-line commands (I've already recreated this in DS). One of these commands is what I called the async command. Basically, once the typewriter function reaches that index, it immediately plays the next line while continuing to type out the current one.

This was decently simple to implement with my old system, but I'm having trouble doing this "properly" in DS. Any ideas/suggestions would be much appreciated.
User avatar
Tony Li
Posts: 21928
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play multiple text lines in parallel?

Post by Tony Li »

Hi,

One option is to write your own implementation of the IDialogueUI C# interface. Add it to a GameObject or prefab, and assign that to the Dialogue Manager's Dialogue UI field. The Dialogue System will work happily with anything that implements IDialogueUI. I mention this because you might prefer to write a simple, bespoke implementation that does exactly what you want and nothing more.

Alternatively, to use the built-in Standard Dialogue UI implementation of IDialogueUI, I could use some details on your UI. Do you want all of the text to accumulate in a single text box (i.e., same subtitle panel)? Or are different lines in different subtitle panels, such as if they're spoken by different characters?

If they're in different subtitle panels, it's easier. Make a subclass of StandardUISubtitlePanel. Override FinishSubtitle() to not stop the typewriter:

Code: Select all

        public override void FinishSubtitle()
        {
            HideContinueButton();
            //--- Don't stop typing:
            //var typewriter = GetTypewriter();
            //if (typewriter != null && typewriter.isPlaying) typewriter.Stop();
        }
Then assign the subclass to your subtitle panels in place of StandardUISubtitlePanel.

If it's all in one subtitle panel, how do you want it to work? Two typewriters happening at once in the same box?
jspro
Posts: 10
Joined: Tue Nov 24, 2020 5:33 am

Re: Play multiple text lines in parallel?

Post by jspro »

Do you want all of the text to accumulate in a single text box (i.e., same subtitle panel)? Or are different lines in different subtitle panels, such as if they're spoken by different characters?
Definitely the latter.
One option is to write your own implementation of the IDialogueUI C# interface.
The Standard implementation has lots of bells and whistles that I'd like to use, haha.
If they're in different subtitle panels, it's easier. Make a subclass of StandardUISubtitlePanel. Override FinishSubtitle() to not stop the typewriter:
Pretty sure this'll work for me. Thank you very much for your help :)
User avatar
Tony Li
Posts: 21928
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play multiple text lines in parallel?

Post by Tony Li »

Glad to help! If you have questions about setting up that subclass, just let me know.
Post Reply