Mount & Blade II: Bannerlord
0 of 0

File information

Last updated

Original upload

Created by

mipen-Tokashi-joshimoo

Uploaded by

mildeww

Virus scan

Safe to use

About this mod

ModLib is a dependancy mod that provides useful code and a settings menu for mods to use.

Requirements
Permissions and credits
Changelogs
ModLib is a modder's resource mod which provides useful code and an easy to use mod settings menu for modders to hook into.

1.3 Version
ModLib has had some major changes to how it should be implemented from version 1.3 onwards. Modders, please see this Wiki page for details on the changes. 
These changes will reduce mods' dependancy upon ModLib, meaning they will be able to run even if ModLib is not installed.

Modders: You can find the source code for ModLib here. For information on using ModLib with your mod, and how to hook into the mod settings menu, check out the mod's Wiki.

Installation
ModLib is a mod that other mods depend upon. If you are using a mod that requires ModLib, such as Bannerlord Tweaks, ensure that ModLib is listed above that mod in the mods list.

Unblock the mod's .dll files
Windows automatically flags .dll files downloaded from the internet as suspect and puts a security block on them. While this is usually good, it causes problems with Bannerlord's mod loading system. To fix this, open the ModLib mod folder in your modules folder, then navigate to bin -> Win64_Shipping_Client. Right click on ModLib.dll and select Properties. In the popup window, check the 'Unblock' checkbox at the bottom of the General tab. Do the same for 0Harmony.dll and ModLib.Patches.dll as well.

Unblock all files with PowerShell (advanced method)
If you feel comfortable using a terminal, you can use PowerShell to automatically unblock all files in the Bannerlord directory. This will fix not just the files for this mod, but those for others that have issues also. Follow the instructions below:
Spoiler:  
Show

In the Windows start menu, search for PowerShell
Right click on it and click 'Start as administrator'. A blue window will appear.
Open an explorer window and navigate to Bannerlord's Modules folder (this is where you installed your mods)
Click on the address bar and press Control+C to copy the address.
Go back to the PowerShell window and type: cd "
Paste the address using Control+V and type the closing quotation mark "
The result should look something like this:

cd "C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord\Modules"
 
(Your location might be different, don't forget the quotation marks!)

Press enter.
Now type (or even better, copy the line and paste it into the PowerShell window): dir -Recurse | Unblock-File
Once you have entered that line, press enter.
The PowerShell window will work for a few seconds and then be finished. All the files in the Modules directory are now unblocked if they were blocked.


Try running the game in administrator mode
Navigate to "C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client" then right click on the file named "TaleWorlds.MountAndBlade.Launcher.exe" and click properties. Go to the "Compatibility" tab and check the "Run this program as an administrator" checkbox, then hit OK. (This requires you to have administrator priviliges on your computer.)

Try Another Launcher
Other modders have created better launchers for the game that help fix some of the issues that are caused by the default one. 
Try one of these:
Alternative Bannerlord Launcher https://www.nexusmods.com/mountandblade2bannerlord/mods/265
Fixed Launcher https://www.nexusmods.com/mountandblade2bannerlord/mods/205

Check other mods for issues
Mods that are not setup correctly will cause issues for all other mods that you have added to the game. One bad mod will bring the whole house down.

Make sure that ModLib is beneath all of the official modules in the launcher. This mod depends on code from the official modules and needs to be loaded after them. It has been brought to my attention that other mods that don't have their SubModule.xml file setup correctly can cause problems for those that do. If the mod load order is being jumbled up, check through the SubModule.xml file for each mod you have installed and ensure they contain this piece of code:

    <Official value="false"/>
    <DependedModules>
        <DependedModule Id="Native"/>
        <DependedModule Id="SandBoxCore"/>
        <DependedModule Id="Sandbox"/>
        <DependedModule Id="CustomBattle"/>
        <DependedModule Id="StoryMode"/>
    </DependedModules>

If they are missing even one of the lines, edit the SubModule.xml file and add the missing pieces in. Check the launcher again to see if the mod order is correct. The official TaleWorlds modules should all be grouped together at the top.
Note: If you do this incorrectly it will add to your issues. I only recommend this if you are confident in what you are doing.

Don't edit the SubModule.xml file for ModLib
I have gone through and checked this file many times. There are no issues with it. Changing it will just add to your problems.

Even mods that are not activated in the launcher can cause problems.
If none of the above works, try temporarily removing all other mods from the Modules folder except for this one. Run the game and see if it will run with just this mod.
Remember: Simply deactivating the mods won't fix the issue, you have to actually remove them from the modules folder.
When you get the game to run, add one mod back and run the game again. If it still runs, add one more mod and run the game again. Repeat this, going one mod at a time, until you find the mod that causes the issue.