Inventory Bridge error

Chuc

New member
i am getting this error after i got the save system to work and i dont understand what is happening

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.InventoryBridgeSaver.OnWillStartLoading (System.Int32 saveIndex) (at Assets/Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Scripts/InventoryBridgeSaver.cs:131)
Opsive.Shared.Events.InvokableAction`1[T1].Invoke (T1 arg1) (at <c8e5381e72fc4f3ba22ae5029e6e4da1>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1] (System.String eventName, T1 arg1) (at <c8e5381e72fc4f3ba22ae5029e6e4da1>:0)
Opsive.UltimateInventorySystem.SaveSystem.SaveSystemManager.LoadInternal (System.Int32 saveIndex, Opsive.UltimateInventorySystem.SaveSystem.SaveData saveData) (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaveSystemManager.cs:558)
Opsive.UltimateInventorySystem.SaveSystem.SaveSystemManager.LoadFromDisk (System.Int32 saveIndex) (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaveSystemManager.cs:542)
Opsive.UltimateInventorySystem.SaveSystem.SaveSystemManager.Load (System.Int32 saveIndex) (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaveSystemManager.cs:278)
Opsive.UltimateInventorySystem.SaveSystem.SaveSystemManager.SceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode loadSceneMode) (at Assets/Opsive/UltimateInventorySystem/Scripts/SaveSystem/SaveSystemManager.cs:205)
UnityEngine.SceneManagement.SceneManager.Internal_SceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode) (at <9baebf9af86541678fd15bfdbf5f26eb>:0)
 
It would seem you are trying to load a save data before the InventoryBridgeSaver was able to Awake.
Or you have not set the InventoryBridgeSaver on the same component as the InventoryBridge.
 
okay thank you for the reply. I have the InventoryBridgeSaver and the InventoryBridge on my player character. Is this right? And if it is how would i fix the loading in wrong order of save data and bridge
 
okay thank you for the reply. I have the InventoryBridgeSaver and the InventoryBridge on my player character. Is this right?
Yes

And if it is how would i fix the loading in wrong order of save data and bridge

Add a Debug.Log(gameobject) in the awake function and just before the error line of the InventoryBridgeSaver. And another just before you are trying to load the save data.
I'm wondering if you have another character in your scene somewhere with an InventoryBridgeSaver and no InventoryBridge
 
Sorry been to busy to get into making my game.

So i added a debug log into the scripts where you said and there is only one Player.

I added a debug log into saveBase
1662602577247.png
(i made them error logs so it is easier to find them)
The save function gets called when i scene transition and quit but it doesnt get called when i save the game. Load never gets called.

I still think i am doing something wrong with the save menu. Because it all works with scene transition.

1662602894647.png

1662603098401.png
(On my player)

Atm the game will only save the player location when using the save menu. When using the scene portal it will save the inventory.
 
I am using the one out of this folder
1662772683584.png


I am pretty sure i followed that document but ill take another look at it now to make sure i got it write.
 
Top