Animate/hide panel after continue button pressed

Announcements, support questions, and discussion for the Dialogue System.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Animate/hide panel after continue button pressed

Post by cptscrimshaw »

Hi Tony,

As always, I'm sure there is a stupidly simple way to do this, but after a few hours searching the forum and testing out a bunch of things, I haven't been able to get it.

I have a continue button after each dialogue node, and I'd like to hide the dialogue panel after the user clicks the continue button (and then bring it back up for the next node with animation when the speaker changes). I have nearly all of this working, except I can't figure out how to run SetDialoguePanel(false) when the continue button is pressed in the sequencer. I tried attaching a script to the continue button to send a message (ContinueButtonPressed) to the dialogue system, but it doesn't appear to do anything.

Here's the Default Sequence I'm using:

Code: Select all

AudioWait(entrytag);
Delay({{end}});
SetDialoguePanel(false)@Message(ContinueButtonPressed)->Message(Hid); 
Delay(1)@Message(Hid)->Message(Delayed); 
SetDialoguePanel(true)@Message(Delayed);
I originally had it set up with SetDialoguePanel(false)@{{end}}, but that just brings up the same dialogue node and then I have to press the continue button.

Second question: I have an animation set up for the Dialogue Panel. Whenever I start a conversation it animates correctly, but on subsequent hide/show animations in the same conversation it uses some other animation that I can't figure out where it's coming from. I tried putting an animation on Subtitle Panel Info, but that didn't seem to do anything. Any idea why subsequent nodes are using a different animation?

https://ibb.co/HCyFMJN

TLDR: I'd like the continue button and panel animation to function like it does in Hades and can't figure out how to listen for the continue button being pressed in the sequencer :)
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animate/hide panel after continue button pressed

Post by Tony Li »

To do dialogue like Hades, you don't need to do any of that.
  • Configure the subtitle panel's Show and Hide animations to show and hide the subtitle panel.
  • Set Visibility to Only During Content.
  • Wait For Close
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Animate/hide panel after continue button pressed

Post by cptscrimshaw »

Thanks! This looks really cool.

I'm running into an issue that whenever a response panel is supposed to show up, it doesn't and if I check in the inspector, the main panel gameobject is turned off. I've fiddled with the settings, and it appears that when Visibility is set to Only During Content, it never shows a response panel. I'm using the Runic dialogue template.

Any idea what I'm missing?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animate/hide panel after continue button pressed

Post by Tony Li »

Hi,

That's a bit trickier because the Runic and WRPG UIs combine all of the subtitle panels and response menu panel into a single panel. When the dialogue UI turns off that panel, everything disappears. Can you separate them out into separate panels? The Basic Standard Dialogue UI might be a good start. Here's a quick example:

DS_ScrimshawExample_2021-01-01.unitypackage

It looks like this:

scrimshawExample.png
scrimshawExample.png (90.16 KiB) Viewed 523 times

I started with the Basic Standard Dialogue UI, removed some stuff like the PC Subtitle Panel since it can share with the NPC Subtitle Panel, moved UI elements around, and swapped out the fade animation with a sliding animation.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Animate/hide panel after continue button pressed

Post by cptscrimshaw »

Thanks Tony! As ever, your support goes above and beyond. I had just gone down the path of switching to the basic standard UI when this message came in, so this example works perfectly.

Happy New Year!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animate/hide panel after continue button pressed

Post by Tony Li »

Glad to help! Happy New Year!
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Animate/hide panel after continue button pressed

Post by cptscrimshaw »

One quick follow-up question: What's the best approach for showing the NPC subtitle along with the response menu with this kind of setup?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animate/hide panel after continue button pressed

Post by Tony Li »

How would it look?

If they're in different positions, you could change the subtitle panel's visibility to Until Superceded.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Animate/hide panel after continue button pressed

Post by cptscrimshaw »

Sorry for the lack of detail in my last post :). I have it working about 99% of the way, but I have one last wrinkle to iron out. I recorded a quick video:



Thanks again!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animate/hide panel after continue button pressed

Post by Tony Li »

Hi,

Check the animation(s). Two possibilities come to mind:

1. Are the animations controlling a Canvas Group component to make the panels fade in over time instead of appearing immediately? If so, try removing the Canvas Group component(s).

2. Or it could be the transitions. In the animator controller, try unticking the transition arrows' Has Exit Time checkboxes.
Post Reply