Set Sequence without typing

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
robster21
Posts: 36
Joined: Tue Aug 23, 2022 9:02 am

Set Sequence without typing

Post by robster21 »

At the end of the Conversation, I want to show this Sequence:
Conversation UI disappears slowly, and the Camera returns to the original position.

When I insert this lines into the END Node, I can accomplish.

SetDialoguePanel(false,1);
Camera(original,,1);

But I want to show this Sequence when "every" Conversation ends.
How can I do this without typing these commands into Sequencer every time? :(
User avatar
Tony Li
Posts: 21050
Joined: Thu Jul 18, 2013 1:27 pm

Re: Set Sequence without typing

Post by Tony Li »

Hi,

You could add a script with an OnConversationLine method to the Dialogue Manager:

Code: Select all

public void OnConversationLine(Subtitle subtitle)
{
    if (!DialogueManager.currentConversationState.hasAnyResponses)
    {
        // No response, so conversation will end on this node. 
        // Add our special sequencer commands:
        subtitle.sequence = "SetDialoguePanel(false); Camera(original,,1); " + subtitle.sequence;
    }
}
Note: SetDialoguePanel() doesn't take a duration parameter. The speed that the dialogue UI disappears is dictated by the hide animation.
robster21
Posts: 36
Joined: Tue Aug 23, 2022 9:02 am

Re: Set Sequence without typing

Post by robster21 »

Wow, It works! Thank you so much, Tony! :D :D
robster21
Posts: 36
Joined: Tue Aug 23, 2022 9:02 am

Re: Set Sequence without typing

Post by robster21 »

Sorry, I have an additional question.

The action is currently taken when there is no next "Response(Even if it's an END Node, it runs at the start of the node. So I can't read the END Node's text lines(subtitle))".

I want like this: At the END Node, Player pressing the continue button, Sequence starts.
is there any way?
User avatar
Tony Li
Posts: 21050
Joined: Thu Jul 18, 2013 1:27 pm

Re: Set Sequence without typing

Post by Tony Li »

Hi,

Add an extra node before the [END] node. Set that node's Dialogue Text to something like: "[END]" or "[CLOSE]".

Then change the code that gets applied to the last node to:

Code: Select all

subtitle.sequence = "SetDialoguePanel(false); Camera(original,,1); Continue()@1; " + subtitle.sequence;
Post Reply