Mount & Blade II: Bannerlord

File information

Last updated

Original upload

Created by

artifixer

Uploaded by

artifixer

Virus scan

Safe to use

About this mod

This mod overhauls the rules that NPC clans use to leave, join and evaluate kingdoms - see the description. Everything is configurable!

Requirements
Permissions and credits
Translations
  • Russian
  • French
Changelogs
The goal of this mod is to make the logic which NPC clans use for leaving or defecting their kingdoms more sensible and controllable, while not preventing such actions completely. Source code is available at GitHub!

Explanation
___________________________________

The mod has one big system named "Ensured loyalty" and several subsystems, which may be turned on or off independently. I had plans to add more systems and subsystems in the future, while maintaining modular approach, but they have now been put on hold since I stopped playing BL. Each existing or future system could be applied either to player kingdom only, or to all realms of Calradia. I highly suggest using the same rules for everyone - that's what I had in mind while designing the mod.

Here is the detailed overview of implemented systems (I put info under spoilers for the sake of page brevity).

Ensured loyalty
Spoiler:  
Show


Current features
___________________________________
  • Ensured loyalty system
    • Oath of fealty limitation period - minimum time clans have to serve as vassals to be able to leave the kingdom
    • Same for the minor factions with separate setting for the ones under mercenary contracts
    • Achieve clan loyalty via high relation with it's leader
    • Option to spend influence to make clans, that really would like to leave, stay for a while longer
    • Optionaly affects player dialogs (blocks the ability to persuade loyal lords)
    • Info about lord's relation to kingdom leader and loyalty in hero tooltips in game Encyclopedia.
  • Info about exact relations with friends and enemies in hero tooltips in game Encyclopedia
  • Everything this mod adds or changes may affect only player's kingdom or all of Calradia, the choice is yours!
  • Localization support
  • In-game configuration menu with detailed hints for every setting
  • Informative and readable log messages

Compatibility
___________________________________

This mod is compatible with existing save games and can be removed from saves safely.

Mod compatibility
My mod has basic check up routines, which should alert you if there are possible conflicts with other Harmony patches you use. This happens on game start and results logged in mod .log file. Plus there will be short information message in the game if potential issues were found.

Compatible and suggested for better overall experience: Compatible with:Semi compatible with:
  • Separatism - thanks @DarkSlimus and @kyrian35 for the report. Should be generally compatible. Both mods have additional rules, restricting AI clans leaving and defecting their kingdoms, I think they will work in conjunction, one after another. That should not lead to any additional issues.
Not compatible with:
  • Defection overhaul - this mod originally inspired me to look into allegiance, so if you don't need the additional complexity and just want to stop clans from leaving your kingdom, give it a try instead!

Code details
Harmony prefix on:
  • DiplomaticBartersBehavior.ConsiderDefection
  • DiplomaticBartersBehavior.ConsiderClanLeaveKingdom
  • DiplomaticBartersBehavior.ConsiderClanLeaveAsMercenary
  • UpdateTooltip.HeroAction
Harmony postfix on:
  • JoinKingdomAsClanBarterable.GetUnitValueForFaction
  • LeaveKingdomAsClanBarterable.GetUnitValueForFaction
  • LordDefectionCampaignBehavior.conversation_lord_from_ruling_clan_on_condition
  • EncyclopediaHeroPageVM.Refresh
  • TooltipVMExtensions.UpdateTooltip

Installation
___________________________________

Use Vortex mod manager or simply copy the 'AllegianceOverhaul' folder into your '..\Mount & Blade II Bannerlord\Modules\' folder! As for mod activation, I suggest that you use custom Mod Launcher and place my mod somewhere below the official TaleWorlds Modules.

As of v1.1.4 this mod requires MCM v4 mod to work, so be sure to install it.

Your mod order should look like this:
1. Harmony
2. Butterlib
3. UIExtenderEx
4. Mod Configuration Menu v4
5. MCMv4 MCMv3 Integration
6. MCMv4 ModLib Integration
...
Oficial TW Modules
...
Allegiance Overhaul <--- should be placed somewhere mid to low among in the list
...

Troubleshooting
___________________________________

If you are experiencing any problems:
  1. Try different mod order, I suggest following this guide
  2. Check mod .dll files, they might be automatically blocked by Windows
  3. Using launcher with enhanced mod support, like Fixed Launcher or Bannerlord Mod Launcher, may help with both these tasks

If nothing above helps, please, create bug report, providing me information about:
  1. Mod version and game version
  2. What you did or what happened before the crash
  3. Information from game's exception window, if there were any (you can press <ctrl> + <C> in it to copy results to your clipboard)
  4. Mod log file, if any. It can be found under '..\Mount & Blade II Bannerlord\Modules\AllegianceOverhaul\'. It is only created if there were errors in mod functionality.
  5. Your mod list and order

Safety note
___________________________________

Please, consider that the game is currently in development and not yet fully released. All kinds of bad things are possible, so, please, backup your saves!