BepInEx / BepInEx.MelonLoader.Loader

BepInEx loader for MelonLoader mods and plugins
GNU Affero General Public License v3.0
40 stars 4 forks source link

BepInEx.MelonLoader.Loader

Current version supports MelonLoader 0.5.7.

Loader for BepInEx to be able to use MelonLoader plugins.

Notes

Installation instructions

  1. Install BepInEx 5 or 6 according to the game you want to use. Note that IL2CPP support is only available for BepInEx 6.
  2. Download the latest release (pick the correct version) and extract it into your game folder.
  3. Run the game

Troubleshooting issues with MelonLoader mods/plugins

Some mods or plugins won't work out of the box with this. Some things you can do to fix this:

Sometimes the unhollowed assemblies generated by BepInEx can differ significantly from assemblies generated by MelonLoader (due to a reason I haven't diagnosed yet). ML plugins and mods will typically complain about missing types or methods in such unhollowed assemblies. Follow this guide to fix this problem:

  1. Open BepInEx/config/io.bepis.melonloader.loader.cfg and set EnableAssemblyGeneration to true.
  2. Launch the game once.
  3. The unhollowed assemblies created by MelonLoader will be located in MelonLoader/AssemblyOutput. Open BepInEx/unhollowed, delete ONLY the .dll files, and move the .dll files from AssemblyOutput to here.
  4. Set EnableAssemblyGeneration back to false.

You will have to do this every time the game updates. Make sure to only delete the .dll files and don't touch assembly-hash.txt; if it has been deleted or modified, BepInEx will assume that the unhollowed assemblies have to be regenerated, and will overwrite the MelonLoader generated .dll files.

Some mods have a check to ensure that you are running an official build of MelonLoader with full obfuscation detection support. The version of BepInEx.MelonLoader.Loader posted here does not have this check, and as such these mods will not work. Fixes for this will not be committed here at the request of Knah.


Licensing

This repo uses code adapted from MelonLoader itself, which is under the Apache 2.0 license (included in the repo)

As per licensing, the changes included in this repository are:

The repository contains only the BepInEx plugin and all modified MelonLoader assemblies. Unmodified assemblies are built directly from MelonLoader source.