Get linked conversation name onLinkedConversationStart

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
BitorVarbosa
Posts: 6
Joined: Fri Aug 04, 2023 11:20 am

Get linked conversation name onLinkedConversationStart

Post by BitorVarbosa »

Hi there!
I just realized the existence of "onLinkedConversationStart" on the DialogueSystemEvents, but after triggering it, the variable DialogueManager.lastConversationStarted still returns the original conversation name, before the linked one.

> Is there any way I can get the LinkedConversation name when listening to onLinkedConversationStart?
That's my only question.
"A linked conversation started." Which one?

Just some context of my use case:
That would help with a custom questing system we have for our necessities. Each quest that can be completed in the current scene has an object in the scene with components to advance the quest, that way is easier to search where progression happens, and I have a script that advances a quest after a certain conversation has been completed, but when the conversation only triggers through a linked conversation, then I can't detect it.

Thanks in advance!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Get linked conversation name onLinkedConversationStart

Post by Tony Li »

Hi,

Code: Select all

void OnLinkedConversationStart(Transform actor)
{
    int linkedConversationID = DialogueManager.currentConversationState.subtitle.dialogueEntry.conversationID;
    string title = DialogueManager.masterDatabase.GetConversation(linkedConversationID).Title;
    Debug.Log($"Changed to linked conversation {linkedConversationID}: '{title}'");
}
BitorVarbosa
Posts: 6
Joined: Fri Aug 04, 2023 11:20 am

Re: Get linked conversation name onLinkedConversationStart

Post by BitorVarbosa »

Tony Li wrote: Thu Jul 25, 2024 12:19 pm Hi,

Code: Select all

void OnLinkedConversationStart(Transform actor)
{
    int linkedConversationID = DialogueManager.currentConversationState.subtitle.dialogueEntry.conversationID;
    string title = DialogueManager.masterDatabase.GetConversation(linkedConversationID).Title;
    Debug.Log($"Changed to linked conversation {linkedConversationID}: '{title}'");
}
It worked!
Thank you very much.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Get linked conversation name onLinkedConversationStart

Post by Tony Li »

Glad to help!
Post Reply