Getting Whole Timelines to Loop

Announcements, support questions, and discussion for the Dialogue System.
spuddy93
Posts: 9
Joined: Sun Jun 19, 2022 4:19 pm

Getting Whole Timelines to Loop

Post by spuddy93 »

Hello,

So my team has recently reached beta and I am now able to polish some things that have been under my skin for a while now. We have several cutscenes already implemented and Dialogue System has been a useful tool for us.

We've been using it with the pattern where the Dialogue System conversation controls the flow of the cutscene. In a simplified explanation, we have a cutscene manager that essentially loads up the Unity scene, creates the relevant prefab, then calls start conversation then yields until it is done. The conversation then runs the playable directors through sequencer commands.
Here is an animation being called from a sequence command while a line of dialogue is being delivered.
Screenshot 2023-03-06 193226.png
Screenshot 2023-03-06 193226.png (79.54 KiB) Viewed 227 times
Now, I'd like to have this timeline playable loop. Currently, it plays once and then everything freezes. I know there are other solutions to the freezing besides having the timeline loop, but after talking it over with my lead about it, every other solution we could come up with would require a significant overhaul of our completed content. However, all of the methods I've tried to accomplish that so far have not worked. Before throwing the towel in on this and doing some significant reworking, I'd like to ask for help here to see if anyone has a solution for this. I've tried setting the playable director's wrap mode to loop and then using the sequence command

Code: Select all

Timeline(play, playableName, false, true)
to call the command with NoStop set to true.
Screenshot 2023-03-06 195609.png
Screenshot 2023-03-06 195609.png (14.17 KiB) Viewed 227 times
Screenshot 2023-03-06 195946.png
Screenshot 2023-03-06 195946.png (6.27 KiB) Viewed 227 times
I've also tried just setting the wrap mode to loop and even trying to set NoWait to true even though I am pretty sure that is not what I am looking for.

I feel like the solution for this is probably staring me in the face and I am just missing it, like being stuck on a puzzle in Zelda. :lol:

If anyone has any advice I would really appreciate it.
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Getting Whole Timelines to Loop

Post by Tony Li »

Hi,

Try this update to the Timeline() sequencer command:

DS_TimelinePatch_2023-03-07.unitypackage

The Timeline() command will now let the timeline run until interrupted if Wrap Mode is set to Loop. This change will be in version 2.2.35.
spuddy93
Posts: 9
Joined: Sun Jun 19, 2022 4:19 pm

Re: Getting Whole Timelines to Loop

Post by spuddy93 »

That seems to work great! Thanks so much Tony!
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Getting Whole Timelines to Loop

Post by Tony Li »

Glad to help!
spuddy93
Posts: 9
Joined: Sun Jun 19, 2022 4:19 pm

Re: Getting Whole Timelines to Loop

Post by spuddy93 »

I have a follow-up question, is there a way to get an timeline to play during a response menu? I've tried putting

Code: Select all

Timeline(play, name)
in the Response Menu Sequence of both the node before the point where they branch and on one of the branches. In this picture, the places where I've tried to put the command are circled in green.
Screenshot 2023-03-07 154645.png
Screenshot 2023-03-07 154645.png (68.2 KiB) Viewed 213 times
Thanks for taking the time to read my questions!
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Getting Whole Timelines to Loop

Post by Tony Li »

It should be on the <Player Stands> node. Temporarily set the Dialogue Manager's Debug Level to Info and reproduce the issue to confirm that it's actually running this sequence.

Also try including the "nostop" and "nowait" parameters in your Timeline() command.
spuddy93
Posts: 9
Joined: Sun Jun 19, 2022 4:19 pm

Re: Getting Whole Timelines to Loop

Post by spuddy93 »

Screenshot 2023-03-08 160311.png
Screenshot 2023-03-08 160311.png (49.97 KiB) Viewed 208 times
Screenshot 2023-03-08 161553.png
Screenshot 2023-03-08 161553.png (33.69 KiB) Viewed 208 times
Okay, so I tried that (with and without the true, true) and the console had two messages saying that it was trying to play it so maybe it's trying to play it twice? I double checked and pasted the name of the playable in, just in case there was some strange string issue, but that didn't solve it. I'm using this same playable further down in the cutscene and it's working just fine there, so I don't think there is an issue with the playable itself. I know I mentioned that I tried putting this command on one of the response nodes, but I removed that and the <Player Stands> node is the only node with this command in the Response Menu Sequence.

Edit: I'll also add that we're on version 2.2.22 according to the Welcome Window, in case this is something you know you've fixed in a later version.
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Getting Whole Timelines to Loop

Post by Tony Li »

The syntax for Timeline() is a little unusual. Instead of using "true" and "false", use the literal keywords "nostop" and "nowait", as in:

Code: Select all

Timeline(play, 01-1idle, nostop, nowait)
When Debug Level is set to Info, you'll see two log lines for every sequencer command. The first line appears as soon as the sequence starts. It shows the result of parsing the command. The second line appears when the command actually runs. It shows the actual values being used for special parameters such as 'speaker'.
spuddy93
Posts: 9
Joined: Sun Jun 19, 2022 4:19 pm

Re: Getting Whole Timelines to Loop

Post by spuddy93 »

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

Re: Getting Whole Timelines to Loop

Post by Tony Li »

Glad to help!
Post Reply