UCC Inventory System Bridge Component Error

I'm simply trying to get my character to start the game with one weapon equipped (then when that's working add the others etc...) but I keep getting this error

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.UltimateInventorySystemBridge.AddToEquippableCollection (Opsive.UltimateInventorySystem.Core.Item item, System.Int32 amount, System.Boolean immediateEquip) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/UltimateInventorySystemBridge.cs:574)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.UltimateInventorySystemBridge.OnAddItemToInventory (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack addedItemStack) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/UltimateInventorySystemBridge.cs:240)
Opsive.Shared.Events.InvokableAction`2[T1,T2].Invoke (T1 arg1, T2 arg2) (at <fa7bae0bde914e57874fdb6999909243>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1,T2] (System.Object obj, System.String eventName, T1 arg1, T2 arg2) (at <fa7bae0bde914e57874fdb6999909243>: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:381)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollection.AddInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack stackTarget, System.Boolean notifyAdd) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemCollection.cs:368)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollection.AddItem (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack stackTarget) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemCollection.cs:446)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.UltimateInventorySystemBridge.LoadDefaultLoadout () (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/UltimateInventorySystemBridge.cs:191)
Opsive.UltimateCharacterController.Inventory.InventoryBase.Start () (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:126)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.UltimateInventorySystemBridge.Start () (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/UltimateInventorySystemBridge.cs:165)


I've tried everything I can find, including setting up my character just as the Integration Demo character is. The same scripts and settings using my database. Nothing seems to solve this error. I'm guessing the Bridge component is missing a reference to something but I have no idea what and can't find out why.
 
I may have changed the code in my project since the last update so let me know if your error line is this one:
Code:
if (!m_InventorySytemManager.Database.Contains(characterItem.ItemDefinition as ItemDefinition)) {

I doubt it is since that code should be executed in editor only, but it is possible.

If that is the line of code that is giving you the error my guess would be that characterItem would be null.

If you start the without any items does picking up new items work?

How do you start with an item equipped? Did you add your item in the Loadout item collection?

If you add the item directly to the player (pure UCC style), that is not supported.
If you added the item in an Item Collection that isn't the Loadout item Collection (i.e Equipped), that's not supported either.

If you had done those it should have given you a better error message compared to a Null Exception though...

Send me some screen shots of your bridge and inventory, and explain a bit more how you've set things up, I'll try to figure out that is going on from there
 
Yes that is the line of code it brings me too. This happens whether I try to have the weapon already in the inventory or add it to the inventory through a run time pickup, both using the loadout collection.

I've attached some screen shots of the bridge, the inventory and collections as well as my player character with all of the scripts.

InventoryMainDB.pngInventoryLoadoutDB.pngInventoryEquippedDB.png
 
I can't see anything wrong with your setup. If you place a breakpoint can you tell what is null? Are you able to reproduce it within the integration scene?
 
Hey guys thanks for the replies, sorry for the delay I've been a little busier at work.

So I pretty much got to the point where nothing I did made a difference, nothing better and nothing worse. I pretty much tried everything. So I figured I must have really done a number on the system with all of my frantic testing/guessing. I think when I was switching from the Demo scene (UCC integration) and back the databases got switched(they change according to the database used in the scene). Then at some point I found an "Update Scene" option and tried that thinking it would reset everything, but most likely worsened my issue.

Anyways I just ended up deleting everything and started from scratch with a new DB and scene setup and all. Now it's all working so far and I'm pretty happy with it.

The only thing now is my weapons will not spawn with the correct rotation but I'm going to start a new thread on that.

So now I'm making progress, thank you.
 
Top