DarkLiKally
New member
Hello,
like discussed on Discord I'll move to the forums with that issue.
Environment:
Unity 2021.2.7f1
UCC 2.4.4
UIS 1.2.4
Latest downloadable integration package
I followed the integration guides - both video and text.
My Inventory database has the following categories (simplified to the relevant ones):
EquippableInSlot (parent)
EquippableInSlotSingle (child, for single slot)
EquippableInSlotMulti (child, for multi slot)
WeaponOneHand (child of single)
WeaponTwoHand (child of single)
I also did the reserialize category ID trick mentioned in the docs on the abilities of my UCC locomotion.
My Inventory Item Set Manager is configured as follows:
I'm trying to equip a two handed weapon, that item definition is in category WeaponTwoHand.
The Character Inventory Bridge is throwing the following error:
When I jump into my debugger there is this line at
Assets/Opsive/UltimateCharacterController/Scripts/Inventory/ItemSet.cs:124
that is comparing the two marked IDs:
The loop only has one entry since I have only one "Equip Unequip" ability on my UCC for now.
Since it is comparing those two different IDs the "m_EquipUnequip" is still null after the loop.
Because of this the line
Assets/Opsive/UltimateCharacterController/Scripts/Inventory/ItemSet.cs:179
from the stack trace above is throwing that null reference exception.
The ID 106.... is the actual ID of my EquippableInSlot category.
I have no idea where this "Equippable" category with the 35.... ID is coming from.
I have only one `ItemSetManagerBase` on my GO which is the Inventory Item Set Manager above. I also made sure that I have the correct inventory database selected everywhere (removed all demo, empty and other databases from my project).
When I edit the abilities on my UCC for items (i.e. the Equip Unequip one) I also get only the "Equippable" one as suggestion - which does not exist in my databse.
Thanks for your investigation and help!
Greetings,
DLK
-------
EDIT:
I somehow made it pass that code spot - I recreated some things removed and re-added some components and so on. It seems there was some old serialized data in some component.
I renamed a category of the mentioned ones before so maybe that was causing the issue? but why it got a new ID there too?
I removed the Inventory Item Set Manager and the rules scriptable object and recreated them.
Now the Ability on UCC does not offer me the option for selecting the item category anymore - the select box just disappeared.
The above issue was definitely not resolved a clean way now - now the code is getting the m_EquipUnequip set and receiving the correct category IDs but I get a new error now:
Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:413
m_ItemSetCategoryIndex = -1
which results in an Index ouf of range exception.
like discussed on Discord I'll move to the forums with that issue.
Environment:
Unity 2021.2.7f1
UCC 2.4.4
UIS 1.2.4
Latest downloadable integration package
I followed the integration guides - both video and text.
My Inventory database has the following categories (simplified to the relevant ones):
EquippableInSlot (parent)
EquippableInSlotSingle (child, for single slot)
EquippableInSlotMulti (child, for multi slot)
WeaponOneHand (child of single)
WeaponTwoHand (child of single)
I also did the reserialize category ID trick mentioned in the docs on the abilities of my UCC locomotion.
My Inventory Item Set Manager is configured as follows:
I'm trying to equip a two handed weapon, that item definition is in category WeaponTwoHand.
The Character Inventory Bridge is throwing the following error:
Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Inventory.ItemSet.StateChange () (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/ItemSet.cs:179)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.InventoryItemSetManager.StateChange () (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/ItemSet/InventoryItemSetManager.cs:733)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.BridgeEquippableProcessing.UpdateItemSetItems (System.Boolean equip) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/BridgeEquippableProcessing.cs:478)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.BridgeEquippableProcessing.OnItemAddedToEquippable (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack addedItemStack) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/BridgeEquippableProcessing.cs:202)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.BridgeEquippableProcessing.OnAddItemToInventory (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack addedItemStack) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/BridgeEquippableProcessing.cs:782)
Opsive.Shared.Events.InvokableAction`2[T1,T2].Invoke (T1 arg1, T2 arg2) (at <27da9e1afec54f2fb2a11d46a234f9df>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1,T2] (System.Object obj, System.String eventName, T1 arg1, T2 arg2) (at <27da9e1afec54f2fb2a11d46a234f9df>:0)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollection.NotifyAdd (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack addedItemStack) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemCollection.cs:430)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection.SetItemAmount (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, System.Int32 slotIndex, System.Boolean removePreviousItem) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:276)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection.AddItemInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, System.Int32 slotIndex) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:236)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection.AddItem (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, System.Int32 slotIndex) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:200)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge.MoveItemToEquippable (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, System.Int32 equippableCollectionIndex, System.Int32 slotIndex) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:451)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge.MoveEquip (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, System.Int32 equippableItemCollectionSet, System.Int32 slotID, System.Boolean equip) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:532)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge.MoveEquip (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, System.Boolean equip) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:518)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.InventoryItemPickup.DoItemIdentifierPickupInternal (UnityEngine.GameObject character, Opsive.UltimateCharacterController.Inventory.InventoryBase inventory, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/Pickup/InventoryItemPickup.cs:111)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.DoItemIdentifierPickup (UnityEngine.GameObject character, Opsive.UltimateCharacterController.Inventory.InventoryBase inventory, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:267)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.DoItemPickup (UnityEngine.GameObject character, Opsive.UltimateCharacterController.Inventory.InventoryBase inventory, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean pickupItemIdentifier) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:229)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.TryItemPickup (Opsive.UltimateCharacterController.Inventory.InventoryBase inventory, System.Int32 slotID) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:124)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.TriggerEnter (UnityEngine.GameObject other, System.Int32 slotID) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:113)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.DoPickup (UnityEngine.GameObject target) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:91)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.TriggerEnter (UnityEngine.GameObject other) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:82)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ObjectPickup.OnTriggerEnter (UnityEngine.Collider other) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ObjectPickup.cs:165)
When I jump into my debugger there is this line at
Assets/Opsive/UltimateCharacterController/Scripts/Inventory/ItemSet.cs:124
that is comparing the two marked IDs:
The loop only has one entry since I have only one "Equip Unequip" ability on my UCC for now.
Since it is comparing those two different IDs the "m_EquipUnequip" is still null after the loop.
Because of this the line
Assets/Opsive/UltimateCharacterController/Scripts/Inventory/ItemSet.cs:179
from the stack trace above is throwing that null reference exception.
The ID 106.... is the actual ID of my EquippableInSlot category.
I have no idea where this "Equippable" category with the 35.... ID is coming from.
I have only one `ItemSetManagerBase` on my GO which is the Inventory Item Set Manager above. I also made sure that I have the correct inventory database selected everywhere (removed all demo, empty and other databases from my project).
When I edit the abilities on my UCC for items (i.e. the Equip Unequip one) I also get only the "Equippable" one as suggestion - which does not exist in my databse.
Thanks for your investigation and help!
Greetings,
DLK
-------
EDIT:
I somehow made it pass that code spot - I recreated some things removed and re-added some components and so on. It seems there was some old serialized data in some component.
I renamed a category of the mentioned ones before so maybe that was causing the issue? but why it got a new ID there too?
I removed the Inventory Item Set Manager and the rules scriptable object and recreated them.
Now the Ability on UCC does not offer me the option for selecting the item category anymore - the select box just disappeared.
The above issue was definitely not resolved a clean way now - now the code is getting the m_EquipUnequip set and receiving the correct category IDs but I get a new error now:
Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:413
m_ItemSetCategoryIndex = -1
which results in an Index ouf of range exception.
Last edited: