OnConversationLine (Subtitle) triggered multiple times

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
gourangas
Posts: 10
Joined: Mon May 04, 2020 9:59 am

OnConversationLine (Subtitle) triggered multiple times

Post 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.
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationLine (Subtitle) triggered multiple times

Post 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.
gourangas
Posts: 10
Joined: Mon May 04, 2020 9:59 am

Re: OnConversationLine (Subtitle) triggered multiple times

Post 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?
gourangas
Posts: 10
Joined: Mon May 04, 2020 9:59 am

Re: OnConversationLine (Subtitle) triggered multiple times

Post 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
gourangas
Posts: 10
Joined: Mon May 04, 2020 9:59 am

Re: OnConversationLine (Subtitle) triggered multiple times

Post by gourangas »

Nvm, I think I am handling the active conversation poorly. I will figure it out.
Thanks for the help
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationLine (Subtitle) triggered multiple times

Post 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
Post Reply