Page 1 of 1

The given key was not present in the dictionary

Posted: Tue Jul 16, 2019 2:47 pm
by Timeslip
Hi Tony,

Have been working on setting up saving and loading and am mostly there, but having a couple of problems with dialogue system post loading.

In this case, in scene A a conversation starts and a quest is set active. The game is then saved, and the scene switches to scene B. Everything works fine until the game stopped, saved and loaded. When that happens, entering a dialogue trigger collider causes an error. Here's the error information:

Code: Select all

KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[Language.Lua.LuaValue,Language.Lua.LuaValue].get_Item (Language.Lua.LuaValue key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
Language.Lua.LuaTable.GetValue (Int32 index) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/LuaValue/LuaTable.cs:273)
PixelCrushers.DialogueSystem.DialogueLua.GetSimStatusTable (Int32 conversationID, Int32 entryID) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/DB/DialogueLua.cs:169)
PixelCrushers.DialogueSystem.DialogueLua.MarkDialogueEntry (PixelCrushers.DialogueSystem.DialogueEntry dialogueEntry, System.String status) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/DB/DialogueLua.cs:240)
PixelCrushers.DialogueSystem.DialogueLua.MarkDialogueEntryDisplayed (PixelCrushers.DialogueSystem.DialogueEntry dialogueEntry) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/DB/DialogueLua.cs:204)
PixelCrushers.DialogueSystem.ConversationModel.GetState (PixelCrushers.DialogueSystem.DialogueEntry entry, Boolean includeLinks, Boolean stopAtFirstValid, Boolean skipExecution) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:228)
PixelCrushers.DialogueSystem.ConversationModel..ctor (PixelCrushers.DialogueSystem.DialogueDatabase database, System.String title, UnityEngine.Transform actor, UnityEngine.Transform conversant, Boolean allowLuaExceptions, PixelCrushers.DialogueSystem.IsDialogueEntryValidDelegate isDialogueEntryValid, Int32 initialDialogueEntryID, Boolean stopAtFirstValid, Boolean skipExecution) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:127)
PixelCrushers.DialogueSystem.DialogueSystemController.ConversationHasValidEntry (System.String title, UnityEngine.Transform actor, UnityEngine.Transform conversant) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueSystemController.cs:582)
PixelCrushers.DialogueSystem.DialogueManager.ConversationHasValidEntry (System.String title, UnityEngine.Transform actor, UnityEngine.Transform conversant) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueManager.cs:328)
PixelCrushers.DialogueSystem.DialogueSystemTrigger.DoConversationAction (UnityEngine.Transform actor) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:821)
PixelCrushers.DialogueSystem.DialogueSystemTrigger.Fire (UnityEngine.Transform actor) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:611)
PixelCrushers.DialogueSystem.DialogueSystemTrigger.TryStart (UnityEngine.Transform actor, UnityEngine.Transform interactor) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:593)
PixelCrushers.DialogueSystem.DialogueSystemTrigger.TryStart (UnityEngine.Transform actor) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:579)
PixelCrushers.DialogueSystem.DialogueSystemTrigger.OnTriggerEnter (UnityEngine.Collider other) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:475)
There's just one Dialogue Manager in the scene. Any ideas what might be happening here?

Re: The given key was not present in the dictionary

Posted: Tue Jul 16, 2019 7:03 pm
by Tony Li
Hi,

What version of the Dialogue System are you using? (You can check Plugins / Pixel Crushers / Dialogue System / _README.txt or menu item Tools > Pixel Crushers > Dialogue System > Welcome Window.)

Re: The given key was not present in the dictionary

Posted: Wed Jul 17, 2019 5:21 am
by Timeslip
Hi, currently using 2.1.4, though you have sent on a couple of replacement classes for additional functionality.

Re: The given key was not present in the dictionary

Posted: Wed Jul 17, 2019 8:45 am
by Tony Li
Hi,

Please update to the latest version. This was fixed after version 2.1.4.

Re: The given key was not present in the dictionary

Posted: Thu Jul 18, 2019 5:58 am
by Timeslip
Thanks Tony, that worked.