Loading Saved Inventories With Equippables

polonel

Member
When loading a saved game with a weapon equipped, the equipped item is placed back in the equipped ItemSlotCollection but no item is placed on the character hierarchy "Items" or in the hand. I also tried to save a game with the item unequipped and the issue still occurs. The item is restored to the inventory correctly but is missing in the UCC Player "Items" hierarchy. I have tried both UIS save system and PixelCrusher's save system.

I'm on UIS v1.1
 
Thank you for pointing that out. It is a known issue which we plan to fix as fast as possible.

We may look into a quick fix to get a solution out this week, then we'll have time to think about a more robust solution for the long term.

I apologize for the inconvenience this bug may have caused.
 
We updated the Integration package for UIS/UCC a few minutes ago, we fixed saving/loading and few other bugs with the integration demo.
 
I have been fighting trying to get my equippable to save across scene changes and I think I have finally narrowed down the problem.

When loading the save equippable item, it saves with the correct ID that was in the inventory at scene change. However, when UCC boots up in the new scene and creates a new Item Slot for the equippable item, it has a different ID for item slot. Making the item not valid to be equipped in the given slot and not equipped at all.

This line always fails during a scene change due to the above issue. It cannot find an item with ID for that slot. Even though the original item which was able to be equipped correctly in Scene 1 is listed in the inventory as Equippable.

ItemSetManagerBase.cs
C#:
// Remember the count to ensure the correct number of items exist within the inventory.
requiredCount++;
if (!m_CheckedItemIdentifiers.Contains(item.ItemIdentifier)) {
    availableCount += m_Inventory.GetItemIdentifierAmount(item.ItemIdentifier);
    m_CheckedItemIdentifiers.Add(item.ItemIdentifier);
}

Here availableCount is always 0 after scene change due to the item IDs being different.
Code:
// Ensure the inventory has the number of items required for the current ItemSet.
            if (availableCount < requiredCount) {
                return false;
            }


Why does ItemSetManager generate a new random ID? I thought it got its ID from the items stored inside Equippable collection. Which has the correct ID of the item after scene change.

This issue really hinders the integration as no weapons can be used after a scene change.

On Latest version of both and integration.
UIS 1.1.2
UCC 2.2.7
Downloaded updated integration as of 12-8-2020 at 8pm EST
 
This was actually the consequence of using Inventory Saver instead of Inventory Bridge Saver. Once I removed the Inventory Saver everything worked correctly.

I went back and check the documentation to see if I had overlooked the mention of the Inventory Bridge Saver and I could not find any information on it.
May want to add it to https://opsive.com/support/documentation/ultimate-inventory-system/save-system/ or UCC integration page. I'm not sure if the bridge saver was introduced with 1.1 integration, I just don't remember seeing it before.

Nevertheless, everything works well now with the Bridge Saver.
 
I'm very sorry about this, I will add it in the documentation right away, The BridgeSaver has actually been there since day one.
 
Top