Page 1 of 1

Set Sequence without typing

Posted: Tue Aug 23, 2022 9:11 am
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? :(

Re: Set Sequence without typing

Posted: Tue Aug 23, 2022 10:52 am
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.

Re: Set Sequence without typing

Posted: Tue Aug 23, 2022 9:35 pm
by robster21
Wow, It works! Thank you so much, Tony! :D :D

Re: Set Sequence without typing

Posted: Tue Aug 23, 2022 10:22 pm
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?

Re: Set Sequence without typing

Posted: Wed Aug 24, 2022 8:09 am
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;