Continue conversation after delay

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Continue conversation after delay

Post by urrmurrmur »

Hi,

I'm looking for some advice on how best to implement a specific functionality. I have a conversation like the one below:
DSFU_delay.png
DSFU_delay.png (12.71 KiB) Viewed 223 times
The idea is that an NPC says something, then there's a delay (4 seconds in this case), and then another NPC speaks. Two things should happen during the 4 seconds of waiting:
  • There should be no subtitles, so the DSFU GUI should disappear
  • It should not be possible to click the continue button to skip the 4 second wait
I assume solving the first problem will automatically solve the second one, since if there's no UI, it's not possible to click continue. However, at the moment the dialogue text for the first entry ("Delay test") keeps being displayed during the 4 second waiting period.

The script on the pink dialogue state is currently

Code: Select all

Continue()@4;
Which works in the sense that it does indeed continue to the next state after 4 seconds. But as stated above, the subtitles for the previous state are still visible, so it is also possible to click continue to skip the wait altogether.

I have some workarounds to fall back on (I could just split this into two conversations and trigger the second one from a script after 4 seconds), but ideally I'd like to be able to solve this directly in DSFU, and I'm assuming this should be possible but I'm overlooking some config or script option.
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Continue conversation after delay

Post by Tony Li »

Hi,

Set that middle node's Sequence to:

Code: Select all

SetDialoguePanel(false);
required SetDialoguePanel(true)@4;
Continue()@4
Alternatively, if you don't want to play the dialogue UI's hide and show animations, and possibly also clear text if subtitle panels' Clear Text On *** checkboxes are ticked, you can give your dialogue UI's canvas a unique name such as "DialogueCanvas" and use this Sequence:

Code: Select all

SetEnabled(Canvas, false, DialogueCanvas);
SetContinueMode(false);
required SetContinueMode(true)@4;
required SetEnabled(Canvas, true, DialogueCanvas)@4;
Continue()@4
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Re: Continue conversation after delay

Post by urrmurrmur »

Thanks Tony, very helpful as usual!
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Continue conversation after delay

Post by Tony Li »

Glad to help!
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Re: Continue conversation after delay

Post by urrmurrmur »

I'm necroing one of my old threads here, because I have a related question.

I want to do something very similar to the first post in this thread: state A with text, state B without text that should hide the UI, state C with text again). Except this time the dialog is controlled by a timeline. I tried to use

Code: Select all

SetDialoguePanel(false/true);
as the sequence in each state to hide or show the UI, but it doesn't seem to play nice with the Continue Conversation track in my timeline. The combination of both seems to skip the dialog forward for some reason, and doesn't hide the UI.

Is there an approach that can be combined with a Continue Conversation track?
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Continue conversation after delay

Post by Tony Li »

Hi,

Does your conversation wait for continue? Make sure the conversation's Override Display Settings > Subtitle Settings > Continue Button dropdown isn't set to a non-continue mode.
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Re: Continue conversation after delay

Post by urrmurrmur »

It's set to "Never", which feels like the only option that makes sense. I don't want a continue button to be shown, since the flow of the conversation is fully controlled by the timeline. If I select anything else players can click continue and then the timeline and subtitles are no longer synchronized.
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Continue conversation after delay

Post by Tony Li »

If you're using Continue Conversation clips in timeline, the conversation's Continue Button mode should be set to Always. The dialogue UI you use for this conversation doesn't need to have an actual continue button. The Continue Conversation clip will act as if the player clicked a continue button.
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Re: Continue conversation after delay

Post by urrmurrmur »

To clarify: are you saying that I should use a different dialogue UI for any conversation that plays in a timeline, specifically one that doesn't have a continue button? Because I'm not sure how I would go about doing that.

Right now I have a single dialogue manager in my scene, which has my default UI (with continue button) linked to it. This is necessary since the scene also contains player-controlled conversations where the continue button is required. But there are also several timelines in the scene, where I have recorded voice lines and will eventually have mocapped animations - so these are cutscenes, essentially - where I don't want the continue button as that allows the user to forward the subtitles without forwarding the cutscene.

Up until now I've always done this by overriding the display settings for these cutscene conversations to have the continue button set to "Never". This is very simple and works almost perfectly. The only issue with it is dialogue states without text, where the previous subtitles keep showing.

If I interpret your response correctly, this is not the correct approach? What I should be doing instead is:
  • Create a separate dialogue UI, without a continue button;
  • "Override the UI" for cutscene conversations, so to speak, so they use this separate UI instead of the default one set in my dialogue manager;
  • No override display settings needed for my cutscene conversations.
And then I leave my single Dialogue Manager with its standard UI in the scene, and my regular (=non-cutscene) conversations will keep working as normal.

If this is indeed the correct interpretation, I'm not sure how to assign a different UI to my cutscene conversations. I'm also curious as to why this approach is preferable to just setting the continue button to always, which does what I want 99% of the time and seems simpler. Why does this not work with empty states? What is the use case for setting a continue button to "never" then?


(Rereading the above, the tone of my response feels a bit snarky to me, I can't seem to manage to phrase it in a way that it doesn't. It certainly isn't my intention, I'm genuinely just trying to be clear in what I mean and understand the correct approach - and the reasons for the design decision, to a lesser extent.)
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Continue conversation after delay

Post by Tony Li »

Hi,

When the continue button mode is set to Never, each dialogue entry will automatically advance as soon as its Sequence has finished.

It sounds like you do not want this behavior for your regular conversations. In your regular conversations, you want to wait for the player to advance the conversation by clicking the continue button. In this case, keep the Dialogue Manager's Continue Button mode to set Always.

For your timeline conversations, you don't need to override settings. Instead, make a version of your dialogue UI that doesn't have a continue button UI element. Assign this to the Start Conversation clip's Override Dialogue UI field. (If your Start Conversation clip doesn't have an Override Dialogue UI field, back up your project and update, or at least import the two "Options" folder that are within the Plugins/Pixel Crushers/Dialogue System/Scripts folder hierarchy.)

If you don't want to use a separate dialogue UI, you could add a Canvas Group component to your continue button. Set its Alpha to zero, and disable the component. Make sure the continue button GameObject has a unique name, such as "Continue Button". Then in your timeline conversation use this sequence to make the continue button invisible in the first dialogue entry:

Code: Select all

SetEnabled(CanvasGroup, false, Continue Button)
and this sequence in the last entry:

Code: Select all

SetEnabled(CanvasGroup, true, Continue Button)
Post Reply