Page 1 of 1

Get linked conversation name onLinkedConversationStart

Posted: Thu Jul 25, 2024 10:52 am
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!

Re: Get linked conversation name onLinkedConversationStart

Posted: Thu Jul 25, 2024 12:19 pm
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}'");
}

Re: Get linked conversation name onLinkedConversationStart

Posted: Thu Jul 25, 2024 2:12 pm
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.

Re: Get linked conversation name onLinkedConversationStart

Posted: Thu Jul 25, 2024 3:56 pm
by Tony Li
Glad to help!