If you repeat the auto save about 3 times after getting the item, the items other than the Consumable item and Health item will disappear.

ymo

Member
UIS: If you repeat the auto save about 3 times after getting the item, the items other than the Consumable item and Health item will disappear.
It also happens with manual save
Version UCC225 UIS106, but it also happens in the latest version

And is there another good way to implement uConstruct items?
I want to stack uConstruct items.
I want to stop building a uConstruct item when I drop it

@Sangemdoko
I will send you a project that is as small as necessary.
I sent you a conversation with the URL of the project file.

Error Code
ArgumentException: An item with the same key has already been added. Key: 1725629314
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <437ba245d8404784b9fbab9b439ac908>:0)
Opsive.Shared.Utility.Serialization.DeserializeFields (Opsive.Shared.Utility.MemberVisibility visibility, System.Func`3[T1,T2,TResult] onValidateCallback) (at <c074b6a8dd6f40bea0f47542ec19701b>:0)
Opsive.UltimateInventorySystem.SaveSystem.InventorySystemManagerItemSaver.DeserializeAndLoadSaveData (Opsive.Shared.Utility.Serialization serializedSaveData) (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/InventorySystemManagerItemSaver.cs:65)
Opsive.UltimateInventorySystem.SaveSystem.SaverBase.Load () (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaverBase.cs:82)
Opsive.UltimateInventorySystem.SaveSystem.SaverBase.Start () (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaverBase.cs:61)

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.InventoryBridgeSaver.SetItemAsUnequipped (Opsive.UltimateInventorySystem.Core.DataStructures.ItemAmounts itemAmounts) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/InventoryBridgeSaver.cs:196)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.InventoryBridgeSaver.DeserializeAndLoadSaveData (Opsive.Shared.Utility.Serialization serializedSaveData) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/InventoryBridgeSaver.cs:159)
Opsive.UltimateInventorySystem.SaveSystem.SaverBase.Load () (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaverBase.cs:82)
Opsive.UltimateInventorySystem.SaveSystem.SaverBase.Start () (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaverBase.cs:61)
 
Thank you for the reporting this bug, it seems quite obscure so it may take a while for me to fix it. I apologize in advance.

I'm not familiar with uConstruct. But to stack Items all you need to do is set the item Category as common (Unique = false) in the Editor.
To know when you need stop building you could listen to change/update event from the Inventory and check the item still exist in the inventory.
You can find all the events in the EventNames.cs file. The documentation explains how to use those events: https://opsive.com/support/documentation/ultimate-inventory-system/events/
 
I would like to mention that we found the bug, it turns out there was a major problem with the save system which kept saving items even though they would never be used again. This made the save grow infinitely on each save and load until it crashed.

It is now fixed in the development project. Unfortunately there are more bugs we wish to fix before we release the next update. so I am afraid you will need to wait until then. I will also make other improvements to the save system next week, apart from this bug fix. Look forward to those :)
 
  • Like
Reactions: ymo
I would like to mention that we found the bug, it turns out there was a major problem with the save system which kept saving items even though they would never be used again. This made the save grow infinitely on each save and load until it crashed.

It is now fixed in the development project. Unfortunately there are more bugs we wish to fix before we release the next update. so I am afraid you will need to wait until then. I will also make other improvements to the save system next week, apart from this bug fix. Look forward to those :)
UIS update Thank you for your hard work.

Version
UCC 2.2.7
UIS 1.1.3

If you save while holding the weapon in the UCC intergration Scene,
the weapon will disappear. Ammo will remain.

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.InventoryBridgeSaver.SetItemAsUnequipped (Opsive.UltimateInventorySystem.Core.DataStructures.ItemAmounts itemAmounts) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/InventoryBridgeSaver.cs:235)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.InventoryBridgeSaver.DeserializeAndLoadSaveData (Opsive.Shared.Utility.Serialization serializedSaveData) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/InventoryBridgeSaver.cs:171)
Opsive.UltimateInventorySystem.SaveSystem.SaverBase.Load () (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaverBase.cs:84)
Opsive.UltimateInventorySystem.SaveSystem.SaveSystemManager.LoadInternal (System.Int32 saveIndex) (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaveSystemManager.cs:421)
Opsive.UltimateInventorySystem.SaveSystem.SaveSystemManager.Load (System.Int32 saveIndex) (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaveSystemManager.cs:216)
Opsive.UltimateInventorySystem.UI.Panels.Save.SaveGrid.<Initialize>b__6_7 () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/Save/SaveGrid.cs:74)
Opsive.UltimateInventorySystem.UI.Panels.ConfirmationPopUp.OnConfirmClick () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ConfirmationPopUp.cs:55)
UnityEngine.Events.InvokableCall.Invoke () (at <e98ed0368295432e8c11e52d6243ee11>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <e98ed0368295432e8c11e52d6243ee11>:0)
UnityEngine.UI.Button.Press () (at C:/Program Files/Unity/Hub/Editor/2019.3.15f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:68)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2019.3.15f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:110)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2019.3.15f1/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.3.15f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2019.3.15f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)

I get the above error

Manual save, auto save
Both will cause problems,
 
I'm unable to reproduce your bug. Could you make sure that you have the save component on the "Game" gameobject and the character.

On Game game object

1608798977598.png

on Player
1608799031013.png

I will look into other possible reasons you are getting this error

EDIT: I was able to reproduce the bug, I'm sorry about that, I will try to fix it asap and let you know once I do
 
Please find the new saver script attached, we'll update the integration with this fix asap.
It was a silly mistake where I wasn't saving all the items in the inventory, only some of them.

I apologize for the inconvenience caused
 

Attachments

  • InventoryBridgeSaver.cs
    11.5 KB · Views: 3
Please find the new saver script attached, we'll update the integration with this fix asap.
It was a silly mistake where I wasn't saving all the items in the inventory, only some of them.

I apologize for the inconvenience caused

The above issue has been resolved.
But a new problem arose.

In the UCC integration Demo scene
Get picked up items and end the game
Start the game again and get picked up items

If you repeat this operation about 10 times, the size of the save data will increase.
If it exceeds 2MB, the following error will occur and the item will disappear.

The size of the last save data was 16MB.

Even if you do not get the item,
the size of the save data will change even though the item in the inventory does not change.


This problem is manual save, auto save
It happens in both cases.

I sent the URL of the save data file in conversation.

ArgumentException: An item with the same key has already been added. Key: -1586222219
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <437ba245d8404784b9fbab9b439ac908>:0)
Opsive.Shared.Utility.Serialization.DeserializeFields (Opsive.Shared.Utility.MemberVisibility visibility, System.Func`3[T1,T2,TResult] onValidateCallback) (at <17bda34f13d441c9987fe102b2bbd7d5>:0)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.InventoryBridgeSaver.DeserializeAndLoadSaveData (Opsive.Shared.Utility.Serialization serializedSaveData) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/InventoryBridgeSaver.cs:134)
Opsive.UltimateInventorySystem.SaveSystem.SaverBase.Load () (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaverBase.cs:84)
Opsive.UltimateInventorySystem.SaveSystem.SaverBase.Start () (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaverBase.cs:63)
 
Last edited:
Thank you for letting us know about this issue.

I was able to reproduce it, but finding the bug was a bit more complicated.
I implemented an option to save the save data in a "debug"/"readable" format.

Thanks to that we believe we found the issue. It seems to be only relevant to the integration bridge saver.
We will let you know as soon as we pin point the exact cause and have it fixed.
 
The issue had to do with the ItemSetManager.

Changing it requires a UCC update which we plan to do at some point in January. I'll send you the file change by PM such that you can try it out right away or you can wait for the update
 
  • Like
Reactions: ymo
Top