Error message while setting up

rao

New member
I've come across a problem while setting up the inventory system, which I've pasted below. Avatar-351578055 is the player character which has an Inventory attached to it. The function in the ItemSlotCollectionView is causing the error when the game is loaded (right at the Start time). The function causing the error is OnInventoryChanged - it's failing when it is trying to fetch a collection from the Inventory using GetItemCollection. It is sending a variable through this function - a ItemCollectionID struct (which is defined in the ItemCollection.cs file). The Name attribute of that struct is blank, which is possibly why it is causing an error. I have named my ItemCollections, and they are ItemSlotCollections (not ItemCollections) as advised in the set up instructions - and they also reference the same scriptable object ItemSlotSet. So I'm not sure why this error is happening - I would welcome an tips on solving it.

The inventory 'Avatar-351578055 (Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory)' does not contain an item slot collection for the ID provided in the ItemSlotCollectionView
UnityEngine.Debug:LogError (object,UnityEngine.Object)
Opsive.UltimateInventorySystem.UI.Panels.Hotbar.ItemSlotCollectionView:OnInventoryChanged (Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory,Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/Hotbar/ItemSlotCollectionView.cs:187)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase:SetInventory (Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory,bool) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:334)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase:SetInventory (Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:317)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerPanelBinding:OnInventoryBound () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerPanelBinding.cs:97)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.InventoryPanelBinding:BindInventory (Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/InventoryPanelBinding.cs:89)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.InventoryPanelBinding:BindInventory () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/InventoryPanelBinding.cs:59)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.InventoryPanelBinding:Initialize (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel,bool) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/InventoryPanelBinding.cs:44)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerPanelBinding:Initialize (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel,bool) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerPanelBinding.cs:50)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel:Setup (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager,bool) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:137)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager:SetupDisplayPanels (bool) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:129)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager:SetPanelOwner (UnityEngine.GameObject) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:155)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager:Initialize (bool) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:118)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager:Awake () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:78)
 
Would you mind sending a screen shot of your Inventory ItemSlotCollection and the ItemSlotCollectionView (aka equipment panel) inspector?

I would recommend setting the purpose the NONE and use the name instead, its more flexible. The name must match perfectly. So make sure you don't have space before or after or caps in one and not the other.

If they are the same and it still isn't working make sure you have set the right Inventory reference. If you are using an InventoryIdentifier ID. Make sure it matches the one set for the DisplayPanelManager owner or the one set on the DisplayPanel panelBinding.

I hope that helps
 
I've also attached a screenshot of the Game object to show the names of the ItemSlotCollection matching. Changing the purpose to None didn't remove the error unfortunately.
 

Attachments

  • pic1.png
    pic1.png
    438.2 KB · Views: 6
  • pic2.png
    pic2.png
    396.5 KB · Views: 8
  • pic3.png
    pic3.png
    365.3 KB · Views: 7
In your screenshot you are not showing the most important part the ItemSlotCollectionView inspector (child of the Equipment Panel) component.

That's the component you need to specify the item collection to monitor

In the screenshot above you are showing two characters with an Inventory each, why do you have two Inventories?
I think you perhaps misunderstood what the error was about, your inventories don't need to match itemcollection names (they can if you want to).
The rquirement is the the UI (ItemSlotCollectionView) that needs to show that itemSlotCollection needs to know the name it is looking for
 
It is still giving the same error. I've attached a screenshot of the ItemSlotCollectionView and the player avatar and the ItemSlotSet. Let me know if you can see the problem - thanks.
 

Attachments

  • opsive1.png
    opsive1.png
    449.3 KB · Views: 3
  • opsive2.png
    opsive2.png
    427 KB · Views: 2
  • opsive3.png
    opsive3.png
    420.8 KB · Views: 3
You need to spcify the ItemColllection it needs to monitor, not just the ItemSlotSet which could be used by multiple ItemSlotCollections.

Unfold the ItemCollectionID field and set the name:
1658136033525.png
 
Top