First Sequence Listener

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
cungoliant
Posts: 7
Joined: Wed May 08, 2024 7:49 pm

First Sequence Listener

Post by cungoliant »

Hi,basically i implemented a custom cinemahine camera management. I am trying to fade in and out on conversation start (just once), and change to face cam (to speaker) on every sequence.

Code: Select all

//simple fade in
public void FadeCamera(Action onComplete = null)
{
	//fade in and out operation
	//and complete
	onComplete?.Invoke();
}
I need first sequence to start when onComplete (above) invokes. And then no more fading (just once, start of conversation). After that change to face cam (to speaker) on every sequence.

My default sequence is;

Code: Select all

SendMessage(DialogueSequenceTurn, , speaker);Delay({{end}})
And the method is;

Code: Select all

public void DialogueSequenceTurn()
{
	//switch to speaker's face cam
}
I tried to call FadeCamera in Dialogue System Event's OnConversationStart, but sequence does not wait the completion.

I could add a sequence that calls FadeCamera to all of my first nodes in dialogue database, but that's not a good approach.

How should i solve it? Thanks in advance
(I am sorry if similar questions have been asked)
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: First Sequence Listener

Post by Tony Li »

Hi,

If you don't want to use a Cinemachine Priority On Dialogue Event component and/or the Cinemachine***() sequencer commands, I suggest putting your code in a custom sequencer command. This way they can tie into the timing of the conversation and vice versa.
cungoliant
Posts: 7
Joined: Wed May 08, 2024 7:49 pm

Re: First Sequence Listener

Post by cungoliant »

Hi Tony, thank you for your reply.
Actually, my question was independent of cinemachine. Sorry for redundance.

What I want to know is if the text of the first node (only first node) of the conversation can be made to start when a certain action is invoked.

For example, on Dialogue System Event's OnConversationStart, suppose that i am calling-> NewConversationStarted;

Code: Select all

public void NewConversationStarted()
{
	//do something
	//
	//
	//and now dialogue panel can be opened and first node's text can be started typing
	// something like Sequencer.Message("SequenceCanStart") maybe?
}
Thank you again for your time.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: First Sequence Listener

Post by Tony Li »

Hi,

I'm trying to understand. Do you want to delay the appearance of the dialogue text until a certain action has occurred?

If so, create an empty node from <START>. Then link this empty node to the first node with text.

In the empty node, leave the Dialogue Text blank, and set the Sequence to something like:

Code: Select all

SetDialoguePanel(false, immediate); // Don't show dialogue UI yet.
WaitForMessage(SomeAction)
In your own code, call Sequencer.Message("SomeAction") when you want it to continue. Alternative example:

Code: Select all

SetDialoguePanel(false, immediate); // Don't show dialogue UI yet.
Camera(Closeup,,1)  // Do a 1-second closeup zoom before showing UI.
In the first node with text, include ShowDialoguePanel(true) in the Sequence:

Code: Select all

ShowDialoguePanel(true);
{{default}}
cungoliant
Posts: 7
Joined: Wed May 08, 2024 7:49 pm

Re: First Sequence Listener

Post by cungoliant »

Hi Tony, thanks again for response.

Creating an empty node from <START> solves my problem. I implemented empty node's sequence like this:

Code: Select all

SetDialoguePanel(false, immediate); Continue()@Message(SomeAction);
Though, i had to remove the Animator component and Canvas Group component of the subtitle panels as you mentioned in https://www.pixelcrushers.com/phpbb/vie ... 961#p43961.
Also in your previous response there is ShowDialoguePanel(true), i thought that was a typo and replaced with SetDialoguePanel(true).

Thanks again for your help.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: First Sequence Listener

Post by Tony Li »

Oops, yes, that was a typo
Post Reply