Ok! I figured that I should register the conversation variable myself, so I rewrote my OpenConversation() method:
Code: Select all
void OpenConversation(string conversationName, double playerIndex, double conversantIndex, double ui)
{
int player = (int)playerIndex;
int conversant = (int)conversantIndex;
int uiIndex = (int) ui;
if(DialogueManager.ConversationHasValidEntry(conversationName))
{
DialogueLua.SetVariable("Conversation", conversationName);
textlineDialogueUIs[uiIndex].GetComponent<TextlineDialogueUI>().OnApplyPersistentData();
DialogueManager.StartConversation(conversationName, Characters.charactersTransforms[player], Characters.charactersTransforms[conversant]);
}
}
So when I call SaveConversation():
Code: Select all
void SaveConversation(string conversationTitle, double ui)
{
int uiIndex = (int) ui;
textlineDialogueUIs[uiIndex].GetComponent<TextlineDialogueUI>().OnRecordPersistentData();
DialogueManager.StopConversation();
Debug.Log(DialogueLua.GetVariable("DialogueEntryRecords_" + conversationTitle).asString);
}
I now get a series of numbers. I still have one issue. For exemple, in one of my conversation, I call SaveConversation() on the DialogueEntry 24, but my DialogueEntryRecords ends with 3;23 and not 3;24. So, when I reopen the conversation, it replays the node 24, calls SaveConversation() and thus closes the conversation immediately.