Norbyte / bg3se

Baldur's Gate 3 Script Extender
Other
1.13k stars 67 forks source link

Fix for BG3 Mod Manager not Detecting Script Extender + Crash on Startup #429

Open Silvenga opened 2 months ago

Silvenga commented 2 months ago

I have attempted solutions to common problems

Yes

I have checked that my game version is supported

Yes

OS

Windows 11

Platform

Steam

Description

This isn't a bug, just wanted to document what I've been seeing as a common issue - either crashes of BG3 (regardless of other mods being installed) or the weird error of BG3 Mod Manager not detecting an installed SE (e.g. the MISSING error).

Assuming everything is up-to-date, .NET 7 is installed, etc. The Mod Manger toolkit executable, which hooks into DWrite.dll via P/Invokes appears to silently ignore errors during the native load process (noop if load library fails).

There's also a silent failure around .NET 7 not being installed. .NET 7 is end-of-life, so it might have been automatically removed. Hopefully the manager will be updated to .NET 8 LTS at some point.

The logs might look like this on a failure:

[MainWindowViewModel.cs:ShowAlert(4348)] Successfully installed the Extender updater DWrite.dll to 'E:\Programs\SteamLibrary\steamapps\common\Baldurs Gate 3\bin'
[MainWindowViewModel.cs:LoadExtenderSettingsAsync(825)] Loaded E:\Programs\SteamLibrary\steamapps\common\Baldurs Gate 3\bin\ScriptExtenderSettings.json
[MainWindowViewModel.cs:LoadExtenderSettingsAsync(843)] Loaded E:\Programs\SteamLibrary\steamapps\common\Baldurs Gate 3\bin\ScriptExtenderUpdaterConfig.json
[MainWindowViewModel.cs:CheckExtenderUpdaterVersion(650)] Looking for Script Extender at 'E:\Programs\SteamLibrary\steamapps\common\Baldurs Gate 3\bin\DWrite.dll'.
[MainWindowViewModel.cs:CheckExtenderUpdaterVersion(653)] Checking DWrite.dll for Script Extender ASCII bytes.
[MainWindowViewModel.cs:CheckExtenderUpdaterVersion(660)] Found the Extender at 'E:\Programs\SteamLibrary\steamapps\common\Baldurs Gate 3\bin\DWrite.dll'.
[MainWindowViewModel.cs:UpdateExtender(566)] Running 'E:\BG3ModManager_Latest\Tools\Toolbox.exe' to update the script extender.
[MainWindowViewModel.cs:OnToolboxOutput(551)] [Toolbox] Updating...
[MainWindowViewModel.cs:OnToolboxOutput(551)] [Toolbox] Update finished

The UI might say success, but there was a silent failure. There should be a message like:

[MainWindowViewModel.cs:CheckExtenderInstalledVersion(741)] Script Extender version found (19)

I was pulling my hair out, I suspected some recent Windows mitigations against DLL injection/loading might have been the culprit. So I was pulling out all the tools to track that down... checking for anti-virus tampering with loads, disabling exploit mitigations in Windows, etc. ugh!

Ultimately for myself, on a hunch, I had to close Steam before anything worked and BG3 stopped crashing. BG3 was not running at the time (it would crash in ntdll), I wished I checked what handles were open, I suspect Steam was doing "something".

Maybe useful to someone. ¯\(ツ)

Indications

No response

Diagnostic Files

No response

Steps to Reproduce

No response

Expected Behavior

No response

Actual Behavior

No response

LooneyLuny commented 2 months ago

I'm having this problem right now and cannot figure out what the problem is. I tried closing Steam, but that didn't seem to fix anything. My problem is that BG3MM isn't recognizing that I have the SE installed. I've installed it via the Tools option and tried installing it manually, but it just keeps telling me that I have mods requiring it and I can install it using the Tools tab. Lies! @.@

Have you found any other reason behind it?

Silvenga commented 2 months ago

Have you found any other reason behind it?

Really, I think it's most likely due to silent errors from BG3MM. Did you make sure that .NET 7 is installed? If missing, that would also make the install detection break.

LooneyLuny commented 2 months ago

Have you found any other reason behind it?

Really, I think it's most likely due to silent errors from BG3MM. Did you make sure that .NET 7 is installed? If missing, that would also make the install detection break.

I do have it. But it just started working suddenly and I have no idea why. I had given up, removed the SE mods, and launched the game, then decided to install another I had seen. So I closed the game, downloaded that mod, but when I went back into BG3MM this time, I noticed the SE mod didn't have the red ! anymore. So I enabled it again, launched the game and it's been working fine. I have no idea what happened. @.@