Page 1 of 1

OnConversationLine (Subtitle) triggered multiple times

Posted: Mon Jun 26, 2023 9:51 am
by gourangas
Hey Tony,
I am trying to implement my own DialogueUI, implementing the IDialogueUI interface. So far so good, but I don't understand why this event is being fired multiple times.

I have a DialogueSystemEvents script attached to my DialogueUI prefab, there I assigned a callback to the OnConversationLine() event via the unity inspector.
When debugging, that callback is being fired multiple times. Do you have any ideea why this happens? I trigger my subtitle via DialogueManager.instance.StartConversation(), and I am 100% sure that I'm calling that only once.

Any help is appreciated, thanks.

Re: OnConversationLine (Subtitle) triggered multiple times

Posted: Mon Jun 26, 2023 11:28 am
by Tony Li
Hi,

What version of the Dialogue System are you using?

For each line, OnConversationLine() should only be called once on the Dialogue Manager, and once on the conversation actor and conversation conversant.

Re: OnConversationLine (Subtitle) triggered multiple times

Posted: Mon Jun 26, 2023 12:37 pm
by gourangas
Damn.... thx for the tip. Apparently if I have a public method named OnConversationLine(Subtitle) on the script where I am also calling DialogueManager.StartConversation() it is automatically subscribed to the Dialogue System Events.... am I right?

Re: OnConversationLine (Subtitle) triggered multiple times

Posted: Mon Jun 26, 2023 12:40 pm
by gourangas
By the way, I am calling StartConversation() with actor transform as NULL and othe participant transform NULL as well....
Do you have a clean way to handle subtitle events ? And no... I don't want to use the event in the line database inspector :D

Re: OnConversationLine (Subtitle) triggered multiple times

Posted: Mon Jun 26, 2023 12:58 pm
by gourangas
Nvm, I think I am handling the active conversation poorly. I will figure it out.
Thanks for the help

Re: OnConversationLine (Subtitle) triggered multiple times

Posted: Mon Jun 26, 2023 3:28 pm
by Tony Li
Hi,

If you want to discuss handling the active conversation, please feel free to provide more details about what you want to do.

OnConversationLine(Subtitle) is automatically called on scripts on the Dialogue Manager and participants. No need to register them. More info: Script Messages, Character GameObject Assignments