How to wait until the dialogue box disappears before running lua script?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
robloxillian
Posts: 27
Joined: Mon Sep 13, 2021 6:55 pm

How to wait until the dialogue box disappears before running lua script?

Post by robloxillian »

Hi, I'm working on a cutscene in my game. The dialogue tree currently looks like this:

Image

I'm running into a problem where the dialogue boxes (in both of the second nodes with dialogue text) stay visible during the lua script in the "END" nodes, which looks like this:

Code: Select all

Fade(stay, 1)@0.5->Message(Faded); 
SendMessage(NewDay,,CutsceneManager)@Message(Faded);
Fade(in,1)@Message(Faded)->Message(FadedIn);
SendMessage(NewDayFinish,,CutsceneManager)@Message(FadedIn);
I have tried the following:

- Combining the two end nodes into one and having both dialogue nodes connected to them
- Separating the dialogue nodes from the end nodes with empty nodes
- Swapping the conversant direction for various nodes
- Making the start of the script happen at OnMessage(Typed) (this almost works-- the scripts are played after the dialogue box finished typing text, but before it disappears)

What is the correct way to make sure the dialogue disappears, then all of the Lua scripts happen?
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to wait until the dialogue box disappears before running lua script?

Post by Tony Li »

Hi,

> What is the correct way to make sure the dialogue disappears, then all of the Lua scripts happen?

It looks like you're using only sequencer commands (i.e., in the Sequence field), not Lua (in the Script field). Since it's in the END node, you can use SetDialoguePanel(false):

Code: Select all

SetDialoguePanel(false);
Fade(stay, 1)@0.5->Message(Faded); 
SendMessage(NewDay,,CutsceneManager)@Message(Faded);
Fade(in,1)@Message(Faded)->Message(FadedIn);
SendMessage(NewDayFinish,,CutsceneManager)@Message(FadedIn);
Post Reply