Triggering Script/Sequence When Conversation Terminates

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
FiveAlive
Posts: 1
Joined: Sun Sep 15, 2024 8:45 pm

Triggering Script/Sequence When Conversation Terminates

Post by FiveAlive »

Hi, newbie question here.

I'm wondering if there's a way to trigger a sequence or script, such as a character animation, directly after a conversation terminates, as in, when the final conversation node is over and no longer displayed onscreen, NOT as soon as the final node occurs.

For my specific cutscene, I want a character to walk forward AFTER the final node has been ended. I can get them to walk as soon as it occurs, but that's a problem, as I need them to stay on screen as long as the dialogue is on screen, otherwise they do as they do now and run off screen while the last dialogue node is still typing itself out.

I want to have this happen multiple times, and call multiple different animations/transforms upon the termination of conversations, so I'm wondering if there's a way to do this without making a brand new Dialogue System Trigger for the end of every single conversation where I want something to happen, as its something I'm going to be doing a lot and in a unique way each time.

I feel there must be a sequence and/or script command that can call things and exist after the end of the conversation in a similar way 'required Animation' can, but waits until the UI itself has closed. I can't find anything in the forums or documentation.

I'll mention that I progress my dialogue using the 'return' button, so conversation's are always ended by pressing return, just in case that's relevant to triggering a sequence/script when the conversation terminates.

Thank you for your help!
User avatar
Tony Li
Posts: 22001
Joined: Thu Jul 18, 2013 1:27 pm

Re: Triggering Script/Sequence When Conversation Terminates

Post by Tony Li »

Hi,

Add a dialogue entry at the end of your conversation. Leave the Dialogue Text field blank. In the Sequence field, include this command:

Code: Select all

SetDialoguePanel(false);
plus any other sequencer commands you want to use, such as (for example):

Code: Select all

SetDialoguePanel(false);
AnimatorPlay(Walk);
MoveTo(Door);
AnimatorPlay(Idle)@2;
Fade(stay)@2;
Post Reply