Conversation added at runtime not found in database
Posted: Mon Jun 13, 2016 5:35 am
I've been trying to get a system working to add conversations at runtime to the DialogueDatabase.
This has been working for a while but I found a bug last week in my code that made the Lua variables in the Database reset to their original state (which I don't want). At that time, before I fixed that, I had this code:
This piece of code added the custom conversation to the database and this worked well, except for the Lua reset. Fixing the lua problem requried me to remove the ResetDatabase() line. I assumed that DatabaseResetOptions.KeelAllLoaded would keep that Lua data loaded as well, but apparently it doesn't.
So, at this time the Lua data stays the same when I add a custom conversation and the conversation shows up in the editor window when I look at that while playing the game, but when I try to talk to an NPC with this specific dialogue I get a warning
This has been working for a while but I found a bug last week in my code that made the Lua variables in the Database reset to their original state (which I don't want). At that time, before I fixed that, I had this code:
Code: Select all
public static void FinishEditingConversation(ref Conversation conversation) {
PersistentDataManager.Record();
DialogueManager.DatabaseManager.DefaultDatabase.conversations.Add(conversation);
DialogueManager.Instance.ResetDatabase(DatabaseResetOptions.KeepAllLoaded);
PersistentDataManager.Apply();
}
So, at this time the Lua data stays the same when I add a custom conversation and the conversation shows up in the editor window when I look at that while playing the game, but when I try to talk to an NPC with this specific dialogue I get a warning
What can I do to make this work? I'm not sure how I have to add the conversation without the Lua variables resetting.Conversation "custom_conversation_name" not found in database