Help with Repeatable Conversation and Node Tracking

Announcements, support questions, and discussion for the Dialogue System.
caltaylor101
Posts: 7
Joined: Mon Nov 11, 2024 7:20 pm

Re: Help with Repeatable Conversation and Node Tracking

Post by caltaylor101 »

This is working for me, so this can be closed if you'd like, I'm just trying to resolve my confusion on the workflow, which I'll probably just need to read the docs more closely for.

I think I may have been having a similar issue, or getting confused when using the stack, so I went back to trying this on a monobehaviour:


Code: Select all

private int _lastNodeID;
private string _lastConversationStarted; 


public void SwitchToConversationAction(string conversation)
{
    StartCoroutine(SwitchToConversationActionWork(conversation));
}

public IEnumerator SwitchToConversationActionWork(string conversation)
{
    yield return new WaitForEndOfFrame();

    _lastConversationStarted = DialogueManager.lastConversationStarted;
    _lastNodeID = DialogueManager.currentConversationState.subtitle.dialogueEntry.id;
    DialogueManager.StopConversation();
    DialogueManager.StartConversation(conversation);
}

public void ContinueConversation()
{
    DialogueManager.StopConversation();
    DialogueManager.StartConversation(_lastConversationStarted, null, null, _lastNodeID);
}
User avatar
Tony Li
Posts: 22083
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help with Repeatable Conversation and Node Tracking

Post by Tony Li »

Got it. As a side note, if you don't want to close the dialogue UI and reopen it (StopConversation, StartConversation), you can use GotoEntry() like this example C# code.
Post Reply