Inventory Canvas issue

SOSolacex

Member
Hi, I have absolutely no clue what I changed/accidentally clicked to make this happen as this happened shortly after looking through the UI designer.. but now my UI is entirely broken.
I'm getting these errors:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase.Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:196)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainer.Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainer.cs:46)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerPanelBinding.OnInitializeBeforeInventoryBind () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerPanelBinding.cs:62)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.InventoryPanelBinding.Initialize (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel display, System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/InventoryPanelBinding.cs:42)
Opsive.UltimateInventorySystem.UI.Panels.ItemViewSlotContainers.ItemViewSlotsContainerPanelBinding.Initialize (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel display, System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/ItemViewSlotContainers/ItemViewSlotsContainerPanelBinding.cs:42)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel.Setup (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager manager, System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:130)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.SetupDisplayPanels (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:129)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.SetPanelOwner (UnityEngine.GameObject panelOwner) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:155)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:118)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager.Awake () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanelManager.cs:78)

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel.SmartOpen () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:163)
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel.Start () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/DisplayPanel.cs:140)

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Grid.GridGeneric`1[T].Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridGeneric.cs:64)
Opsive.UltimateInventorySystem.UI.Panels.Save.PixSaveGrid.Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/Save/PixSaveGrid.cs:40)
Opsive.UltimateInventorySystem.UI.Grid.GridBase.OnEnable () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridBase.cs:216)

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Grid.GridGeneric`1[T].ViewSelected (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridGeneric.cs:141)
Opsive.UltimateInventorySystem.UI.Grid.GridEventSystem.SelectedButton (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridEventSystem.cs:177)
Opsive.UltimateInventorySystem.UI.Grid.GridEventSystem+<>c__DisplayClass60_0.<Initialize>b__1 () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridEventSystem.cs:106)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton.OnSelect (UnityEngine.EventSystems.BaseEventData eventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:296)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.ISelectHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2020.3.4f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:106)
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/2020.3.4f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:262)
UnityEngine.EventSystems.EventSystem:SetSelectedGameObject(GameObject)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton:OnPointerEnter(PointerEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:206)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2020.3.4f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:385)

And quite honestly I am lost on why it's happening.
Edit: I fixed some of it, but so far my save grid is now creating issues. It does say the grid box drawer is null, but I am not sure where exactly I fix that issue.
 
Last edited:
Were you able to fix it?

I think the grid box drawer is referering to the "Grid View Drawer" component (let me know the error line such that I can rename it)

What I would recommend is that you use the UI Designer to create a new save menu in another scene and then compare the two (or compare it with the one from the main demo) that could help you find what is missing.

If you ever find how that whole problem started do let me know so that I can try to reproduce it and fix it
 
Were you able to fix it?

I think the grid box drawer is referering to the "Grid View Drawer" component (let me know the error line such that I can rename it)

What I would recommend is that you use the UI Designer to create a new save menu in another scene and then compare the two (or compare it with the one from the main demo) that could help you find what is missing.

If you ever find how that whole problem started do let me know so that I can try to reproduce it and fix it
As far as the grid box drawer goes, it's a warning not an error(However, it pops up along with the errors), but here is what it says in the console:

Grid Box Drawer is null for .
0x00007ff74592dc5c (Unity) StackWalker::GetCurrentCallstack
0x00007ff745936039 (Unity) StackWalker::ShowCallstack
0x00007ff746e0fd2c (Unity) GetStacktrace
0x00007ff747f00983 (Unity) DebugStringToFile
0x00007ff745964526 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x00000202b1c605cb (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x00000202b1c604fb (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x00000202b1c60240 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x00000202b1d9ba88 (Mono JIT Code) UnityEngine.Debug:LogWarning (object)
0x00000202b1c4f77b (Mono JIT Code) [GridGeneric.cs:64] Opsive.UltimateInventorySystem.UI.Grid.GridGeneric`1<T_REF>:Initialize (bool)
0x00000202b24bde1b (Mono JIT Code) [PixSaveGrid.cs:42] Opsive.UltimateInventorySystem.UI.Panels.Save.PixSaveGrid:Initialize (bool)
0x00000202b24bdb2a (Mono JIT Code) [GridBase.cs:218] Opsive.UltimateInventorySystem.UI.Grid.GridBase:OnEnable ()
0x00000202b20bd450 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe764fe640 (mono-2.0-bdwgc) [mini-runtime.c:2812] mono_jit_runtime_invoke
0x00007ffe76482ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
0x00007ffe7648bb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
0x00007ff7457a7cf4 (Unity) scripting_method_invoke
0x00007ff7457a0645 (Unity) ScriptingInvocation::Invoke
0x00007ff745763cb4 (Unity) MonoBehaviour::CallMethodIfAvailable
0x00007ff7457624b2 (Unity) MonoBehaviour::AddToManager
0x00007ff745762da1 (Unity) MonoBehaviour::AwakeFromLoad
0x00007ff7458b7428 (Unity) AwakeFromLoadQueue::InvokeAwakeFromLoad
0x00007ff7458b043d (Unity) AwakeFromLoadQueue::AwakeFromLoad
0x00007ff744941a6a (Unity) GameObject::ActivateAwakeRecursively
0x00007ff74494c869 (Unity) GameObject::SetSelfActive
0x00007ff745a6059b (Unity) GameObject_CUSTOM_SetActive
0x000002027f89e186 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.GameObject:SetActive (UnityEngine.GameObject,bool)
0x00000202b1dca4d3 (Mono JIT Code) [DisplayPanel.cs:243] Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel:Open (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel,UnityEngine.UI.Selectable,bool)
0x00000202b24bd9cb (Mono JIT Code) [MainMenu.cs:129] Opsive.UltimateInventorySystem.UI.MainMenu:OpenSubPanel (int)
0x00000202b24bd703 (Mono JIT Code) [MainMenu.cs:98] Opsive.UltimateInventorySystem.UI.MainMenu:OnOpen ()
0x00000202b1dca7c1 (Mono JIT Code) [DisplayPanel.cs:305] Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel:OpenInternal ()
0x00000202b1dca55c (Mono JIT Code) [DisplayPanel.cs:250] Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel:Open (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel,UnityEngine.UI.Selectable,bool)
0x00000202b1dca454 (Mono JIT Code) [DisplayPanelManager.cs:280] Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager:OpenPanel (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel)
0x00000202b24bd643 (Mono JIT Code) [DisplayPanelManager.cs:215] Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager:TogglePanel (Opsive.UltimateInventorySystem.UI.Panels.DisplayPanel)
0x00000202b24bd50b (Mono JIT Code) [DisplayPanelManager.cs:203] Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManager:TogglePanel (string)
0x00000202b1deaec3 (Mono JIT Code) [DisplayPanelManagerHandler.cs:129] Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelManagerHandler:Update ()
0x00000202b20bd450 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffe764fe640 (mono-2.0-bdwgc) [mini-runtime.c:2812] mono_jit_runtime_invoke
0x00007ffe76482ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
0x00007ffe7648bb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
0x00007ff7457a7cf4 (Unity) scripting_method_invoke
0x00007ff7457a0645 (Unity) ScriptingInvocation::Invoke
0x00007ff745763cb4 (Unity) MonoBehaviour::CallMethodIfAvailable
0x00007ff745763dbc (Unity) MonoBehaviour::CallUpdateMethod
0x00007ff744c38da8 (Unity) BaseBehaviourManager::CommonUpdate<BehaviourManager>
0x00007ff744c42cfa (Unity) BehaviourManager::Update
0x00007ff7450a6cba (Unity) `InitPlayerLoopCallbacks'::`2'::UpdateScriptRunBehaviourUpdateRegistrator::Forward
0x00007ff745087f7c (Unity) ExecutePlayerLoop
0x00007ff745088053 (Unity) ExecutePlayerLoop
0x00007ff74508ef09 (Unity) PlayerLoop
0x00007ff7464ae621 (Unity) PlayerLoopController::UpdateScene
0x00007ff7464ac2b6 (Unity) Application::TickTimer
0x00007ff746e19521 (Unity) MainMessageLoop
0x00007ff746e1d561 (Unity) WinMain
0x00007ff748c95fc6 (Unity) __scrt_common_main_seh
0x00007ffee2077034 (KERNEL32) BaseThreadInitThunk
0x00007ffee3982651 (ntdll) RtlUserThreadStart
As for the rest I am still trying to figure things out unfortunately
 
In the warning message above it mentions a PixSaveGrid component. Is this a custom component you made or something that comes from a thrid party perhaps PixelCrusher? It is not a component in the UIS code base.

The warning says that you are missing the grid view drawer. for the Save grid that would be a save view drawer. If you check the one in the demo it will look something like that:
1654587870841.png

Something else that I found odd with your wanring is how it did not pring the panel.
Are you sure that you've set the display panel with the save menu?
1654588090148.png


Like I mentioned previously I would recommend you compare your save menu setup with the one from the demo or create a new save menu to compare it with yours and then try to fix it by adding the things that are missing
 
Hey, it's basically the save grid script but with small changes to use the dialogue system save method instead. (Opsive's system gave me some issues a while ago)
I've updated the script to fit with the latest version, and everything is set correctly when comparing it to a clean setup. It used to work perfectly too, which is why I am quite confused how this suddenly happened.

I decided to revert to the opsive scripts for a second to see how they would perform..
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Grid.GridGeneric`1[T].ViewSelected (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridGeneric.cs:141)
Opsive.UltimateInventorySystem.UI.Grid.GridEventSystem.SelectedButton (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridEventSystem.cs:192)
Opsive.UltimateInventorySystem.UI.Grid.GridEventSystem+<>c__DisplayClass60_0.<Initialize>b__1 () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/GridEventSystem.cs:106)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton.OnSelect (UnityEngine.EventSystems.BaseEventData eventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:316)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.ISelectHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2020.3.4f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:106)
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/2020.3.4f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:262)
UnityEngine.EventSystems.EventSystem:SetSelectedGameObject(GameObject)
Opsive.UltimateInventorySystem.UI.PreventSelectableDeselection:Update() (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/PreventSelectableDeselection.cs:61)

1654635980882.png
1654635990182.png
1654636015071.png
 
Last edited:
Could you add a Debug.Log or add a breakpoint and step through the code in the "Initialize" function of the SaveGrid script?
My suspicion is that it is not being initialized and that's why ViewDrawer reference is null.
The ViewDrawer is set in the base class (GridGeneric) Initialize function.

If that is indeed the case then it might be Unity acting up. In the SaveMenu component remove and re-add the SaveGrid reference.
 
I'll admit that I have no clue what is going on, however it's making me extremely annoyed.

So there are a couple of things.
-I removed the save menu and save grid comments, added the opsive ones again.. and it suddenly started working.
-Then I swapped them with the pixelcrusher versions again, and boom, I had the grid issue. Thus I was confused as to why the opsive one worked fine before.
-I then once again swapped back to the opsive ones, and I still have the grid issue.
However not only am I running into the grid issue now, now multiple of my menu buttons do not work. I cannot close the main menu, I cannot open or close the save menu, only opening the quest log seems to work (No error codes, the buttons just don't do anything), I had an issue where hovering over the equipment panel would cause a displayselect error for whatever reason which magically solved itself and I've been running into an issue (although I've had that one before all this) where moving an item from the equipment panel to the inventory menu causes a crash.

Ill give you another heads-up when I've actually gotten some more useful info, just figured I'd inform you of how it's currently going.

Edit: Going to stick with opsive's save grid for a bit now that it's actually somewhat stable, also finally got all the other issues to away. Can't say I am certain how but I can finally focus on some newer issues again
 
Last edited:
Top