Unique ID Tool Providing Error

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
benschiffler
Posts: 1
Joined: Sat Dec 22, 2018 2:47 am

Unique ID Tool Providing Error

Post by benschiffler »

I'm working with multiple dialogue databases for a current project using Dialogue System for Unity. Up until this point, using the Unique IDs tool has helped us fix inter-database ID collisions, so we've run it after finishing each new dialogue database since not doing so has caused some errors.

However, after finishing our latest database, we were not able to run the tool - it just hit the error below. Does anyone know what's up/what might've changed between adding different databases and this one?

Code: Select all


ArgumentException: An element with the same key already exists in the dictionary.

System.Collections.Generic.Dictionary`2[System.Int32,System.Int32].Add (Int32 key, Int32 value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
PixelCrushers.DialogueSystem.UniqueIDWindow.GetNewConversationIDs (PixelCrushers.DialogueSystem.DialogueDatabase database, PixelCrushers.DialogueSystem.MasterIDs masterIDs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Tools/Unique ID Tool/UniqueIDWindow.cs:481)
PixelCrushers.DialogueSystem.UniqueIDWindow.ProcessConversations (PixelCrushers.DialogueSystem.DialogueDatabase database, PixelCrushers.DialogueSystem.MasterIDs masterIDs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Tools/Unique ID Tool/UniqueIDWindow.cs:449)
PixelCrushers.DialogueSystem.UniqueIDWindow.ProcessDatabase (PixelCrushers.DialogueSystem.DialogueDatabase database, PixelCrushers.DialogueSystem.MasterIDs masterIDs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Tools/Unique ID Tool/UniqueIDWindow.cs:244)
PixelCrushers.DialogueSystem.UniqueIDWindow.ProcessDatabases () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Tools/Unique ID Tool/UniqueIDWindow.cs:219)
PixelCrushers.DialogueSystem.UniqueIDWindow.DrawProcessButton () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Tools/Unique ID Tool/UniqueIDWindow.cs:170)
PixelCrushers.DialogueSystem.UniqueIDWindow.DrawButtonSection () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Tools/Unique ID Tool/UniqueIDWindow.cs:149)
PixelCrushers.DialogueSystem.UniqueIDWindow.OnGUI () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Tools/Unique ID Tool/UniqueIDWindow.cs:60)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Unique ID Tool Providing Error

Post by Tony Li »

Hi,

That almost certainly means one of your databases contains two conversations that use the same conversation ID. This shouldn't happen unless someone has manually changed a conversation ID. The Unique ID Tool won't know how to handle this because destinations for cross-conversation links would be ambiguous.

Please try this updated Unique ID Tool:

DS2_UniqueIDTool_2018-12-22.unitypackage

It will report conflicting conversation IDs.

If this is what's happening, try these steps to resolve it:

1. Back up your databases (just to be on the safe side).

2. Make a copy of the database that contains the conflicting conversations. Let's call the conversations A and B.

3. In the original database, delete conversation B.

4. In the duplicate database, delete all conversations except B.

5. Edit the original database. In the Database section, merge the duplicate database into the original. Then you can delete the duplicate database.

This updated Unique ID Tool now also reports verbose output much faster. It reports it in a single log line in the Console window, whereas before it would report each action as a separate log line.
Post Reply