Delay after Response Menu submitted

Announcements, support questions, and discussion for the Dialogue System.
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Delay after Response Menu submitted

Post by fkkcloud »

Hi,

Below is my response menu setup.
I am skipping player subtitles UI only after the response menu.
I want to put a delay like 1 second before NPC subtitle shows up.
How would I do that?
화면 캡처 2020-11-24 022705.png
화면 캡처 2020-11-24 022705.png (46.46 KiB) Viewed 826 times
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Delay after Response Menu submitted

Post by Tony Li »

Hi,

Set the Dialogue Manager's Camera & Cutscene Settings > Default Player Sequence to:

Code: Select all

Delay(1)
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Delay after Response Menu submitted

Post by fkkcloud »

With the Delay(1), it works for Response Menu only
But for the single node for the player which I am not forcing it to be response menu, it still goes into NPC subtitle after Player submit.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Delay after Response Menu submitted

Post by Tony Li »

fkkcloud wrote: Tue Nov 24, 2020 6:32 pmBut for the single node for the player which I am not forcing it to be response menu, it still goes into NPC subtitle after Player submit.
I don't understand. What should happen instead?
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Delay after Response Menu submitted

Post by fkkcloud »

So there are 2 things happening for the Player's line.

As you can see in my Dialogue Display Setting,
1) I am not showing subtitle for player when a player has more than 1 dialogue node branch.
2)I am only showing subtitle for player when the player has 1 dialogue node branch.

Delay(1) only works for 1). not for 2)
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Delay after Response Menu submitted

Post by Tony Li »

I just noticed that the Continue Button dropdown is set to Always. Please try this instead:

Code: Select all

Continue()@1
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Delay after Response Menu submitted

Post by fkkcloud »

That will make 2) continue without the player pressing on the Continue button.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Delay after Response Menu submitted

Post by Tony Li »

What do you want (2) to do?
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Delay after Response Menu submitted

Post by fkkcloud »

As I click on the single branched player subtitle (not the respond menu one) for the continue button, I want it to wait 1 or 2 seconds before the NPC subtitle or whatever the next node to be continued.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Delay after Response Menu submitted

Post by Tony Li »

Ah, I understand now! When the dialogue UI receives the OnContinueConversation message, it immediately progresses to the next stage of the conversation (e.g., the NPC subtitle).

To do what you want, configure the continue button to wait 1-2 seconds before calling OnContinueConversation. To do this, add a simple script to the PC subtitle panel's continue button, something like this:

Code: Select all

public class DelayContinueButton : MonoBehaviour
{
    public float delay = 1;
    
    public void ContinueAfterDelay()
    {
        StartCoroutine(ContinueAfterDelayCoroutine());
    }
    
    IEnumerator ContinueAfterDelayCoroutine()
    {
        yield return new WaitForSeconds(delay);
        GetComponentInParent<StandardDialogueUI>().OnContinueConversation();
    }
}
Configure the button's OnClick() event to call DelayContinueButton.ContinueAfterDelay.
Post Reply