Hello, im trying to get the name of the active conversation
Currently I have 2 conversations Untitled, Untitled 2 and my database is setup like
Untitled
links to
Untitled 2
When debugging DialogueManager.lastConversationStarted it always gives Untitled even if i have gone to next conversation.
Please help
DialogueManager.lastConversationStarted not returning active conversation name
Re: DialogueManager.lastConversationStarted not returning active conversation name
Hi,
When an active conversation follows a cross-conversation link, it's still conceptually thought of as the same conversation, so DialogueManager.lastConversationStarted doesn't change.
To record the name of the conversation that you crossed into, add a script with an OnLinkedConversationStart() method, and check DialogueManager.currentConversationState.subtitle.dialogueEntry.conversationID. You'll typically add this script to the Dialogue Manager GameObject. Here's an example method:
When an active conversation follows a cross-conversation link, it's still conceptually thought of as the same conversation, so DialogueManager.lastConversationStarted doesn't change.
To record the name of the conversation that you crossed into, add a script with an OnLinkedConversationStart() method, and check DialogueManager.currentConversationState.subtitle.dialogueEntry.conversationID. You'll typically add this script to the Dialogue Manager GameObject. Here's an example method:
Code: Select all
public void OnLinkedConversationStart(Transform actor)
{
int conversationID = DialogueManager.currentConversationState.subtitle.dialogueEntry.conversationID;
Conversation conversation = DialogueManager.masterDatabase.GetConversation(conversationID);
Debug.Log("Crossed into: " + conversation.Title);
}
Re: DialogueManager.lastConversationStarted not returning active conversation name
Thank you, that works perfectly