Latest Update UCC Intergration Issues

CruttMutt

Member
Hello!

I am moving the thread here as recommended and hopefully, we can figure this out... Sorry to take your time like this, the fact it should be working simply is reassuring but I just can't make it happen.

Here is a screenshot of the Inventory, Character Inventory Bridge and Inventory System Item Set Manager in edit and a video of them during runtime so you can see what happens.


As you can see the item does not equip since the update and when I do equip the error I had mentioned previously comes up and the item disappears.

Here are the item and item definition screenshots too, besides adding the component in the item setup integration section they are the same as when they worked pre-update.


As a note, my heal and eat items still work, it seems to only be the UCC weapon equip at this point.

Also the error again to save any cross-checking with the old thread:

IndexOutOfRangeException: Index was outside the bounds of the array.
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.ActiveAndNextItemSetData.Reset () (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/ActiveAndNextItemSetData.cs:234)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.BridgeEquippableProcessing.UpdateItemSetItems (System.Boolean equip) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/BridgeEquippableProcessing.cs:468)
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:196)
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:770)
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:264)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemSlotCollection.AddItem (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, System.Int32 slotIndex) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemSlotCollection.cs:228)
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:376)
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:457)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge.MoveEquip (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, System.Boolean equip) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:443)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterEquipUnequipItemAction.InvokeActionInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.ItemActions.ItemUser itemUser) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/InventoryItemActions/CharacterEquipUnequipItemAction.cs:76)
Opsive.UltimateInventorySystem.ItemActions.ItemAction.InvokeAction (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.ItemActions.ItemUser itemUser) (at Assets/Opsive/UltimateInventorySystem/Scripts/ItemActions/ItemAction.cs:97)
Opsive.UltimateInventorySystem.UI.Panels.ActionPanels.ItemActionPanel.InvokeActionInternal (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ActionPanels/ItemActionPanel.cs:66)
Opsive.UltimateInventorySystem.UI.Panels.ActionPanels.ActionPanel`1[T].InvokeAction (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ActionPanels/ActionPanel.cs:119)
Opsive.UltimateInventorySystem.UI.Panels.ActionPanels.ActionPanel`1+<>c__DisplayClass13_0[T].<OpenInternal>b__0 () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ActionPanels/ActionPanel.cs:69)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton.Press () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:72)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:123)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2019.4.21f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:50)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/Unity/Hub/Editor/2019.4.21f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
InControl.InControlInputModule:processMousePress(MouseButtonEventData) (at Assets/InControl/Source/GUI/InControlInputModule.cs:761)
InControl.InControlInputModule:processMouseEvent(Int32) (at Assets/InControl/Source/GUI/InControlInputModule.cs:677)
InControl.InControlInputModule:processMouseEvent() (at Assets/InControl/Source/GUI/InControlInputModule.cs:667)
InControl.InControlInputModule:process() (at Assets/InControl/Source/GUI/InControlInputModule.cs:185)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2019.4.21f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)
 
Last edited:
I don't see anything glaringly wrong with your setup.

Just to be sure, you are not getting any warning before this error pops up right?

In the line where you have the error could you try this new function instead?

Code:
/// <summary>
/// Reset the recorded data.
/// </summary>
public void Reset()
{
    if (Active?.Data == null) {
        return;
    }
   
    if (Active.Data.Length != m_SlotCount) {
        Debug.LogWarning($"The data array length '{Active.Data.Length}' is not the same size as the slot count '{m_SlotCount}'");
    }
       
    for (int i = 0; i < m_SlotCount; i++) {
        if (Active.Data.Length > i) {
            Active.Data[i]?.Reset();
        }
       
        if (Active.Data.Length > i) {
            Next.Data[i]?.Reset();
        }
    }
}

That should at least prevent the error from happening and instead you'll get a warning that should help us find what the issue is.
It seems, that it might be related to the number of Item Set slots. But if that's the case you should have gotten a warning previously that the slot count don't match
 
Okay, I will try! There are no warnings. Just the error.

So everything is set up right in regards to the item and character. Good, I was following it correctly then. Okay, I'll stop trying to change those. The demo scene works so I assume it's all installed correctly.
 
Last edited:
Oh wow, this did fix it! Now it equips and I have a warning here. So it all works and should be quite trackable now. It seems to be exactly what you think it is. I will look into that and let you know if I fix it before you see this but I might not know exactly what it's refering to.

Thanks though! Been an amazing help and very happy to see it functioning regardless of a warning. About to learn something new :D

The warning says:

The data array length '1' is not the same size as the slot count '2'
UnityEngine.Debug:LogWarning (object)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.ActiveAndNextItemSetData:Reset () (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/ActiveAndNextItemSetData.cs:253)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.BridgeEquippableProcessing:UpdateItemSetItems (bool) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/BridgeEquippableProcessing.cs:468)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.BridgeEquippableProcessing:OnUnequipItemComplete (Opsive.UltimateCharacterController.Items.Item,int) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/BridgeEquippableProcessing.cs:422)
Opsive.Shared.Events.InvokableAction`2<Opsive.UltimateCharacterController.Items.Item, int>:Invoke (Opsive.UltimateCharacterController.Items.Item,int)
Opsive.Shared.Events.EventHandler:ExecuteEvent<Opsive.UltimateCharacterController.Items.Item, int> (object,string,Opsive.UltimateCharacterController.Items.Item,int)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip:ItemUnequipComplete (int,bool) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:886)
Opsive.Shared.Game.SchedulerBase:AddEventInternal<int, bool> (single,Opsive.Shared.Game.ScheduledEventBase/InvokeLocation,System.Action`2<int, bool>,int,bool)
Opsive.Shared.Game.SchedulerBase:ScheduleFixed<int, bool> (single,System.Action`2<int, bool>,int,bool)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip:ItemUnequip (int,bool) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:825)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip:Update () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:659)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:UpdateAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[]) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:794)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:UpdateUltimateLocomotion () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:725)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:Move (single,single,single) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:477)
Opsive.UltimateCharacterController.Game.KinematicObjectManager/KinematicCharacter:Move (bool) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:237)
Opsive.UltimateCharacterController.Game.KinematicObjectManager:Update () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:841)
 
Turns out I was an idiot, I confused the slot count with the category count.
So the reset function should look like this instead:

Code:
/// <summary>
/// Reset the recorded data.
/// </summary>
public void Reset()
{
    if (Active?.Data == null) {
        return;
    }
    var count = m_CategoryCount;
    
    if (Active.Data.Length != m_CategoryCount) {
        Debug.LogWarning($"The data array length '{Active.Data.Length}' is not the same size as the category count '{m_CategoryCount}'");
        count = Active.Data.Length;
    }
        
    for (int i = 0; i < count; i++) {
        Active.Data[i]?.Reset();
        Next.Data[i]?.Reset();
    }
}
}

I'm sorry about this, I'll be more careful next time
 
Not at all my man! I am just really happy whenever we can work it out as I am always super keen on keeping up with the updates!

Thanks so much for looking in and taking the time, I am really glad we were able to work this one out and I hope it solves any issues nice and quick for you in the future.

Thanks legend! Best assets in town and can't wait to see what else you build onto it!

Switched it out and it's all running clean as a whistle. Great stuff and thanks again! :D
 
Top