Skip through dialogue on keypress (like Renpy)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Vard
Posts: 7
Joined: Tue Aug 15, 2023 5:34 pm

Skip through dialogue on keypress (like Renpy)

Post 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
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip through dialogue on keypress (like Renpy)

Post 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.
Vard
Posts: 7
Joined: Tue Aug 15, 2023 5:34 pm

Re: Skip through dialogue on keypress (like Renpy)

Post 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
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip through dialogue on keypress (like Renpy)

Post 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.
Vard
Posts: 7
Joined: Tue Aug 15, 2023 5:34 pm

Re: Skip through dialogue on keypress (like Renpy)

Post 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
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip through dialogue on keypress (like Renpy)

Post by Tony Li »

I'll post an example here later today. Skipping the typewriter to the end will require an extra line of code.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip through dialogue on keypress (like Renpy)

Post 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).
Post Reply