Behavior changes with BroadcastMessage ?

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

Behavior changes with BroadcastMessage ?

Post by mgregoirelds »

Hello Tony,

Did something change in the latest version of Dialogue System about

Code: Select all

DialogueManager.instance.BroadcastMessage("OnConversationContinueAll", SendMessageOptions.DontRequireReceiver)
?

I was using this to skip automatically to the next dialogue entry in my conversation (custom sequencer command) but it stopped working. I now need to press the ESC key to skip forward.
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: Behavior changes with BroadcastMessage ?

Post by mgregoirelds »

Hello,

I just tested again: the sequencer is working great with Dialogue System 2.0.3. The next code submit I did after was to upgrade to Dialogue System 2.0.4 and newest Rewired. The same sequencer command stopped working at this point.
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: Behavior changes with BroadcastMessage ?

Post by Tony Li »

Hi Maxime,

Yes, there was a change.

Import the Rewired Support package from Plugins / Pixel Crushers / Common / Third Party Support. Then add the InputDeviceManagerRewired script to the Dialogue Manager.

In version 2.0.3 and earlier, the Dialogue System did not use the Input Device Manager to determine if the cancel key was pressed. In version 2.0.4, it uses the Input Device Manager. So now everything consistently uses the Input Device Manager. If you're using Rewired, you need to add InputDeviceManagerRewired to tell the Input Device Manager to use Rewired instead of Unity Input.

I'll double check that this would cause a problem with your BroadcastMessage.

BTW, can you just use the Continue() sequencer command instead of your custom command?
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: Behavior changes with BroadcastMessage ?

Post by mgregoirelds »

Hello,

Can you confirm to me that I can remove the InputDeviceManager component if I add the InputDeviceManagerRewired component to Dialogue Manager?

I can't use Continue() as my custom sequencer command is quite complex and lots of thing is happening internally (ProCamera2D targetting and effects, custom audio handler playing sounds...). Just to make sure: calling the BroadcastMessage as I wrote in the first post is actually how Continue() work, right? If not, what would be the best way of doing it?
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: Behavior changes with BroadcastMessage ?

Post by Tony Li »

mgregoirelds wrote: Mon Sep 03, 2018 12:59 pmCan you confirm to me that I can remove the InputDeviceManager component if I add the InputDeviceManagerRewired component to Dialogue Manager?
Keep both. InputDeviceManagerRewired is a tiny script that sits on top of InputDeviceManager. It tells InputDeviceManager to read Rewired instead of Unity Input.
mgregoirelds wrote: Mon Sep 03, 2018 12:59 pmI can't use Continue() as my custom sequencer command is quite complex and lots of thing is happening internally (ProCamera2D targetting and effects, custom audio handler playing sounds...). Just to make sure: calling the BroadcastMessage as I wrote in the first post is actually how Continue() work, right? If not, what would be the best way of doing it?
Calling BroadcastMessage like that is exactly how the Continue() command does it. Alternatively, you can call:

Code: Select all

DialogueManager.conversationView.OnConversationContinueAll();
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: Behavior changes with BroadcastMessage ?

Post by mgregoirelds »

Thanks for the answer!

Just for fun, I tested using

Code: Select all

DialogueManager.conversationView.OnConversationContinueAll();
and I'm still having the same issue.
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: Behavior changes with BroadcastMessage ?

Post by Tony Li »

Are you sure that your sequencer command is getting to that line of code?

If that line of code is being run, does the actual continue button work correctly? The continue button calls the dialogue UI's OnContinue() method. To gather more information, you could try to do the same in your sequencer command:

Code: Select all

(DialogueManager.dialogueUI as AbstractDialogueUI).OnContinue();
Are there any errors or warnings in the Console window / output log?

I'm reviewing the release notes, and nothing has changed with OnConversationContinueAll(). I don't know if any of these are relevant to your situation:
  • Improved: DialogueManager.GetInputButtonDown reads from InputDeviceManager.
  • Fixed: OnConversationResponseMenu was called twice when using continue button.
  • Fixed: DialogueManager methods no longer report error if scene doesn't have a Dialogue Manager instance.
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: Behavior changes with BroadcastMessage ?

Post by mgregoirelds »

Hello Tony,

It looks like the ConversationView::HandleContinueButtonClick() source has changed between 2.0.3 and 2.0.4 ! In fact, I reverted from 2.0.4

Code: Select all

private void HandleContinueButtonClick()
{
    waitForContinue = false;
    if (sequencer.isPlaying)
    {
        sequencer.Stop();
    }
    else
    {
        FinishSubtitle();
    }
}
to 2.0.3 implementation

Code: Select all

private void HandleContinueButtonClick()
{
    waitForContinue = false;
    FinishSubtitle();
}
and it worked! I guess something is broken when FinishSubtitle() is not called. So far, I made the change internally so my dialogue can work properly.
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: Behavior changes with BroadcastMessage ?

Post by Tony Li »

Hmm, that was the change I made for this:
  • Fixed: OnConversationResponseMenu was called twice when using continue button.
When the sequencer stops, it calls FinishSubtitle(). Except in your case it appears that it doesn't call FinishSubtitle(). I'll investigate this and include a fix in version 2.0.5.
Post Reply