Mount & Blade II: Bannerlord

Mount & Blade II: Bannerlord

8,172 ratings
Harmony
39
13
4
12
9
3
10
8
8
4
2
6
2
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
5.278 MB
5 Sep, 2022 @ 11:48am
5 May @ 1:19am
31 Change Notes ( view )

Subscribe to download
Harmony

In 1 collection by Pinkie Arg
BUTR Stack
4 items
Description
For the Early Access version please visit this!

A library for patching, replacing and decorating .NET and Mono methods during runtime. Intended to ensure that all mods in a player's modlist are using the latest version of Harmony to minimize conflicts. We also added a Debug UI! Available via CTRL+ALT+H.

Notes
This is an unofficial distribution of the Harmony[github.com] library maintained by the community to have an easier way to manage external library dependencies.
The repository of the mod - Bannerlord.Harmony[github.com].

Installation
This module should be the highest in loading order. Any other module that requires to be set at the top (Better Exception Window, ButterLib, MCM, etc.) should be loaded after this mod.

For Players
This mod is intended to ensure that all mods in a player's modlist are using the latest version of Harmony to minimize conflicts.

For Modders
We added a Debug UI! Available via CTRL+ALT+H.

You still need to reference Harmony as a NuGet package, it is not required to include 0Harmony.dll in the final /bin output of your module.
You do need to add this to your SubModule.xml
<DependedModules> <DependedModule Id="Bannerlord.Harmony" /> </DependedModules>
This way the game will ensure that the Harmony library is loaded before your mod.

Versioning
The Module combines the Harmony version used and the Build Id that published the Module. The Build Id is simply added to the end.
2.0.2.22 indicates that Harmony 2.0.2.0 is used and 22 is the Build Id.
2.0.0.1025 indicates that Harmony 2.0.0.10 is used and 25 is the Build Id.

We considered using the Rimworld approach with introducing our own version system, but it won't give a clear way to detect which Harmony version the Module contains. It's easier for the user to report the version of the Module used than to check the assembly version/send it.

Troubleshooting
  • Steam is not always updating all mods. We suggest to manually resubscribe to Harmony if you experience crashes!
  • Check that the Modules folder (C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord\Modules) does not contain a Bannerlord.Harmony folder!
  • If the game crashes on start, might have used Fixed Launcher. When installed, it copies 0Harmony.dll which prevents Bannerlord.Harmony from working.
  • If Fixed Launcher was uninstalled or never installed, check that the following files are not in the game's main /bin folder (Mount & Blade II Bannerlord\bin\Win64_Shipping_Client)
    • TaleWorlds.MountAndBlade.Launcher.exe.config (if BUTRLoader was installed, reinstall it after)
    • 0Harmony.dll
    • LauncherPatcher.dll
    • LauncherPatcher.pdb

About
Harmony gives you an elegant and high level way to alter the functionality in applications written in C#. It works great in games and is well established in titles like 7 Days To Die, BattleTech, Besiege, Cities:Skylines, Kerbal Space Program, Oxygen Not Included, Ravenfield, Rimworld, Sheltered, Stardew Valley, Staxel, Subnautica, The Ultimate Nerd Game, Total Miner, Unturned and many more.

It is also used in unit testing WFP controls and in many other areas.

How it works
If you develop in C# and your code is loaded as a module/plugin into a host application, you can use Harmony to alter the functionality of all the available assemblies of that application. Where other patch libraries simply allow you to replace the original method, Harmony goes one step further and gives you:
  • A way to keep the original method intact
  • Execute your code before and/or after the original method
  • Modify the original with IL code processors
  • Multiple Harmony patches co-exist and don't conflict with each other
  • Works at runtime and does not touch any files

Documentation
Please check out the documentation[harmony.pardeike.net].

Contribute
pardeike put thousands of hours into this project and its support. So every little action helps:
• Upvote this stackoverflow answer[stackoverflow.com]
• Spread the word in your developer communities
• Become a GitHub sponsor[github.com] or a Patreon[www.patreon.com]

This project uses the great MonoMod.Common[github.com] library by 0x0ade[github.com].
Popular Discussions View All (5)
31
21 Aug, 2023 @ 1:43pm
Crash
jerome_lacey1888
8
1
10 Mar @ 10:17am
How to i change the version of the mod
SexLord Farquaad
2
1
25 Oct, 2023 @ 4:14pm
Harmony.PatchClassProccssor error
Gaming4ever
903 Comments
Kleronomus 25 May @ 1:41pm 
I just downloaded The Old Realms mod and Harmony and it crashes when I try to start a game, and has saved game files from previous campaigns on Realm of Thrones and vanilla games. I think my version of harmony is not the version that TOR requires. How can I change the version of Harmony? Thanks.
Vanen 24 May @ 1:03pm 
No problem
catbox99 22 May @ 12:39pm 
Steam version tested with just "Big 5" mods loaded with their most recent versions:
Harmony, BetterExceptionWindow, ButterLib, UIExtenderEx, MCM

Game loads correctly and works through character creation, map placement, and first combat without issue. THEREFORE, if you are having trouble with crashes, it is related to some other mod, or combination of mods. Remember that when you look at the mod list, you are looking at a UNIFIED list of all mods. If you use two different versions of Bannerlord (like I do), remember that what works for GOG might not necessarily work for Steam.
catbox99 22 May @ 12:18pm 
I recently had "Surrender Tweaks" fail to update, causing the game not to load. Steam sometimes gets lost, and DLs are either corrupted or not performed. Consequently, I recommend manual update of "big 4" mods. Uninstall, then reinstall manually. BUTR especially has been affected from time to time. Keep your BUTR libraries up to date.
catbox99 22 May @ 12:18pm 
Remember that if you are using Nexus mods in addition to Workshop mods, there can be version and other conflicts. The more a mod does to change base play, the easier is is to break it. Some mods require over-writing game files, which is never optimal. If you must use one of those mods, BACKUP your files. Some mods are not save friendly, and will require a new game, whether they mention it or not.
Reed Mc Ortip 22 May @ 11:55am 
salut ca crash il me semble non?
Walt O.o 14 May @ 11:39am 
I have a problem with BUTR collection on my laptop. I have older version and no idea why.
When i turn those 4 mods on, the game crash. I try reinstal the game, also the mods....not helping.
currently it say version 2.3.3.207 on my laptop. Any ideas?
king kush smoka 12 May @ 5:15pm 
im having problems starting a sandbox mode says crashes due to harmony
blackwolf2365 10 May @ 10:07pm 
help i have harmony install but for some reason it wont show up on the mod list help?
catbox99 9 May @ 1:44pm 
First, read the thread and follow directions. I can tell right now that most have thrown all the mods in at the same time. Some of you then disabled the mods you added in the launcher, forgetting that they leave configurations behind. None of you has bothered to explain what mods you are trying to use. Next, in the past, some people have mistaken a warning message (routine) for a crash. It's not. Finally, some of you likely tried to throw this and other mods on to an existing vanilla save, which significantly increases the possibility of a post-launcher crash.