OnConversationLine not being called when expected

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
xavibell
Posts: 10
Joined: Mon Jul 31, 2023 8:00 pm

OnConversationLine not being called when expected

Post by xavibell »

Hi,

Tiny issue I've run into (that is driving me crazy). The OnConversationLine() event, to my understanding, should run every line. Problem is, it isn't being called when either the subtitle's Actor or Conversant fields aren't set to the player.

This isn't ideal, since the project I'm working on has a lot of characters talking to one another and not the player. I could fix it by just setting the Conversant field to Player for every single entry, but that's no fun.

I don't recall having this issue until very recently, so I feel like I might've changed a setting somewhere by mistake.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationLine not being called when expected

Post by Tony Li »

Hi,

OnConversationLine() is only called on the Dialogue Manager and the active conversation's two primary participants.

To check which GameObjects are being used as the primary participants, please see Character GameObject Assignments and also the logging & debugging video tutorial which will show you how to see which GameObjects are being selected at runtime to be the primary participants.
User avatar
xavibell
Posts: 10
Joined: Mon Jul 31, 2023 8:00 pm

Re: OnConversationLine not being called when expected

Post by xavibell »

That makes sense, but my problem remains, since I've got conversations with far more than two primary participants.

Is there a way to manually update the primary actors and listeners at runtime? Or is there just another way I should be doing this altogether? For context, the reason this is a problem at all is because I'm changing the dialogue text (colours based on who's speaking, graying older entries etc.) using OnConversationLine, so when neither of the primary conversation participants are the actor or conversant, everything breaks spectacularly.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationLine not being called when expected

Post by Tony Li »

Hi,

You can put your OnConversationLine(Subtitle) method on the Dialogue Manager and access subtitle.speakerInfo. That's what the example in How To: Color Actor Name and Indent Text does.
Post Reply