Page 1 of 1

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

Posted: Sun Jan 21, 2024 3:00 pm
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?

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

Posted: Sun Jan 21, 2024 3:15 pm
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);