Page 1 of 1

Skip through dialogue on keypress (like Renpy)

Posted: Thu Aug 17, 2023 1:53 am
by Vard
Is it possible to set up Dialgoue System to skip each line of dialogue while holding ctrl, like we can do in visual novels? I would like to recreate renpy-like controls, including skipping and using the mouse wheel to go back a line.

I could likely write a script to do this, but since the system is pretty flexible I'm hoping there's a simple way built in

Re: Skip through dialogue on keypress (like Renpy)

Posted: Thu Aug 17, 2023 7:32 am
by Tony Li
Hi,

Add a Conversation Control component to your Dialogue Manager.

When the player presses or releases Ctrl, call its ToggleAutoPlay() method. If you have a button that skips until the next player response menu, configure it to call SkipAll(). The methods in ConversationControl are virtual, so you can make a subclass if you'd like to override how things work.

To backtrack a line, see the Backtrack Example (direct download) on the Dialogue System Extras page. It has a Backtrack script.

Re: Skip through dialogue on keypress (like Renpy)

Posted: Fri Aug 18, 2023 3:33 am
by Vard
This has helped me make progress, but there's still some things I can't figure out.

What I want to do is stop the typewriter effect and show each line of text for part of a second so you see how many lines you are skipping. Currently skip-all takes me instantly to the next choice.

I come from other languages so some of ConversationControl/AbstractDialogueUI aren't clear to me. The manual made me think OnConversationLine body could change from

Code: Select all

subtitle.sequence = "Continue(); " + subtitle.sequence; 
to

Code: Select all

subtitle.sequence = "\, " + subtitle.sequence;,
to do what I want, but I'm not sure that method is ever even used

Re: Skip through dialogue on keypress (like Renpy)

Posted: Fri Aug 18, 2023 8:10 am
by Tony Li
Try:

Code: Select all

subtitle.sequence = "Continue()@0.5; " + subtitle.sequence;
This will show each line for 0.5 seconds and then continue to the next line.

Re: Skip through dialogue on keypress (like Renpy)

Posted: Sat Aug 19, 2023 4:34 am
by Vard
I've just tried your suggestion, it didn't change anything for holding control to skip.

It does help for toggling (SkipAll()), but not for skipping by holding a button (ToggleAutoPlay()) - it seems the OnConversationLine method doesn't get invoked when skipping that way.

Also how do I switch off the type writer effect? even during SKipAll I only see a couple of letters thanks to the effect

Re: Skip through dialogue on keypress (like Renpy)

Posted: Sat Aug 19, 2023 9:01 am
by Tony Li
I'll post an example here later today. Skipping the typewriter to the end will require an extra line of code.

Re: Skip through dialogue on keypress (like Renpy)

Posted: Sat Aug 19, 2023 5:46 pm
by Tony Li
Hi,

Here's an example:

DS_AutoplayKeypressExample_2023-08-19.unitypackage

The Skip All button in the upper right skips all the way to the end (or to the next player choice if applicable).

Holding down Left Ctrl auto plays. Releasing it resumes the previous behavior (click continue button to advance).