博德之门3v0.3.12026年10月12日 更新

Yet Another BG3 Native Mod Loader

Yet Another BG3 Native Mod Loader This is a dll plugin mod loader for Baldur's Gate 3 It comes in 3 types: - (Watcher) A background process which watches for bg3 to start, then transparently injects the plugins into it. - (Injector) A one time use separate injector tool which simply injects plugins into an already running game instance. (For those who do not want an always running app) - (Autostart) A version which behaves exactly like Native Mod Loader. It automatically runs and patches bg3 whe

Yet Another BG3 Native Mod Loader

This is a dll plugin mod loader for Baldur's Gate 3

It comes in 3 types:

  • (Watcher) A background process which watches for bg3 to start, then transparently injects the plugins into it.
  • (Injector) A one time use separate injector tool which simply injects plugins into an already running game instance. (For those who do not want an always running app)
  • (Autostart) A version which behaves exactly like Native Mod Loader. It automatically runs and patches bg3 when the game is started normally. However, it requires (some fairly minimal) registry edits in order to accomplish this.

The main features of this mod loader are:

  • No manual installation necessary!*
  • It does not modify any game files or touch the installation directory
  • Because it does not modify/replace/add files in the game directory, there is 0 maintenance required
  • 0 maintenance means, when you update the game, there is nothing to fix, the mod loader always works
  • You can keep all your game files pristine and untouched
  • It is completely compatible with any NativeModLoader plugins
  • This means you can develop your plugin using my Rust Native Plugin Template or NativeModLoader's BG3 Plugin Template.
  • Compatible with Steam and GoG
  • Stores your plugins in the larian local data folder alongside the mod folder
  • Does not install anything. Deleting the tool is the same as "uninstalling"*
  • The injector and watcher do not require (un)installation. However, the autostart tool does require (un)installation.

This tool only supports Windows. It does not currently support Mac/Linux/WINE/Proton, but future support for WINE is being considered. Autostart is not currently compatible with WINE, but Injector/Watcher may work, but has not been tested.

Source Code: https://github.com/MolotovCherry/Yet-Another-BG3-Native-Mod-Loader

Getting started**

Manual**

  • Download one of the 3 types (autostart is the most recommended)
  • Place the tools wherever you want*. In the case of watcher/injector, you may also want to create shortcuts to them.
  • Make sure you keep loader.dll along with them. They depend on this file.** DO NOT** place** loader.dll** inside the plugins folder. It is not a plugin. As such, placing it inside the plugins folder can cause issues as it was not designed to be placed there.

**

Vortex

**Mod Manager installation is not required for the tools to properly function. It is only provided for ease of installation.

  • Download via "mod manager download" button
  • Install with "engine injector" mod type.*

If this is your first time, on the first run, the tool will set things up for you and give you a finish setup message; read it and follow the instructions.

  • The steps may be slightly different since Vortex might have changed things between versions. I tested this on the latest Vortex version, and for me, if the game is already set to managed and you downloaded the mod, it is auto-installed and already set to enabled. The files were already inside the bin folder, and I didn't have to do any other steps such as "install with engine injector" or "install as replacer". If in doubt, check your bin folder. If you see the files inside your bin folder, the work is already done.

**

How to use:**

  • Autostart
  • (If tool is not yet installed) Run install.bat or autostart-installer.exe

*Do not move the tool files after you've installed. If you want to move it, uninstall, move it, then reinstall.

If you delete the tools, make sure to uninstall it first. The game won't start otherwise.*

  • Start your game normally
  • Watcher
  • Start the watcher tool. It will stay open in the background and keep patching the game when it loads*

The first time you start the tool, a plugin folder and config file will be created. Please double check the install_root key (see Config options section below) and ensure it is correct.

  • Run the game as you normally would
  • Whenever you want to stop using this tool, go to your systray, right click on the mod loader icon, and click "Quit"
  • Injector
  • Run the injector tool once within 10 seconds before you start the game

The first time you start the tool, a plugin folder and config file will be created. Please double check the install_root key (see Config options section below) and ensure it is correct.

  • Run the game as you normally would*
  • Tool will close once successful (or timeout after 10 seconds if it can't find the process)

It is allowed to run the injector tool after the game process has already started, however you should do this before you load your actual save game, and you should note that plugins generally expect to be loaded on game startup. If they aren't, it is possible they may not work correctly. So it is preferable to start the tool right before you start the game to prevent problems*

Important: this goes without saying, but you should not have NativeModLoader installed if you use these tools, as they will conflict with each other.

  • If the tool doesn't detect the game, even though you have the correct install_root, you may need to run the tool as admin. In most cases this shouldn't be required, but in rare cases the tool may not have permissions to detect the game process.

Uninstall

For watcher and injector, they do not install themselves. To "uninstall" it, simply delete the tools you downloaded.

For autostart, run uninstall.bat

You may also manually uninstall autostart by deleting the following registry keys. Do be careful to delete only these. link to video guide

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\bg3.exe

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\bg3_dx11.exe

Config options

The config file can be found at %LocalAppData%\Larian Studios\Baldur's Gate 3\Plugins\config.toml; the default configuration looks like:

[core]

*# quick switch to globally enable or disable plugin loading

this is a very useful option when you want to temporarily disable

the autostart tool*

enabled = true

# bg3's root installation dir; please change this to the correct root directory for bg3

install_root = 'C:\Program Files (x86)\Steam\steamapps\common\Baldurs Gate 3'

*# a list of dll plugins by filename (no extension) to selectively disable

for example, to disable FooBar.dll and BarBaz.dll, do:

["FooBar", "BarBaz"]*

disabled_plugins = []

# whether to show console window

cli = false

[log]

*# increase verbosity of logs. useful when debugging. please set to "trace"

if you're making a bug report with logs*

level = "info"

target = false

**Installing plugins

**Any plugins and files that you'd normally place in

**    C:\Program Files (x86)\Steam\steamapps\common\Baldurs Gate 3\bin\NativeMods**

Should be placed instead in

**    **%LocalAppData%\Larian Studios\Baldur's Gate 3\Plugins

Some plugins mod game dlls themselves. If a plugin modded a game dll, the modded dll must be installed according to their instructions - in the game's bin directory and replacing the game dll with theirs. This is because a modded game dll is not a plugin, and the game itself uses/requires it. This of course only applies to the modded dll itself. Their plugin will of course work normally according to the plugin installation instructions above

*Please note that many native dll plugins are not yet aware of this new path and might try to read and/or save configs/logs to <game_dir>\bin\NativeMods, which - if you saved/edited the plugin config from the plugin folder - will cause the plugin to not see your changes since it's reading a different file from a different path. A quick temporary solution is to symlink the paths so they point to the same config file (see below instructions). You might want to contact the respective plugin devs and tell them they need to fix that. That's an oversight on the plugin's side, as they shouldn't be reading their config from absolute paths.

*How do I symlink to fix the config file bug?

  • Search for cmd and open Command Prompt (note: you may need to run it as administrator. right click on the item in the search and Run as administrator, then click Yes)
  • Type in cd "<my_game_dir>\bin". Make sure to replace <my_game_dir>\bin with the full path to your game installation directory, e.g. C:\Program Files (x86)\Steam\steamapps\common\Baldurs Gate 3\bin. If your game is located on a different drive than C:, then the command should be cd /D "<my_game_dir>\bin"
  • If <my_game_dir>\bin\NativeMods already exists, then please delete it (you may first want to back it up if you want to keep the contents). You can move the contents over to %LocalAppData%\Larian Studios\Baldur's Gate 3\Plugins, or do whatever you want with the backup.
  • Type in mklink /D NativeMods "%LocalAppData%\Larian Studios\Baldur's Gate 3\Plugins"
  • You're done!

** If you instead want NativeMods to be the folder where plugins are located, you can reverse the process. Make a folder at <my_game_dir>\bin\NativeMods, move the contents of %LocalAppData%\Larian Studios\Baldur's Gate 3\Plugins to it, then delete the Plugins folder, run cd "%LocalAppData%\Larian Studios\Baldur's Gate 3" and then mklink /D Plugins "<my_game_dir>\bin\NativeMods"*

Making plugins

You can use my Rust Native Plugin Template or NativeModLoader's BG3 Plugin Template. What you use doesn't really matter much, just as long as it's a dll with a DllMain that does its hooking at runtime.

Support

If you need help with something, you can post comment in the comment section, or join my discord server and ask for help there (#yet-another-bg3-mod-loader channel under Support category)

FAQ

I got a smartscreen warning, how do I remove it?

If the files are not widely distributed yet, you may also receive a SmartScreen popup on windows when you run it. You can remove it by following these instructions.

**Can I have native mod loader installed?

**Please don't use this mod loader when the other one is installed. That could load dll plugins twice (if you have them in both places), when they're only supposed to be loaded once. I have no idea what would happen.

**Dll plugins could be dangerous

**Dll plugins run executable code. This loader will run any dll, regardless whether it's a plugin or was made for this game or not. Make sure you trust whatever plugins you are running!

**Why this tool instead of Native Mod Loader?

**Native Mod Loader modifies core game files. The game was designed to work with vanilla game files. If core DLL game files are modified, it may cause weird, undesirable, "random" problems which cannot be predicted. (I've seen a lot of bug reports).

The main reason I made this tool was because seeing that honestly scared me a bit, and I didn't want to gamble with my game. I wanted something safe and easy that just works.

Therefore, this mod loader modifies no game files at all! It is safer to use, and has none of those strange bugs, while achieving the exact same end result. Not only is it safer, but because it modifies 0 core game files, you will never have to replace any game DLL's when you update your game!

There's also another happy side effect of this design. It's easier, faster, and just works with minimal setup required! 

Cleaner = better 😁

**Do the tools work when the game updates?

**Game updates will not break this tool. This tool will always be compatible with the game based on the way it was designed. However, the plugins you have may require an update in order to function properly again. Please check each respective authors plugin page for updates if their plugin stops working.

**You use the word "patch" when talking about this? Patching is permanent isn't it?

**I'm using the word "patch" when referring to the game instance in order to keep the terms as simple to understand as possible. The game instance is only patched in memory. No core files are ever modified. This means, when you start the game again without the tools, it's the same vanilla game installation that you've always had. In other words, the word "patch" describes a game instance you already injected plugins into.

How do I disable plugins?

To disable the native dll plugins, you can do one of the following:

  • Move the files out of the plugins folder (or put them in a subfolder. just not directly in the plugins folder)
  • Set enabled to false in the config
  • add the plugin name to the disabled_plugins field in the config (%LocalAppData%\Larian Studios\Baldur's Gate 3\Plugins\config.toml)
  • for more info on this, see the config options section
  • If you're using the watcher tool, quit it. Or, don't open the injector. If using autostart tool, uninstall it

Is this compatible with NativeModLoader plugins

100% compatible! Just as long as the mod doesn't rely on any NativeModLoader specific behavior (if so, file an issue with the plugin author!)

Please note that many native dll plugins are not yet aware of this new path and might try to read and/or save configs/logs to **<game_dir>\bin\NativeMods*.A quick temporary solution is to symlink <game_dir>\bin\NativeMods* to your local Plugins folder

**My path has a single/double quote in it, what do I do?

**Ordinarily you can use a regular path with a literal string in toml like so

**install_root = 'C:\Program Files (x86)\Steam\steamapps\common\Baldurs Gate 3'

**But if you have a single quote in your path, it's not possible to parse a string with 3 single quotes, since there's no way for the program to know where the beginning and end of the string is.

Instead, use double quotes like so:

**install_root = "C:\Program Files (x86)\Steam\steamapps\common\Baldur's Gate 3"

**Note here that all ** in the source string now need to be escaped with an additional ****. If you have a double quote anywhere in the path, also escape it with a ** like so

install_root = "C:\Program Files (x86)\Steam\steamapps\common\Baldur's "Gate" 3"

The tool files keep disappearing! / My AV is detecting them!

This is most likely caused by your AV (antivirus) programs quarantining the files. If this happened to you, please check any AV software you

have and make an exception for each individual file (all exes and the dll).

To add exceptions for Windows Security (the built-in Windows security solution), please check here in the **Virus & threat protection settings **section and the Exclusions dropdown.

For other AV programs, please check the manual for your specific product.

Note: If the files get placed in a different location than where they initially were (maybe you re-downloaded them), please ensure you uninstall and reinstall.

My plugin isn't loaded into the game!

Please first check the logs to see if the plugin is getting loaded when you start the game.

If the plugin is getting loaded, check if the plugin is compatible with your game version. If it's not, then you need to update your plugin to a compatible version. If it is compatible and still not working, then please file a bug report with the plugin dev, since this means their plugin is not working properly. If it is, and you're running the injector, it's possible you may be running it too late. Try running it right before you start the game.

If you don't see the plugin getting loaded in the logs, you may need to run the program as admin. This is very rare and should almost never be required, so only try this as a last resort. This only happens in cases where the user the loader is running under doesn't have required permissions to OpenProcess on the game (in which case, the loader will skip the process transparently, since it has no way of knowing whether it's the game process or not. This ends up with the game process not being found - and thus no plugins loaded, even though it's running)

**It works, but the plugin isn't loading plugin configs!

**Many native mod loader plugins are not aware of the new path to the local Plugins folder, and are hard coded to look for their configs at <game_dir>\bin\NativeMods. You can solve this by symlinking <game_dir>\bin\NativeMods to %LocalAppData%\Larian Studios\Baldur's Gate 3\Plugins

My plugin doesn't work / is broken!

If this happened, either there is a problem with the plugin, it has a bug, it was not set up correctly, or you need to update the plugin (check the authors page for an update). If it's a problem with the plugin, then you should report your bug/issue to the plugin's author/page.

**I got a strange warning popup, what do I do?

**Unless you're getting the warning consistently, a warning is only a warning. The winapi can - at rare times - fail and get the program into a state it cannot handle. The warning is there to just tell you that injection failed due to a rare exceptional circumstance. If this rare warning happens to you, just click Ok on the message box, restart your game, and you'll likely never see the warning ever again.

Unless you see the warnings consistently, you can completely ignore rare one-off warnings. Anything truly worthy of being an error will show an error pop up instead.

**I got a warning about "game process is dirty; aborting injection" ?

**"dirty" refers to the fact that the process has already been patched. It means you're trying to inject plugins into an already patched game instance. The warning is harmless.

Also see below answer.

**What happens if I try to use this on an already patched game instance?

**This mod loader detects if the game has already been patched and aborts patching the already patched game instance. This is done to protect your game from any potential damage. You can re-patch the game instance by restarting the game and letting the tool re-patch a fresh game instance.

**I got kicked from multiplayer, why?

**The cause could be (incompatible?) content mods, dll plugins, or any editing to game files you may have done. Try disabling all your mods and re-enabling them one by one to see which is the offender.

**How can I debug / provide debug reports to you?

**In the config, please set [log]level to "trace". Try to retrigger your bug or crash. The logs will give me plenty of info after that.

If you are getting a tool crash (NOT game crash), please also download the optional "Dbg Symbols" file and place the files right beside the exe. This will give much better stacktrace information for me.

Can you support loading plugins from <gamefolder>/bin/NativeMods instead?

This won't be added as a feature, because one of the core goals of this mod loader is to never ever, under any circumstances, touch or mess with the game's core installation. Supporting and allowing that - even if it's only a folder - would go against this goal. However, you can move your plugins over to the plugin folder. Note, there is still a way to do this, read below!

You can still do this if you want to! Just symlink <gamedir>/bin/NativeMods to your local Plugins folder! If you'd prefer the NativeMods folder to be your "source of truth" instead, you can do the reverse and symlink the local Plugins folder path to <gamedir>/bin/NativeMods.

**What are all the things this mod loader does?

**This mod loader:

  • checks for/creates a plugins folder and files, %LocalAppData%\Larian Studios\Baldur's Gate 3\Plugins, config.toml file, a log folder under the plugins folder, and log file(s) inside of the log folder
  • (watcher) continually sits in the background, watching for the game process.
  • (injector) will do the same thing above, but only once (times out within 10 seconds).
  • (autostart) uses registry keys to hijack the game process launch; automatically starts instead of bg3 when you launch the game through normal means, and launches the game under debug mode (to prevent windows from starting our tool again), then cancels the debug mode (we don't need it).
  • (all) once found, injects loader.dll into game process, which takes care of loading any enabled plugins in %LocalAppData%\Larian Studios\Baldur's Gate 3\Plugins
  • injector: closes since it's done. watcher: stays open until you close it. autostart: stays open until game closes

This is the entirety of the programs operation. If you read to this point, you seem curious! Why not read the source code too?

**What are the deeper technical details on what this does?

**In a nutshell, this mod loader uses a technique called DLL injection. It injects its own special loader.dll into the game at runtime. This special loader dll then takes care of loading all the actual plugins into the game. Any changes that happen to the game are done in memory only and no changes persist anywhere else. That makes this a very clean and efficient approach to avoid touching the actual game install.

**This tool broke my game!

**See the above answer on "What are all the things this mod loader does?". The answer details everything the mod loader touches, which, as you can see, is not much. This mod loader does not do anything more than what is explicitly listed there.

Because of that, any issues you have that are not specifically related to this mod loader's functionality, such as issues with your game, launcher, installation, etc, are caused by plugins, content mods (pak mods), mods which overwrite game files (whether dll or content files), or separate issues related to your OS, hardware, game and/or specific game platform launchers (steam/larian/gog); it would be best to look at one of these for the cause of whatever issue(s) you're experiencing.

Of course, if you do find an actual issue with this mod loader, please report it!

**Does it work on Mac/Linux/WINE/Proton/CrossOver?

**This tool does not support Mac/Linux/WINE/Proton, but future support for WINE is being considered.

**I have a feature request, can I ask?

**Feature requests are welcome! I can't guarantee I will implement it, but I promise to consider it, and if there's enough demand, I will try to implement it if possible

**

Disclaimer

**This software is a hobby project. Every best effort has been made to ensure everything works properly, however it is still technically possible - even if highly unlikely - that something goes wrong. Though if something goes wrong, it almost certainly is due to a dll plugin rather than the tools themselves. By using this software, you agree to the following license terms, acknowledge that you've read and followed all the instructions and warnings on the page for proper usage of the product, and will not hold the mod author responsible for anything that goes wrong.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

来源与文件

文件说明

Automatically patches game whenever it's launched. Behaves like NML.

Advantages: Automatic. Install and forget. No need to manually run. Does not run in background.

Disadvantages: Installation required*.

  • Writes to registry.

前往 N 网打开所选文件。安装与下载要求以原作者及平台说明为准。

<!-- aoe-mods-source:nexusmods:baldursgate3:3052 -->

下载模块

共 1 个来源
立即下载推荐来源
前往下载