Disappearing items

wistyuki

New member
Okay, I have another problem I've been working on for a while. So I have an item picked up, it shows in my inventory grid and my main collection.
When I equip it, it disappears from my inventory grid and doesn't show up in my equipped item views.
It does show up in my Equipped Slots itemcollection, and it doesn't equip visually unless I exit the inventory and scroll through using the "equipnext" abilities. (I want it to equip immediately tbh)
If I equip something else, whether it be an item for the same slot or a different one, it then shows up in the inventory and equipped item views. Even if it should have equipped a different item, the previous item shows.

I noticed this happened in the demo scene as well, so there must just be a setting I'm missing.

I do have two body objects (right hand and left hand) equipped automatically in the Equippable item collection.
I used to just have them in the equippable slots collection, but I recall something worked better when its done this way.
However, cant get the left hand to equip.
I'm wondering if these problems are connected, as well as with this error:

0opsiveitemseterror.jpg

I have watched all the videos, read the documentation, tried changing settings and most of what I'm using is a copy of the demos. I've had this problem for several months.
 
Just guessing here, but I had a similar issue.

Do you have multiple Equip/Unequip Item abilities added (you need one for Equipped, Left Hand Grenade (shown in the image here), Right Hand Grenade, and Magic

qDPFuiP.png
 
Thank you for your suggestion. I did have many equip/unequip abilities, but not specific to an Itemset category. I tried it out but I'm still seeing the same results. I don't actually have grenades yet and wont have magic for this game anyways.
 
Can you confirm that you care using the latest available version UIS 1.1.7 and UCC 2.3.4? (I'll be releasing a new version of UIS with a few bug fixes very soon, perhaps that might fix your issue)

You say that the Equip Item View does not show the items even though it is part of the Equippable Item Slots Item Collection. Double check your Equipment View to see if it is correctly set up to show the contents of the "Equippable Slots" collection. Make sure to reference it in the inspector by name.

It's possible the issue comes from the error you have.
Can you confirm that line 180 of the ItemSet (the line giving you the error) is indeed:
Code:
var targetItemSetIndex = m_EquipUnequip.IsActive ? m_EquipUnequip.ActiveItemSetIndex : m_ItemSetManager.ActiveItemSetIndex[m_CategoryIndex];

That would mean either m_EquipUnequip or m_ItemSetManager is null. Add a debug to make sure which one is null, but as nathanj mentioned it's most likely the EquipUnequip ability.

EquipUnequip is assigned in the ItemSet "Initialize" function. There you can add some Debug.Log to try and figure out the item category it is looking for and why it can't find it.

I hope this helps
 
Yeah, I just updated the other day (Fablegimps on discord). It does reference that collection by name. And like I said, the equip item view doesn't show the item UNTIL you equip something else, then it shows, so to me it seems like it knows what to show, it just isn't updating? And yes that is the line for my error.
I also have 2 errors that come up on play referencing line 204 of that same script if that helps at all.
It doesn't matter what I do to my EquipUnequip abilities they don't change anything.
I may have been working on Unity for a few years now but this kind of code is a bit advanced for me, that's why I purchased it- I could never write something half as well done. And I never have had to use Debug.Log for anything other than the basics. All I ever had to do was print a message to see if a section of code was being called or not and that was enough. So forgive me, but I think I may need more of an example for what to write.
Thank you for your response.
 
Is there anything custom with your character or could you make a prefab and share it and have someone look at it in the integration demo scene?
 
? He's a custom Daz character with pretty much every add on and several integration packs on him. Most things work fine apart from the new climbing pack. He's probably several gb alone unfortunately.
 
Ah bummer. When you pick up the item does your Equip/Unequip ability complete or does it stay active (get stuck)? And when your item is supposed to be equipped, does it show as equipped on the Item Set Manager?
 
You'll need to fix all errors on start first.
Any error can prevent a lot of code from being executed, especially on awake and start, which can prevent initialization of some components.


Please share all the errors you are getting from the beginning.

The line 204 you mentioned clearly shows that your problem is the "m_EquipUnequip" being null.

Here is the ItemSet initialize function with a few Debug.Logs that should let us know what the issue is:

Code:
public void Initialize(GameObject gameObject, ItemSetManagerBase itemSetManager, uint categoryID, int categoryIndex, int index)
{
    Debug.Log($"Initializing the ItemSet for category ID ({categoryID}), category Index ({categoryIndex}) and index ({index})");
    // The ItemSet may have already been initialized.
    if (m_ItemSetManager != null) {
        return;
    }
    base.Initialize(gameObject);
    m_ItemSetManager = itemSetManager;
    var equipUnequipAbilities = gameObject.GetCachedComponent<UltimateCharacterLocomotion>().GetAbilities<EquipUnequip>();
    if (equipUnequipAbilities != null) {
        Debug.Log($"Found {equipUnequipAbilities.Length} equip/unequip abilities");
        for (int i = 0; i < equipUnequipAbilities.Length; ++i) {
            Debug.Log($"Checking category ID "+equipUnequipAbilities[i].ItemSetCategoryID);
            if (equipUnequipAbilities[i].ItemSetCategoryID == categoryID) {
                Debug.Log($"Found Match! {categoryID}");
                m_EquipUnequip = equipUnequipAbilities[i];
                break;
            }
        }
    }
    m_CategoryIndex = categoryIndex;
    m_Index = index;
    if (m_ItemIdentifiers == null) {
        m_ItemIdentifiers = new IItemIdentifier[m_Slots.Length];
    }
    m_EmptyItemSet = true;
    for (int i = 0; i < m_Slots.Length; ++i) {
        if (m_Slots[i] != null) {
            m_EmptyItemSet = false;
            return;
        }
    }
    EventHandler.RegisterEvent<int, int>(m_ItemSetManager.gameObject, "OnItemSetManagerUpdateItemSet", OnUpdateItemSet);
}

Also send me a screenshot of your ItemSetManager instpector at runtime, that might help identify the issue too
 
Here is my item set manager after equipping a sword and shield:
4.jpg

Here are the logs after including them in the script:

5.jpg
 
I was a bit confused because your logs didn't make sense, then I realised they were collapsed so it wasn't in order.

So from what I can understand, the problem is ItemSet Category 2 and 3, from your logs its seems those are the two categories that did not find a match, although I could be wrong since not all the logs are shown.

If you aren't using them, remove them or add equip/unequip abilities form them.

You are also getting 6 warning and 16 errors. Don't forget that any warnings/errors that happen before the Item Set error (even if it doesn't seem related) can break the execution flow and prevent things from initializing correctly.

Something else that seemed a bit off to me is that you have two different category IDs for category index 0. The one ending with "...283" and the other ending with "...895"
I can't think of any reason that could be the case, the category index is retrieved from a dictionary and there should be only one item category per index.

Can you confirm that you only have a single "Inventory Item Set Manager" and no "Item Set Manager" component on your character?
 
Pretty sure this is the issue,
you aren't using them, remove them or add equip/unequip abilities form them.
I had the same errors before and matching the equip/unequip item abilities fixed it for me.

the other thing I noticed from your photos, are you using the demo scales InventoryDatabase file or are you using a duplicated one? If you’re using the original one you’ll possibly have issues updating your project.
 
I added equip/unequip abilities for the other item set categories when it was suggested after the first comment unfortunately. Yes, I only have the inventory item set manager component :unsure: I don't see 895 anywhere. The other errors I have in my project are shader keyword limit errors, that just popped up three or four days ago and its on my list of things to fix. The warnings are dotween's max dotween limit reached, which is also on my list. And sorry I actually had no idea that collapsing the logs made it out of order, I'll send a new screenshot. And yes I am using a duplicated Database file. I am still just as confused as to what is happening :LOL:
 
Okay okay forget what I just said. I went and fixed my shader problem and I guess that was preventing the changes y'all suggested from executing. (the equip/unequip abilities for the unused item set categories I'm assuming, since my project JUST hit the shader keyword limit- I haven't done much since) Thank you both so much for helping me with this I am very pleased that this problem is finally fixed!
 
Top