Cinemachine, Timeline and DS

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Cinemachine, Timeline and DS

Post by urrmurrmur »

Hi everyone,

I am experimenting with integrating Cinemachine, Timeline and DS, and am currently trying to figure out the best approach for a couple of different situations.

Right now I have one question: I'm trying to make a micro-cutscene where upon interaction, a CM camera gets a higher priority, causing a blend from the previous camera to the new one, and after that is done a DS conversation should start. I've tried both a Chinemachine Camera Priority On Dialogue Event component, as well as a sequencer command (as explained here), but both approaches cause the dialog to start immediately - i.e., when the camera's start blending, rather than after they're done.

Additionally, since the conversations only have a single dialogue entry, and I'm not showing a response menu, the camera priorities get reset immediately after being changed (I'm changing them on the conversation start state, and they are immediately reset when the actual dialogue entry is shown). So I'm not seeing any change in the camera at all.


Now, I could fix this by making a small custom timeline, but since this is an action that I'll need to do often in the game, I was hoping there'd be some integrated way to do this with DS. Am I missing something, or is the Timeline approach my best bet?
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Cinemachine, Timeline and DS

Post by Tony Li »

Hi,

There's no need for Timeline for this. One solution is to add a node without any text between the <START> node and the text node. In that node, use the CinemachinePriority() and Delay() sequencer commands. For example, to switch to vcamA, and assuming the blend time is set to 1 second:

cinemachinePriorityNode.png
cinemachinePriorityNode.png (13.06 KiB) Viewed 629 times

To move the camera back at the end, you could add another node or include it in the text node's Sequence. For example, to move back after 3 seconds:

Code: Select all

CinemachinePriority(vcamA,0)@3;
Delay(4)
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Re: Cinemachine, Timeline and DS

Post by urrmurrmur »

Hi Tony, thanks for the quick response. I managed to get it working, but I had to do it slightly differently - possibly due to some of my DS settings being different. This is what I currently have:
dialogue_system.png
dialogue_system.png (22.3 KiB) Viewed 627 times
I have the continue button always enabled, which means the first dialogue entry never continues unless I manually call it from the sequence. I also have to use the @1 here, instead of Delay(1), because the continue triggered instantly even with the delay. Note I am currently (de)activating my CM cameras instead of using priorities, I'll likely update that later.

Then I initially had the last sequence in the dialogue entry with the text, but that caused it to trigger instantly. Is it intended behaviour for a sequence to trigger immediately upon loading of the entry, even if the user has not yet pressed continue?

Does this solution make sense to you, or am I overlooking something?


EDIT: I just realized I can merge the start state with the first empty one, ending up with three in total. That works as well.
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Cinemachine, Timeline and DS

Post by Tony Li »

That looks good. Technically you could reduce it to 2 nodes. Put the first set of sequencer commands in the <START> node.

Put the second set in the text node, like this:

Code: Select all

required SetActive(CM Car FPS, false)@9999;
required SetActive(CM Car Interior, true)@9999
The 'required' keyword guarantees that the commands run even if 9999 seconds haven't elapsed yet -- that is, they will run as soon as the player clicks continue. If you don't like to use 9999, you can use a fake message string that will never be sent:

Code: Select all

required SetActive(CM Car FPS, false)@Message(Foo);
required SetActive(CM Car Interior, true)@Message(Foo)
Post Reply