How to check if Conversation Node Sequencer ended

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Saper
Posts: 52
Joined: Tue Jan 12, 2021 11:25 am

How to check if Conversation Node Sequencer ended

Post by Saper »

Hi Tony

I have question how to check if Sequencer ended in Conversation Node. I need to start something on start of Dialogue window but not before Sequencer.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to check if Conversation Node Sequencer ended

Post by Tony Li »

Hi,

You can do that right in the sequence. For example, if the first node is something like:
  • Dialogue Text: (blank)
  • Sequence:

    Code: Select all

    SetDialoguePanel(false, immediate); // Hide the dialogue UI
    Fade(stay, 1); // Fade out over 1 second
    Audio(trumpet)@1; // Play trumpet audio clip at 1-second mark
    Fade(in)@2; // Fade in at 2-second mark
    SendMessage(Ready,,speaker)@3; // Call Ready() method on speaker GameObject at 3-second mark
Then it will call the Ready() method on the C# script(s) on the speaker GameObject.

Alternatively, you can run a sequencer command, Lua function (in the Script field) or a scene UnityEvent in the next node.

Otherwise, if you want to know when sequences are done in conversations:
  • Tick the Dialogue Manager's Display Settings > Subtitle Settings > Inform Sequence Start And End.
  • Add an OnSequenceEnd(Transform) method to your Dialogue Manager.
Saper
Posts: 52
Joined: Tue Jan 12, 2021 11:25 am

Re: How to check if Conversation Node Sequencer ended

Post by Saper »

Hi Tony

If i understand I need to edit Class DialogueManager and add to it method OnSequenceEnd(Transform), yes?
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to check if Conversation Node Sequencer ended

Post by Tony Li »

No - there's never a need to directly modify any Dialogue System scripts.

Make your own script, add it to the Dialogue Manager GameObject, and put the OnSequenceEnd method in your script.
Saper
Posts: 52
Joined: Tue Jan 12, 2021 11:25 am

Re: How to check if Conversation Node Sequencer ended

Post by Saper »

Hi Tony

In new script I created method OnSequenceEnd(Transform), and this method is Invoke two times:
- before dialoge window is visible
- and few seconds after

It looks like this method is invoke at the Start and at the end of sequence.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to check if Conversation Node Sequencer ended

Post by Tony Li »

The first time may be from the <START> node.
Post Reply