Drag from Inventory to Equipment View generating error

pleska

New member
I think I have created the integration according to the video and demo scene but as I drag a Item Definition I created from my Inventory Panel to my Equipment Panel the icon moves correctly but I get the error "Unable to find the ItemSet for item 1 Breastplate (4261490087) in category index 0." I expect this has something to do with the integration with UCC and I missed a step but I can't seem to figure out what that step might be that is missing. Since this isn't something that "today" is going to appear in the 3D view on the character I thought just indicating add no third person item in UCC might be enough. Eventually what this will need to do is update my UMA recipes but we will see who gets to that first you all or me. But for now I am not sure what this is trying to tell me.

One important thing to the mystery is in the error message you see the extra spaces after the item ID. I think the problem might be related to something in the drag operation not determining the right collection.

My prefab has an Item and ItemObject script on it and the item is pointing to the Item Definition and the Item Object is pointing the the actual inventory item. Other than that the only things that I can think that might apply is that my Inventory Panel is Default (Main) inventory and my Equipment Panel is Equipped ItemSlotCollection Equipped.

In the inventory this item derives from the Single Item category which derives from the equippable (since I duplicated the right starting database post integration).

Error: Unable to find the ItemSet for item 1 Breastplate (4261490087) in category index 0.
UnityEngine.Debug:LogError(Object)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.UltimateInventorySystemBridge:OnItemActionEquipUnequip(ItemInfo, Boolean) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/UltimateInventorySystemBridge.cs:313)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.UltimateInventorySystemBridge:OnAddItemToInventory(ItemInfo, ItemStack) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/UltimateInventorySystemBridge.cs:247)
Opsive.Shared.Events.InvokableAction`2:Invoke(ItemInfo, ItemStack)
Opsive.Shared.Events.EventHandler:ExecuteEvent(Object, String, ItemInfo, ItemStack)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollection:NotifyAdd(ItemInfo, ItemStack) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemCollection.cs:381)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection:SetItemAmount(Item, Int32, Int32, Boolean) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:261)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection:AddItem(ItemInfo, Int32) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:225)
Opsive.UltimateInventorySystem.UI.Panels.Hotbar.ItemSlotCollectionView:AddItem(ItemInfo, Int32) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/Hotbar/ItemSlotCollectionView.cs:198)
Opsive.UltimateInventorySystem.UI.Item.DragAndDrop.DropActions.ItemViewDropContainerSmartExchangeAction:Drop(ItemViewDropHandler) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/DragAndDrop/DropActions/ItemViewDropContainerSmartExchangeAction.cs:113)
Opsive.UltimateInventorySystem.UI.Item.DragAndDrop.ItemViewDropActionsWithConditions:Drop(ItemViewDropHandler) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/DragAndDrop/ItemViewSlotDropActionSet.cs:180)
Opsive.UltimateInventorySystem.UI.Item.DragAndDrop.ItemViewSlotDropActionSet:HandleItemViewSlotDrop(ItemViewDropHandler) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/DragAndDrop/ItemViewSlotDropActionSet.cs:108)
Opsive.UltimateInventorySystem.UI.Item.DragAndDrop.ItemViewDropHandler:HandleItemViewSlotDropInternal() (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/DragAndDrop/ItemViewDropHandler.cs:197)
Opsive.UltimateInventorySystem.UI.Item.DragAndDrop.ItemViewDropHandler:HandleItemViewSlotDrop(ItemViewSlotEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/DragAndDrop/ItemViewDropHandler.cs:186)
Opsive.UltimateInventorySystem.UI.Item.<>c__DisplayClass62_0:<Initialize>b__7(PointerEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:237)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton:OnDrop(PointerEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:202)
UnityEngine.EventSystems.EventSystem:Update() (at D:/Program Files/Unity/2020.1.14f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:376)
 
It looks like it is trying to equip an item set that doesn't exist. Are you able to tell us how to reproduce it within a fresh project?
 
I am not sure if this will help give a clue to my problem but the core problem seems to be caused by this path.

UltimateInventorySystemBridge OnItemActionEquipUnequip()
calls GetEquipItemSetIndex()
calls InventorySystemItemSetManager.IsItemSetValid()
which is returning false at the itemSet.ItemIdentifiers == null
... it has a comment of (If the ItemIdentifier is null then the item hasn't been added yet.)

Game starts out with my item in the Main Default ItemCollection, error happens when I drag the item to my Equipped ItemSlotCollection which has a ItemSlotSet defined.

Although I know that it is silly to equip a breastplate in item slot 0 I was just trying to get the inventory to work with integration,

Right now my Inventory System Item Set Manager looks like the following:

1612078463861.png
The Item Definition looks like the following:

1612078495304.png
The associated prefab has these components
1612078538098.png

I can try to recreate this if this doesn't give a hint what I missed doing. The strange thing is the UIS side works fine and the item moves to the new canvas display and changes inventory. Just that error is happening because it cannot equip the item on the UCC side.
 
I solved my problem but I don't understand it. If the item starts in my (Main) Default Item Collection vs. the Loadout Item Collection then it's not listed on the "Current Inventory" of the Ultimate Inventory System Bridge. If that is the case I get the error when I do the drag/drop operation from inventory panel to equipment panel. Moving it to the Loadout does something special on startup I guess that tells the UCC side something special about the item it seems. This wasn't super obvious to me. This also makes me curious for what I would keep in the Default Item Collection. I did notice that pickups that are "Equippable" go into Equippable and get added to that "Current Inventory" list.

I also needed to expose each of my equipment slots and setup an item set mapping the item definitions parent item definition (in this case a sword and a helmet) for each. I am not 100% sure in a larger RPG game with lots of distinct types of armor and item categories how the item set thing will scale. Any suggestions on how to make that more manageable when there are lots of armor pieces and accessories you can equip to make it easier to manage. I noticed the integration demo only had 3 and the inventory demo only had 4.
 
Last edited:
I'm glad you found a solution to your issue.
Items need to be added to the default loadout at edit time. Like you suspected the items in the loadout are initialized in a way that works with UCC. If you add item to the other item collection at edit time you will have issues.
This is a limitation we will fix in a future update.

The Main default item collection will have all your non-equippable items at runtime.

We will investigate on how to improve scalability of equipment items. Item Sets are quite ingrained in UCC ad therefore it would take a tremendous amount of work to change it.
My initial idea is to use the integration Equipment collection only for UCC usable equippable items. And then have another collection for clothes and non-usable equipment.

We will be working more on the UCC+UIS integration in the next few months. And this is in our list of things to improve.
 
Top