Closed akintos closed 3 years ago
Should be an easy fix here, thanks
Ok it went a bit deeper than I thought but I'm pretty sure I fixed it. Let me know how this release goes for you https://github.com/sinai-dev/UnityExplorer/releases/tag/3.3.11
Thank you for the update.
SetColorBlock
raises TargetInvocationException
and another series of NullReferenceException
has occurred with UIFactory.CreateScrollbar
Unity log link: https://pastebin.com/ix3zsx3H
Mod Loader log link: https://pastebin.com/9pAtx0xF
Hmm ok, upon further inspection it seems that MelonLoader is not unstripping the UnityEngine.UI.dll
module.
Could you try with BepInEx instead?
version.dll
file in the game folder. Put it inside the MelonLoader folder or whatever.Wasteland 3\BepInEx\...
and Wasteland 3\winhttp.dll
BepInEx\unity-libs\
unity-libs
folderHopefully this works, otherwise I'm afraid I'm not sure we'll get much further.
Unfortunately, using BepInEx didn't help.
Is that from your first launch with BepInEx? I don't see any unstripping going on in the BepInEx log.
Well, not too sure what else to try, we need to get the unstripped UnityEngine.UI to be loaded somehow. Could you try just dropping this file into your BepInEx\unhollowed\
directory? (and unzipping it)
Hmm, that's odd, I'm setting the ColorBlock essentially the same way with 3.1.12 - https://github.com/sinai-dev/UnityExplorer/blob/12cd718f12cf35eaee7964940123de8fbd191fb9/src/UI/UIFactory.cs#L83
Strange that this doesn't throw the same exception then. I'll download the 2019.4.4 editor and have a look myself.
Sorry, I dropped UnityEngine.UI.dll
into wrong folder. Now it says Exception in IL2CPP-to-Managed trampoline, not passing it to il2cpp
[Error :Unhollower] Exception in IL2CPP-to-Managed trampoline, not passing it to il2cpp: System.NullReferenceException: Object reference not set to an instance of an object
at UnityExplorer.ExplorerCore.Update () [0x00001] in <9e84ace0bb214af5a07cc7f5d0126436>:0
at UnityExplorer.ExplorerBepInPlugin+ExplorerBehaviour.Update () [0x00001] in <9e84ace0bb214af5a07cc7f5d0126436>:0
at (wrapper dynamic-method) UnityExplorer.ExplorerBepInPlugin+ExplorerBehaviour.Trampoline_VoidThisUnityExplorer.ExplorerBepInPlugin+ExplorerBehaviourUpdate(intptr,UnhollowerBaseLib.Runtime.Il2CppMethodInfo*)
@Akintos need the full log to know whats happening there, most likely the first error will tell me what failed.
There's nothing more to see. BepInEx log file and nothing useful in UnityPlayer log.
Fair enough, strange. And you're sure 3.1.12 still works with older ML?
Yes, there is a bug with ForceUnlockCursor
though. It works fine if you do not hide and reopen the UI.
[10:22:35.654] Registered mono type MelonLoader.Support.MelonLoaderComponent in il2cpp domain
[10:22:35.668] Registered mono type UnhollowerRuntimeLib.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain
[10:22:35.678] ------------------------------
[10:22:35.678] Unity 2019.4.4
[10:22:35.678] OS: Microsoft Windows NT 10.0.19042.0
[10:22:35.679] ------------------------------
[10:22:35.679] Name: Wasteland 3
[10:22:35.679] Developer: InxileEntertainment
[10:22:35.679] Type: Il2Cpp
[10:22:35.680] ------------------------------
[10:22:35.680] Using v0.2.7.4 Open-Beta
[10:22:35.680] ------------------------------
[10:22:35.878] No Plugins Loaded!
[10:22:35.879] ------------------------------
[10:22:35.879] UnityExplorer v3.1.12 by Sinai
[10:22:35.880] Game Compatibility: Universal
[10:22:35.880] ------------------------------
[10:22:36.911] [UnityExplorer] Initializing Legacy Input support...
[10:22:37.030] [UnityExplorer] UnityExplorer 3.1.12 initialized.
[10:22:37.870] [UnityExplorer] Loaded UI bundle
[10:22:38.977] [UnityExplorer] Initialized UnityExplorer UI.
[10:23:23.314] [UnityExplorer] [Error] UnhollowerBaseLib.Il2CppException: System.NullReferenceException: Object reference not set to an instance of an object.
at UnhollowerBaseLib.Il2CppException.RaiseExceptionIfNecessary (System.IntPtr returnedException) [0x00018] in <583918877c33430fa1dd04c070650e0d>:0
at UnityEngine.Behaviour.set_enabled (System.Boolean value) [0x00048] in <513cfff6bb57493c89c920b5b2f59ed1>:0
at UnityExplorer.UI.ForceUnlockCursor.SetEventSystem () [0x0006b] in <e82e5b1eb803461fa4acb8f1f52b036a>:0
at UnityExplorer.ExplorerCore.SetShowMenu (System.Boolean show) [0x00027] in <e82e5b1eb803461fa4acb8f1f52b036a>:0
at UnityExplorer.ExplorerCore.set_ShowMenu (System.Boolean value) [0x00000] in <e82e5b1eb803461fa4acb8f1f52b036a>:0
at UnityExplorer.ExplorerCore.Update () [0x0003d] in <e82e5b1eb803461fa4acb8f1f52b036a>:0
at UnityExplorer.ExplorerMelonMod.OnUpdate () [0x00001] in <e82e5b1eb803461fa4acb8f1f52b036a>:0
at MelonLoader.MelonHandler.OnUpdate () [0x000a3] in <1439d668687c44d0920b0e0ecea592c0>:0
Update again: Finally figured out what's going on here.
The issue is simply that I am creating the UI too quickly. Looks like this game is doing some stuff to destroy all GameObjects on startup, so I just need to wait a second or so for that.
Fix will be pushed shortly.
So the problem was UI being initialized too early? Thank you very much for the fix!
Yep, can't believe I didn't think of it sooner. I used to wait a bit before creating the UI but recently I started making it straight away, seems that some games still don't like that.
Game issue occurs on: Wasteland 3
UnityExplorer version: MelonLoader Il2Cpp 3.3.10
MelonLoader version: 0.3.0.0
Description of issue: Failes to initialize UI on load, blank box is displayed
Unity log link: https://pastebin.com/E13azkEn
Mod Loader log link: https://pastebin.com/z9qktrzx
Works fine on MelonLoader v0.2.7.4, UnityExplorer v3.1.12.