Mount & Blade II: Bannerlord
0 of 0

File information

Last updated

Original upload

Created by

Bill Mountney

Uploaded by

Bildric

Virus scan

Safe to use

About this mod

This mod will allow you to quickly toggle the "Show Banners On Friendly Troops" option without having to go into the game settings. Pressing the key that is bound to "Show Indicators" (Left Alt by default) will toggle the state of the banner icons as long as you hold the key. Pressing the Right Alt key will switch the setting in the options.

Permissions and credits
Changelogs
NOTE: The mod has been tested to be fully functional with Bannerlord versions through e1.5.3.  As of version e.1.5.4, it appears the banner size scaling option no longer works, and having it enabled in the config file will cause a crash at startup.  This option has always been disabled in the config file by default, because I suspected it would be much more likely to break with a version update, so if you are installing the mod for the first time, or had installed it previously and never enabled that setting, then it still should be working fine with the latest version e1.5.6.  However, if you previously and enabled the scaling, you will need to disable that option for the time being until I figure out how to get it working with the newer version and release an update to the mod.

I had a bit of a love/hate relationship with the "Show Banners On Friendly Troops" option in Bannerlord.

On the one hand, I find the little banner icons a bit immersion breaking, and would prefer to have the option turned off for that reason.
On the other hand, certain types of troops have armor that makes it harder to identify your clan or kingdom colors from the enemies', especially if you're fighting another kingdom with similar colors.  It's even worse when you are fighting a battle after dark, where it can be hard to identify your own troops at all.  Since I don't feel like going into the options each time before a battle depending on the time of day, I usually give in and leave the option turned on.

However, leaving it turned on can have other problems, even if you don't mind the icons.  When you are fighting on foot and have troops following you, such as in bandit camp missons, the other troops will often position themselves so their banner is right in your line of sight when you are trying to aim a ranged weapon.

So, what I wanted was a key I could hold to temporarily show the banner icons if they're currently turned on, or to hide them if they're currently turned off.  I also wanted another key to toggle the option to make them stay on, such as when I'm going to be fighting a whole battle in the dark, or to stay off if there's better visibility, without having to go into the settings.

This mod provides both.  By default, the key that you have bound to the "Show Indicators" function in the settings (left ALT by default) will now also momentarily toggle the banner icons.  If you have the banners turned off, holding this key will show them, along with the other things it usually does, like showing troop formation icons and highlighting objects you can pick up or interact with.  If you have the banner icons turned on, holding this key will hide them momentarily, while still performing its other functions normally.

The second function toggles the current banner setting, just as if you went into the settings and changed it.  Since Bannerlord treats the left and right ALT keys as separate keys, I chose to bind this to the right ALT key by default.  This will allow you to quickly and easily choose to make the banners stay on when you want and stay hidden when you don't, without having to go into the settings -- and you can always press the momentary key to briefly switch them the opposite way.

Version 1.1.0 of the mod now allows the hotkeys to be configured to your liking by editing a config file that will be created in the mod folder the first time the mod is loaded ("FriendlyTroopBannerHotkeys\ModuleData\FriendlyTroopBannerHotkeysModSettings.xml").  The option "MomentaryBannerToggleHotkey" sets the key used to toggle the banners only while the key is held down, unless the option "UseGameShowIndicatorsBindingForMomentary" is set to true, in which case it ignores the "MomentaryBannerToggleHotkey" and instead follows whatever key is bound to "Show Indicators" in the game options.  The option "StickyBannerToggleHotkey" sets the key that toggles the actual game option, making the banners stay on or off until it's chagned again.  The file contains instructions for how to enter the correct key IDs.  It also allows you to choose whether the momentary toggle follows the game's "Show Indicators" binding or is bound to a separate key.  For now, it only reads the file when the game first starts up, and it may overwrite it at exit, so if you want to edit the bindings you should exit the game, edit the file, and then run the game again.  I'll try to improve on that behavior in a future version.

Version 1.2.0 of the mod now allows the size of the banners to be scaled, with some limitations.  The "BannerScaleFactor" option in the config file controls the normal banner size, and can be set from 0.1, which is 1/10th normal size, up to 1.0, which would be normal size.  The "SelectedBannerScaleFactor" controls the size of the banners with the outer yellow circle for selected troops.  This scaling works differently than the normal banner size, and unfortunately can never be made smaller than the original size.  Instead, it controls the extra enlargement of selected troop banners that occurs with more distant troops, to make it easier to see the selected troops when they're farther away.  The default value is 30, and this will result in the selected troop banners being enlarged by the usual amount.  It can be lowered down to 1, which will result in the distant banners not being enlarged at all, or increased to 60, which will enlarge them twice as much as usual.  Values lower than 1 have no effect, so the selected troop banners can never be made smaller than the original size.  (I find that a value of 0.5 for the "BannerScaleFactor" and 15 for the "SelectedBannerScaleFactor" seems to work pretty well for making the banners less obtrusive.)  Since the patches required to achieve the banner scaling are more low-level and therefore more likely to break with future game updates, I added another config option called "ApplyBannerScalingMod" that must be changed to "true" for banner scaling to happen at all.  If the banner scaling causes a future version of the game to crash or throw an exception, you can change the setting back to "false" and then the banner scaling patches will not be applied at all.

Souce code for the mod is available at Github.