Need help with timeline and sequence

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Need help with timeline and sequence

Post by Esylin »

Hi, I am trying to play timeline animation during conversations, but I have difficulty making it work the way I wanted. Here is what I wanted to accomplish in steps:

1) 2 characters are having a conversation. At this point the player can not control the character using IsConversationActive bool check.
2)The dialogue UI is turned off before timeline animation plays.
3) Timeline animation plays. The player can not interrupt the Timeline cutscene until it is done.
4) After the Timeline animation is done, the dialogue UI turns back on if there more dialogue text. The player may or may not be transferred to a different scene depending on the conversation.
5) The player regains control for the player after the conversation ends.

What is the correct sequencer command for this? So far this is what I tried:

I use SetActive(UI name,false); for 2) to turn off the dialogue UI.
I use Timeline(play,Timeline_Name,); for 3).
Then I use SetActive(UI name,true); for 4) to turn on the dialogue UI again.

But this has many problems....
Even though the UI is supposed to turn off, the continue button is not turned off like this, even though the continue button is under the UI menu. Therefore, during the timeline animation, the player can interrupt timeline animation by clicking on the continue button to continue the conversation.

If I add @message(Done); at the end of SetActive(UI name,true), the continue button can be turned off successfully. However the conversation does not end after the animation, therefore the player can not regain control for the character at step 5).

If the timeline cutscene transfers the player to the next scene, then the dialogue UI remains off in the next scene with or without @message(Done). If I start a dialogue in the next scene the game freezes without dialogue UI.

What is the correct way to do this with sequencer command? Any help is appreciated! :)
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Need help with timeline and sequence

Post by Tony Li »

Hi,

Try a sequence such as:

Code: Select all

SetContinueMode(false);
SetDialoguePanel(false);
Timeline(play, Your-Timeline)->Message(Done);
required SetDialoguePanel(true)@Message(Done);
required SetContinueMode(true)@Message(Done);
Continue()@Message(Done)
  • The first line disables the continue button.
  • The second line hides the dialogue UI.
  • The third line plays the timeline and waits for it to finish. Then it sends the sequencer message "Done".
  • The fourth line waits for the "Done" message and shows the dialogue UI again.
  • The fifth line waits for the "Done" message and enables the continue button.
  • The last line simulates a continue button click.
(Side note: You could shorten this to a single sequencer shortcut if you want.)
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Re: Need help with timeline and sequence

Post by Esylin »

Tony Li wrote: Sat Nov 25, 2023 3:03 pm Hi,

Try a sequence such as:

Code: Select all

SetContinueMode(false);
SetDialoguePanel(false);
Timeline(play, Your-Timeline)->Message(Done);
required SetDialoguePanel(true)@Message(Done);
required SetContinueMode(true)@Message(Done);
Continue()@Message(Done)
I tried this sequence, but it has a weird behaviour :cry:

If the node with this sequence has text, something like this:
1.png
1.png (41.99 KiB) Viewed 12818 times
Then this text will not be displayed before nor after the Timeline animation. Instead, the UI will briefly open for a second or less, then quickly closes itself. Which looks weird.

In situation like this, the continue button does not display even without SetContinueMode(false);

If the node has no text, like this:
2.png
2.png (35.45 KiB) Viewed 12818 times
Then the continue button will appear in the cutscene again, even with SetContinueMode(false);.

What can I do to fix this? :(
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Need help with timeline and sequence

Post by Tony Li »

Hi,

Are you using the current version of the Dialogue System? If not, please back up your project and then update to the current version.

I recommend either putting this Sequence in a node without text, or change the sequence so it starts the Timeline() command after a delay, such as this which delays 2 seconds before playing the timeline:

Code: Select all

SetContinueMode(false);
SetDialoguePanel(false);
Timeline(play, Your-Timeline)@2->Message(Done);
required SetDialoguePanel(true)@Message(Done);
required SetContinueMode(true)@Message(Done);
Continue()@Message(Done)
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Re: Need help with timeline and sequence

Post by Esylin »

Tony Li wrote: Sat Nov 25, 2023 3:47 pm Hi,

Are you using the current version of the Dialogue System? If not, please back up your project and then update to the current version.

I recommend either putting this Sequence in a node without text, or change the sequence so it starts the Timeline() command after a delay, such as this which delays 2 seconds before playing the timeline:
Hi, I updated Dialogue System to the latest version, but the same problem continue to exist using the 2 second delay code.

I found an alternative solution that could work, which is to execute a scene event that activates a playmaker action that will play the timeline animation, hide the dialogue UI, disable the continue button by spawning a transparent UI on top of all the UI, then I use Continue()@8(length depends on the timeline animation) for the empty dialogue node.

But this solution is more convoluted than I wish it is, so I would rather not use it if possible. :cry:
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Need help with timeline and sequence

Post by Tony Li »

Hi,

You shouldn't have to use a scene event and PlayMaker. That's way too convoluted. Here's an example scene:

DS_Esylin_Timeline_Example_2023-12-01.unitypackage

Can you play it and tell me how your setup should work differently?
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Re: Need help with timeline and sequence

Post by Esylin »

Hi Tony, thank you for your help. After I investigate it further and comparing it with clean files, I think I know where the problem is.

In a brand new project using default UI panel(Basic Standard Dialogue UI), the following command works perfect:

Code: Select all

HidePanel(0);
Timeline(play,Timeline)->Message(Done);
Continue()@Message(Done)
SetContinueMode(false); is not required, and HidePanel(0) works better than SetDialoguePanel(false).

But in my project file, HidePanel(0) does not work correctly because I edited the dialogue UI and changed continue button + UI background hierarchy . It looks like HidePanel(0) only turned off the subtitles, not the entire dialogue panel. Hence all the problem that comes with my dialogue UI since some of my UI elements don't belong to subtitle panel.

I may try to re-edit my UI panel by making it closer to Basic Standard Dialogue UI and see if I can make HidePanel(0) works instead.

Thank you.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Need help with timeline and sequence

Post by Tony Li »

Hi,

If you use SetDialoguePanel(false), it should hide the Dialogue Panel and all of its children.
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Re: Need help with timeline and sequence

Post by Esylin »

Tony Li wrote: Mon Dec 04, 2023 8:32 am Hi,

If you use SetDialoguePanel(false), it should hide the Dialogue Panel and all of its children.
Thanks for the info. My continue button was not a child of Dialogue Panel, that's why SetDialoguePanel(false) wasn't working correctly. :roll: I will need to find time to rework the dialogue UI entirely because I think I changed it too much, which made many sequencer commands not working correctly. I'll see if those problems got fixed after I fix my UI.

Thank you. :D
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Need help with timeline and sequence

Post by Tony Li »

Sounds good. Glad to help! If any questions come up about adjusting your UI, let me know how I can help.
Post Reply