Weird behavior with new equip.

jimi

Member
Hey again,

I'm having some unexpected results with the new equip method.
When you equip a new item, the previous item remains in the Equipable slot item collection which causes the following error when you try and reequip it:

1 Axe (2628159038) || ItemCollection Equippable Slots (Equipped) || ItemStack(-1463709952)[ 1 Axe (2628159038) in ItemCollection Equippable Slots (Equipped)] cannot be moved to equippable because it was not in default first.
UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge:MoveItemToEquippable (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int,int) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:350)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge:MoveEquip (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int,int,bool) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:457)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge:MoveEquip (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,bool) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/CharacterInventoryBridge.cs:443)
LogMenuUI:CrossCut () (at Assets/LogMenuUI.cs:66)
UnityEngine.EventSystems.EventSystem:Update () (at C:/Unity/2019.4.24f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)

1618716349756.png

If you add a third item sometimes it replaces the 1st, sometimes the second. Both items show up as equipped in the hotbar as well ass the itemActionEquipUnequip menu.

This is how I am equipping
Code:
 public DynamicItemDefinition CrosscutItem;
 var Ripsaw = Inventory.GetItemInfo(CrosscutItem);
//UCCBridge.UnequipItem(0);

        if (UCCBridge.EquippableCategory.InherentlyContains(Ripsaw.Value.Item))
        {
            UCCBridge.MoveEquip(Ripsaw.Value, true);
        }


The character has only one slot. and this is what the ItemSet Manager looks like
1618716836065.png
 
Thanks Krispy.

Ok found it. Didn't realize the ItemSlotSet scriptable object was a thing. All fixed now, hope everyone had a good weekend.
1618790501464.png
 
I'm glad you got it fixed.
Also if you wish that items coming in have priority over items inside the equippable slots collection you can tick this option:
1618817520036.png
Note that if you do so and an item is replaced it will be removed.

Your Item Set Rule inspector looks weird. What Unity version are you using? It should look like this:
1618817677980.png
 
Ok thanks.

oh interesting, that default box is a state system. I was wondering what that was.

Yea, I'm on 2019.4.24. Updated from x.17 I believe did it there as well.
 
Top