Call a Scene Event when the Conversation ends

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Danzer
Posts: 3
Joined: Wed Apr 21, 2021 5:49 am

Call a Scene Event when the Conversation ends

Post by Danzer »

Hi,
I'm trying to call an Event from the Dialogue Entry Menu when a Conversation ends, but there is only the On Execute() event that I can call, and that activates when the line of the conversation starts, and not when the line ends.

Is there a simple way to do that?

I Know there is a "OnConversationEnd" method that I can call in a script, but I don't know how to call it for only specific conversations, and I also want to set the event on the inspector and not in a script.

And for last: can I get the current actor that is speaking when I use the OnConversationLine event? I want to play different background audio based on the speaking actor.
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: Call a Scene Event when the Conversation ends

Post by Tony Li »

Hi,
Danzer wrote: Tue Aug 24, 2021 2:20 pmI'm trying to call an Event from the Dialogue Entry Menu when a Conversation ends, but there is only the On Execute() event that I can call, and that activates when the line of the conversation starts, and not when the line ends.
Use the next node's On Execute() event. You can make that a blank node whose Sequence is: Continue()
Danzer wrote: Tue Aug 24, 2021 2:20 pmAnd for last: can I get the current actor that is speaking when I use the OnConversationLine event? I want to play different background audio based on the speaking actor.
Yes. It's in Subtitle.speakerInfo. Example:

Code: Select all

public void OnConversationLine(Subtitle subtitle)
{
    Debug.Log($"Speaker is actor ID {subtitle.speakerInfo.id}, name is {subtitle.speakerInfo.Name}", subtitle.speakerInfo.transform);
}
Post Reply