Using Sequence Messages to Control Timeline

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
justinoaksford
Posts: 4
Joined: Sun Jan 15, 2023 5:17 pm

Using Sequence Messages to Control Timeline

Post by justinoaksford »

Hi! Thank you so much for this awesome plug-in.

I'm extremely new to C# and Unity, but trying to patiently understand and improve.

I'm coming from RPG Maker, and my desire is to make a game in that style (FF6, Chrono Trigger, or more recently, Chained Echoes :p)

My goal is to find an intuitive\expressive way to author the cutscenes with dialog using Unity's Timeline. I've looked at and experimented with a few different structures (signal emitters, various script approaches). I think there's probably a better way to do this than what I'm doing, but I'm accepting the "fix as you go" approach to learning the tech side of game development. "Perfect is the Enemy of the Done", as they say.

Currently, I have a cutscene that demands 2 distinct sorts of behaviors;
- Dialogue that plays over an active part of the timeline (character movement\camera pan), where the player can either speed through the dialog at their pace and wait for the cutscene to "catch up", or the player can do nothing, wait for the cutscene to hit a "pause" point, and the cutscene will not proceed until the player has advanced to a certain point in the conversation.
-But later in the same cutscene, I want the behavior such that the timeline plays a segment, and then "waits" when dialog is called until the dialog tells it to "resume".
-Really, this boils down to trying in vain to import a quirk of RPGMaker, which is a substitute for authoring and firing events "in-line", where they can overlap but the "Conversation" is what controls the overall flow. I know Sequencer has some of this capacity built in, but looking in to it, I did not see a comfortable authorship path that way. I may just be wrong there and it's in fact exactly what I want?

My current solution is to have a TimelineManager Timeline which contains:
-a control track that plays a separate timeline with only "visual" aspects of the cinematic- cinemachine cam, character movement, etc.
-the conversation tracks to play "over" that timeline
-a Sequencer track to basically play "speed 0" and "speed 1" commands for the Manager timeline playback. When the track is played by the timeline, it immediately sets the speed to "0" and waits for "go" before setting the speed back to "1".

My current problem, is that trick only works for the first time. the second "Sequence track" appears not to stop, which after poking around and making sure my semicolons were placed properly :p, I can only assume means the "go" message is overriding the "stop" action immediately.

If this assumption is correct and there aren't huge errors elsewhere, my question would be, "is there a way to revert the state\"unsend" the "go" message so that this pattern will work, or is there some structural problem?"

Hopefully this isn't too much of a "please make my game for me" question!
dialoghelp1.jpg
dialoghelp1.jpg (374.05 KiB) Viewed 225 times
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Sequence Messages to Control Timeline

Post by Tony Li »

Hi,

Try changing the last node's Sequence to:

Code: Select all

required SequencerMessage(go);
Continue()
The "required" keyword guarantees that the SequencerMessage() command will run. Otherwise, if Continue() runs first, it will immediately stop the node without running any sequencer commands that are still pending -- except for commands that are marked "required".
justinoaksford
Posts: 4
Joined: Sun Jan 15, 2023 5:17 pm

Re: Using Sequence Messages to Control Timeline

Post by justinoaksford »

Ah! That's good to know- I implemented that, and while it may not have been the source of my particular issue, one last rubberducking over everything revealed some unfortunately obvious errors where I hadn't updated a reference to the right timeline. Thank you again! I'll try to be more thorough before posting next time :P
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Sequence Messages to Control Timeline

Post by Tony Li »

Sounds good! If you get stuck on something, feel free to post right away. It might be a common question or known issue that I can help with instead of you having to dig through reams of documentation.
Post Reply