Playing timeline on conversation end

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
drorco
Posts: 6
Joined: Thu Apr 28, 2022 12:52 pm

Playing timeline on conversation end

Post by drorco »

Hey there,

I'm trying to resume a timeline animation when a conversation ends and the conversation UI disappears, but the best result I was able to achieve, is to have the timeline animation resumed when the Typed message is sent.

What I'm doing is basically to add this command to the sequence field of the last conversation node:

Timeline(play,MayorSlideFromRight)@Message(Typed)

It's almost what I want. I want the timeline to play only when the conversation actually ended and the UI disappeared. Any ideas on how to do that?

Thanks.
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing timeline on conversation end

Post by Tony Li »

Hi,

If you didn't need to wait for the dialogue UI to be fully hidden, you could do this, assuming you require the player to click the continue button to advance the conversation:

Code: Select all

required Timeline(play,MayorSlideFromRight)@Message(WaitForever)
If you instead use a default sequence such as "Delay({{end}})" to wait for a duration based on subtitle length instead of a continue button, you could do this:

Code: Select all

required Timeline(play,MayorSlideFromRight)@{{end}}
However, the catch with both of those is that they, like the "OnConversationEnd" event, trigger as soon as the last subtitle/response menu ends -- but before the dialogue UI's hide animation has finished, if your dialogue UI uses a hide animation.

To do something once the dialogue UI's hide animation has finished, you'll need to hook into the dialogue UI's Dialogue Panel > OnClosed() UnityEvent.
drorco
Posts: 6
Joined: Thu Apr 28, 2022 12:52 pm

Re: Playing timeline on conversation end

Post by drorco »

Thank you Tony!

So I tried both of the first options you've suggested, as I don't mind the timeline resuming just after the dialogue ended, but what happens now is that the dialogue just restarts, and then when it ends the second time, the timeline instantly ends.

Any idea why this happens?

If possible, I'd prefer not to hook to the Dialogue's Panel OnClosed event.

Thanks!
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing timeline on conversation end

Post by Tony Li »

Hi,

I notice you wrote "timeline resuming." Is your intent to pause the Timeline and resume it when the conversation ends? If so, foes your timeline include any Start Conversation clips? If so, try using Timeline(speed, 0...) and Timeline(speed, 1...) instead of Timeline(stop...) and Timeline(play...). Timeline(play) or Timeline(resume) will re-run any clips at the point in the timeline where it was paused. Setting speed, on the other hand, does a proper pause.
drorco
Posts: 6
Joined: Thu Apr 28, 2022 12:52 pm

Re: Playing timeline on conversation end

Post by drorco »

Awesome. This works. Thanks!
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing timeline on conversation end

Post by Tony Li »

Glad to help!
Post Reply