Page 2 of 2

Re: Help with Repeatable Conversation and Node Tracking

Posted: Tue Nov 19, 2024 9:29 pm
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);
}

Re: Help with Repeatable Conversation and Node Tracking

Posted: Wed Nov 20, 2024 7:00 am
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.