Hide/suspend dialogue box

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Hide/suspend dialogue box

Post by mgregoirelds »

Hello Tony,

Is there any way to delay time before an subtitle line is displayed? My use case is as follow:

- A dialogue box is shown.
- I press A to continue.
- My player is moving to another position (the dialogue box should be hidden and not displayed).
- The dialogue box is shown after the character arrives at the new position.

Thanks!
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hide/suspend dialogue box

Post by Tony Li »

Hi Maxime,

Yes. One way is to use three dialogue entry nodes. For example:
  • Dialogue Text: "After you press A to continue, enter the elevator."
  • Dialogue Text: (blank)
    Sequence:

    Code: Select all

    Continue()@Message(EnteredElevator)
  • Dialogue Text: "Good job. Now wait while the elevator takes you to the penthouse."
This makes a few assumptions:

1. That your game will call the following C# code (or visual scripting equivalent) when the player moves to the other position:

Code: Select all

Sequencer.Message("EnteredElevator");
2. That your player has free movement during this conversation. If you disable the player's controls at the beginning of this conversation, you'll have to re-enable them during the second dialogue entry node.

3. That you're only concerned with not showing the NPC Subtitle Panel. If you need to hide the entire dialogue UI, use the SetActive() sequencer command:
  • Dialogue Text: "After you press A to continue, enter the elevator."
  • Dialogue Text: (blank)
    Sequence:

    Code: Select all

    SetActive(Dialogue Panel,false); 
    SetActive(Dialogue Panel)@Message(EnteredElevator); 
    Continue()@Message(EnteredElevator)
  • Dialogue Text: "Good job. Now wait while the elevator takes you to the penthouse."
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: Hide/suspend dialogue box

Post by mgregoirelds »

Hello Tony,

Thanks, this solution should do it. I will try to implement this feature and will let you know if I get into problematic issues.
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: Hide/suspend dialogue box

Post by mgregoirelds »

Hello Tony,

Sorry for reviving my own pretty old thread, but is there a way to hide the Dialogue UI panel during a few seconds then reenable it using code? During a dialogue entry, I want to run some custom animations while not showing the dialogue panel then once this animation is done, I want to display it again. I want to do it using C# code, not sequencer.

I tried casting DialogueManager.dialogueUI as StandardDialogueUI then using dialogueControls.SetActive(false) and it works, but when I am calling dialogueControls.SetActive(true) later, the dialogue panel is empty and I can't continue my dialogue.
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hide/suspend dialogue box

Post by Tony Li »

Hi Maxime,

Since this thread, I added the SetDialoguePanel() sequencer command. Example:

Code: Select all

SetDialoguePanel(false);
AnimatorPlayWait(Dance)->Message(Done);
SetDialoguePanel(true)@Message(Done)
It's only implemented as a sequencer command. I can look into adding it as a C# method, too, in the next update.
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: Hide/suspend dialogue box

Post by mgregoirelds »

That would be very helpful as during the same dialogue sequence, they may be some places where I need to hide the Dialogue UI and display it back again at a later dialogue entry.
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: Hide/suspend dialogue box

Post by mgregoirelds »

Thanks a lot by the way. ;)
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: Hide/suspend dialogue box

Post by mgregoirelds »

Any ETA for the new version? We are nearing the shipping date for our title and this SetDialoguePanel method from the code could prove really useful! I could expose HandleSetDialoguePanelInternally from within my current version of DS, but if you had a proper patch, that could be useful for better upgrade later instead of relying on custom code on my side.
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hide/suspend dialogue box

Post by Tony Li »

It should be out by the end of next week.
Post Reply