Using continue key in timeline?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jjpixelc
Posts: 44
Joined: Sun Mar 01, 2020 1:04 pm

Using continue key in timeline?

Post by jjpixelc »

Hi

I generally use continue key (in my case spacebar) in my game. I find it works great to let the player decide the flow of the conversations this way.
But I was wondering whether I could use this method in timelines too, so that players progressed through a timeline cutscene by tapping space to go to the next dialogue entry?

I'm thinking some code that paused the timeline/game on every continue node, then jumping to the next continue node when space (or a button or whatever) is pressed before starting the timeline again from there. And there would have to be the option of not jumping sometimes, when you want some other actions in the timeline to take place.

Is this feasable? I could probably write it myself, but I was thinking you could maybe set me on the right road so I don't waste too much time looking at dead ends.
User avatar
Tony Li
Posts: 22135
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using continue key in timeline?

Post by Tony Li »

Hi,,

Yes, you can do that. Assuming your timeline is named "yourTimeline", set the conversation's Default Sequence to something like:

Code: Select all

Timeline(speed, yourTimeline, 0);
required Timeline(speed, yourTimeline, 1)@Message(Continued)
The first command pauses the timeline by setting its speed to zero.

The second command waits until it receives the message "Continued" -- which, technically, nothing in the Dialogue System ever sends. It's just an arbitrary string I chose. However, when the player continues by pressing the continue button, the "required" keyword guarantees that the command runs, which resumes the timeline by setting its speed to one.

You could add other commands in there, such as this to hide the continue button until the typewriter has finished:

Code: Select all

Timeline(speed, yourTimeline, 0);
SetContinueMode(false);
SetContinueMode(true)@Message(Typed);
required Timeline(speed, yourTimeline, 1)@Message(Continued)
(The "Typed" message is actually sent by something in the Dialogue System -- the typewriter effect.)

And/or clear the text after a delay based on the text length:

Code: Select all

Timeline(speed, yourTimeline, 0);
ClearSubtitleText(all)@{{end}};
required Timeline(speed, yourTimeline, 1)@Message(Continued)
jjpixelc
Posts: 44
Joined: Sun Mar 01, 2020 1:04 pm

Re: Using continue key in timeline?

Post by jjpixelc »

Thanks!
I got a nice functionality working by starting from your suggestions here.
Very satisfied customer as always! :-)
User avatar
Tony Li
Posts: 22135
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using continue key in timeline?

Post by Tony Li »

Glad to help!
Post Reply