Cheo
Active member
Hello, I've recently stumbled upon an annoying issue caused, I'm assuming, by the combination of UCC and UIS. If a UCC npc is given a UIS inventory, in addition to the player character already having one, we get an error on start. Here is a video showing the issue :
Here are the stack and source for the error :
Two things I forgot to mention : I tried giving the UCC NPC I made in the integration demo scene has the exact same Inventory Item Set Manager component values as the Inventory Atlas's, as well as giving him a single basic item rule. That changed nothing, the error was there on start.
But most importantly, I made a simple test scene with no player and my default enemy and then with an additional duplicate of it - the results were the same, the scene could be run with a single enemy but not two.
Hope this issue can be taken a look at and fixed. If you think I made a mistake somewhere with my UCC-UIS setup, please do say so. In any case, the UCC-UIS integration demo scene definitely needs a UCC NPC in it, as an example and proof of functioning.
Here are the stack and source for the error :
Code:
[Exception] ArgumentException: An item with the same key has already been added. Key: 1976610244
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert() at <b89873cb176e44a995a4781c7487d410>:0
System.Collections.Generic.Dictionary`2[TKey,TValue].Add() at <b89873cb176e44a995a4781c7487d410>:0
Opsive.UltimateInventorySystem.Core.Registers.InventoryObjectIDOnlyRegister`1[T].AddInternal() at /Opsive/UltimateInventorySystem/Scripts/Core/Registers/InventoryObjectRegister.cs:297
295: protected virtual void AddInternal(T obj)
296: {
--> 297: m_DictionaryByID.Add(obj.ID, obj);
298: }
Opsive.UltimateInventorySystem.Core.Registers.InventoryObjectIDOnlyRegister`1[T].RegisterInternal() at /Opsive/UltimateInventorySystem/Scripts/Core/Registers/InventoryObjectRegister.cs:285
284: if (addToDictionaries) {
--> 285: AddInternal(obj);
286: }
Opsive.UltimateInventorySystem.Core.Registers.InventoryObjectIDOnlyRegister`1[T].Register() at /Opsive/UltimateInventorySystem/Scripts/Core/Registers/InventoryObjectRegister.cs:256
254: public virtual bool Register(T obj)
255: {
--> 256: return RegisterInternal(obj);
257: }
InventoryIdentifier.RegisterIdentifier() at /Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/InventoryIdentifier.cs:86
84: }
--> 86: InventorySystemManager.InventoryIdentifierRegister.Register(this);
87: }
InventoryIdentifier.Awake() at /Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/InventoryIdentifier.cs:59
57: public virtual void Awake()
58: {
--> 59: RegisterIdentifier();
60: }
Two things I forgot to mention : I tried giving the UCC NPC I made in the integration demo scene has the exact same Inventory Item Set Manager component values as the Inventory Atlas's, as well as giving him a single basic item rule. That changed nothing, the error was there on start.
But most importantly, I made a simple test scene with no player and my default enemy and then with an additional duplicate of it - the results were the same, the scene could be run with a single enemy but not two.
Hope this issue can be taken a look at and fixed. If you think I made a mistake somewhere with my UCC-UIS setup, please do say so. In any case, the UCC-UIS integration demo scene definitely needs a UCC NPC in it, as an example and proof of functioning.