Mount & Blade II: Bannerlord

File information

Last updated

Original upload

Created by

Catalyst

Uploaded by

8thor8

Virus scan

Safe to use

About this mod

This mod allows basic soldiers, who meet certain criteria, to ascend to companion-dom following battle. Now the troops you've had by your side since their peasant days can be rewarded with cushy governor jobs.

Requirements
Permissions and credits
Translations
  • Mandarin
Changelogs
NEWS: Download BETA version of this mod for the 1.4.1 beta version of the game. Use the STABLE version of the mod for the 1.4.0 stable game version.

Please note that the version of this mod made for the 1.4.0 stable game is compatible with 1.3.1 as well.

MORE NEWS:
I'm holding off on the latest set of updates in case Taleworlds decides to push 1.4.1 to the stable branch (so I don't need to download 7Gb of game files in total just to compile the mod and get back to my gameplay version). This functionality update will include saving and loading of troop formations, which is a big QOL change, and involved learning XML serialization in C#.

The mod will generate a file called companion_formations.xml in a subdirectory that will be a serialized list of all character object IDs and formation classes of the player's party. The file will be identified by the player character's name, in case you have multiple characters going at once.

This will also be accompanied by a couple more console commands (which have been moved to their own command directory, dservice). One each for saving and loading troop formation classes, and one to generate a "squad" of heroes based off of the player character's culture, composed of the "elite" caravan template, to provide some decently-powerful starting troops for thematic runs, or just for fun.
~~~~~

Randomly, following a battle (with a probability set in a config xml file), an individual soldier will be nominated to ascend to companion-hood, as long as they're a high-enough tier of unit (also set in the xml file). They will be given the stats of their unit type, plus some random bonuses across the board, as well as attribute and focus points for you to assign as you see fit. Not every ascended mook will be useful outside of combat, but it's a possibility.

If a unit of a high-enough tier gets enough kills during a battle, they may be short-tracked to companion-ship. The kill threshold is customizable, and any that have surpassed it on a given mission will be put in a list for nomination at the end of a battle.

If one of your companions dies (which can be enabled or disabled in the config file), you will be given the option to mercilessly loot their still-warm corpse for their potentially high-tier armour. This will lose you honor (as a fraction of the total value of their equipment, so be c a r e f u l, as some unit armour is worth >500k). You can also choose to return their equipment to their families, gaining you honor (by a similar system).

The config file (Settings.xml) has several parameters:

  • tier_threshold, the minimum tier of unit eligible to become a hero.
  • nomination_chance, the chance after a battle for a random unit to be chosen.
  • base_additional_skill_points, the number of bonus skill points to be spread around their stat sheet.
  • leadership_points_per_50_extra_skill_points, how many points of the player's leadership skill translates to 50 additional skill points for the new hero.
  • battle_size_scale, the total number of party kills needed to add an additional nomination_chance probability for a nomination. It rewards your guys being more "kill-y", instead of sitting in the back of a battle.
  • combat_perf_nomination_chance_increase_per_kill, the increase in nomination chance for a nominee based on the number of kills they have. It's important to note that these lists won't persist on-exit, as it's coded at the moment.
  • lethality_chance, is the chance of a companion (only a player companion, not lords, or anybody else) being killed when reduced to zero HP during a battle. If you're using the Heroes Must Die mod, set this value to zero (or negative), because any interaction between these mods is undefined behaviour.
  • inf_kill_threshold, the infantry-specific kill threshold to be nominated.
  • cav_kill_threshold, the cavalry-specific kill threshold to be nominated.
  • ran_kill_threshold, the archer-specific... You get the idea.
  • medicine_death_chance_reduction, the reduction in lethality_chance for each 10 skill points in medicine.
  • max_nominations, the maximum number of nominees you are allowed to pick at the end of a battle. THIS WILL ONLY DO SOMETHING IN THE 1.4.1 BETA VERSION OF THE GAME/MOD.
  • upgrade_to_hero, changes nomination functionality so that when a unit is upgraded to tier_threshold they automatically become a hero. Pairs best with high tier_threshold, and high lethality
  • fill_in_perks, sets new hero perks to be automatically filled in on uplift, saving you time.
New in 2.3.0:
  • away_lethality_reduction_factor, the factor by which to reduce the chance of death for a companion in a different party. If this is 2, they have half the lethality_chance of dying as a unit in your army. Their party's perks and medicine skill do affect this chance.

If you want to guarantee that a unit that surpasses the kill threshold will be offered as a companion, you can change combat_perf_nomination_chance_increase_per_kill to be equal to 1.0/[X]_kill_threshold, which means that the new companion event will always fire, given at least one high-performing soldier.
In the absence of nominees based on battle performance, the highest-tier non-hero soldier in your party is the unit that gets nominated, albeit at a much lower rate. However you are allowed to say "no", if you don't want (or can't afford) a new companion.

If you want an even more XCOM-esque experience, you can get the Heroes Must Die mod (requires MCM as well), but I haven't tested its compatibility so it's a caveat emptor situation. I'd recommend setting lethality_chance to zero or negative to disable the behaviour if you combine these mods, however.

If you want to really reward your loyal soldiers, the Marry Anyone mod allows you to marry companions (and more). 


COMING SOON:
  • Tournaments will no longer be lethal to companions... Oops.
  • Companion (and player roster) formations will be saved and loaded with the game.
  • Feel free to suggest things!

Check out my new mod, Attributes Matter, which gives gameplay bonuses for attribute scores, so your new heroes can be more useful than normal soldiers.

~~~~~~~~~~~~~~~~~~~~~~~~
update 2.3.0 BETA/STABLE: Added companion death and nomination in sieges and hideout battles (the ciiiircle of liiife). Also added dialog options when talking with companions who are party leaders to transfer other companions between your parties. It's clunky, but TW made it incredibly difficult to actually let you transfer heroes like normal units, so it's the best I could do.
Oh, and the companions you sent off in a new party? They can now die, too.
~~~~~~~~~~~~~~~~~~~~~~~~

update 2.2.0 BETA/STABLE: New optional nomination method to make your squad more like XCom, by making all soldiers who are promoted past tier_threshold into heroes. Pair with a high tier_threshold, and high-lethality options to prevent yourself from getting flooded by heroes. fill_in_perks will also allow you to avoid having to manually assign perks.

update 2.1.0 BETA/STABLE: Added new console commands for themed campaigns/ease of use (and testing). 
campaign.uplift_soldier ~ uplifts a single basic troop, selected randomly, without any criteria
campaign.convert_party_to_heroes ~ converts all non-hero units in your party to heroes
campaign.give_party_heroes_perks ~ assigns perks (that are not already assigned) to non-player heroes in your party up to their current skill value.

update 2.0.2 BETA/STABLE: Fixed an issue with uplifting units from non-land-holding cultures that would cause a crash. 

update 2.0.1 BETA: You are now able to set the maximum number of nominees you can choose at the end of a battle. Additionally, if you set a party surgeon, their medicine stat and Fortitude Tonic perk will be used for companion lethality. A dialog option with companions has been added to allow you to rename them.

update 2.0.1 STABLE: Multiple nominees can now be selected to become companions (no limit, as that functionality doesn't exist in this game version). Additionally, if you set a party surgeon, their medicine stat and Fortitude Tonic perk will be used for companion lethality. A dialog option with companions has been added to allow you to rename them.

update 1.9.1 [1.4.0 stable compatible version]Player perk Fortitude Tonic now makes companions 50% less likely to bite it. Player's Medicine skill can also lower death chance.

update 1.9.0: [Compatible with both 1.3.1 and 1.4.0] There is now a configurable up-front cost to hire the new hero. This is zero by default, since they generally are high level, and are thus quite expensive per diem anyway.
Additionally, I've fixed an issue with the new heroes' occupations still being "Soldier", which led to some player interaction problems in towns, etc. Using Fasterflect, I get around the private access level of CharacterObject.Occupation to set theirs to "Wanderer" upon creation, without adding the base template as a flood of zero-skill "wanderers" across the map.
Unfortunately this won't retroactively apply to previously created companions. It will, however, work fine with previous savegames.

update 1.8.1: [Compatible with both 1.3.1 and 1.4.0] Nomination list is reset at the start of each battle (so if you didn't elect to nominate a unit, it won't bug you after every battle until you do). I also added additional verification that the nominees are in the player's party, so the reported number of nominations should match the number that are available.

update 1.8.0: [Compatible with both 1.3.1 and 1.4.0] I split the nomination kill threshold into division-specific values, so the user can decide exactly how easy or difficult they want to make it for infantry, archers, and mounted units to be nominated.

update 1.7.1: [Compatible with both 1.3.0 and 1.4.0] The player is now given a post-battle choice between all units that are above tier_threshold, and had at least nomination_kill_threshold kills in the previous battle. You can exit the dialog to choose nobody. 
When companions die, you can now choose whether to strip them for equipment (a dishonorable action), or to send it to their families. You will lose or gain a fraction of the equipment's value in honor.
Finally, I introduced a bias against ranged units in the killcount tracker to counter their ability to reach out and touch kill someone. This can be adjusted by the user.
(Thanks to Dauthmer for the great suggestions)

New companions will now also have gear with the "companion" modifier, reducing resale value by roughly 80%.

update 1.6.4: [1.3.0b version only, use version 1.2.2 for live-compatible version] A crash caused by a bad clearing of the nominee list has been fixed. The nomination by battle performance (by kill threshold) is now independent of the nomination_chance parameter (which it should have always been, soooorry). This means a nice parameter setup is a nomination_chance of zero, and a high combat_perf_nomination_chance_increase_per_kill, so if a unit meets the kill threshold, they're almost guaranteed to become a companion.
Lethality and companion death is now opt-in, instead of opt-out.

update 1.6.2: [1.3.0b version only, use version 1.2.2 for live-compatible version] Fixed an issue where all non-player-companion heroes were being killed after fighting a battle with the player if they'd been downed (causing a crash).

update 1.6.1: [1.3.0b version only, use version 1.2.2 for live-compatible version] Fixed loading the freeze-causing Action OnPlayerBattleEnd in the OnGameLoaded function. Now it should work fine when you load a saved game.

update 1.6.0: [1.3.0b version only, use version 1.2.2 for live-compatible version] The OnPlayerBattleEnd listener is now removed entirely. After battles with lords it was triggering during the pre-conversation loading screen, creating a pop-up below the loading picture that you needed to click through to continue. This was, uh, sub-optimal. Now, the pop-up is triggered at the end of a mission, just as the results screen is readied, before any loading screens have happened. This has the side effect of making it so units can't be raised up from auto-resolved battles, but that's a small price to pay for salvation stability.

I have also added a lethality mechanic (only for player companions), so your new troops still have a chance of biting it if they are reduced to zero HP during a battle (and you won't have a large group of un-killable fodder to strip of armour and charge as an undying first wave, no matter how metal that is). This is configurable, and the chance of death can be set to zero or negative to disable it entirely. If you're using the more general Heroes Must Die mod, then I'd highly recommend disabling this functionality and letting that mod do its work.

update 1.5.2: [1.3.0b version only, use version 1.2.2 for live-compatible version] I've changed the post-mission listener to ShowBattleResults, instead of OnEndMission, because if you'd encountered a lord you could capture, the dialog box to choose to recruit a new companion would appear behind the loading screen. I think that's fixed. It should be fixed. During my test the box appeared on the battle results screen, before the lord-conversation loading screen.

update 1.2.2: [1.2.1 live version only] same functionality as 1.4.2, compiled for the 1.2.1 live environment.

update 1.5.1: [1.3.0b version only, use version 1.2.1 for live-compatible version] I've removed some unnecessary debug output, and made the OnMissionEnd listener even more discerning about when to activate. I cleaned up after trying to fix the encyclopedia problem, which turns out to be Taleworlds' fault anyhow. See the Encyclopedia Fix mod for the stopgap solution until TW fixes the 1.3.0 ObjectManager.
The number of kills your units make in a normal (non-auto-resolve) battle now increases the chances of an uplifted hero above the base (5% by default, but configurable by you), hopefully rewarding actually participating in battles.

update 1.5.0: [1.3.0b version only, use version 1.2.1 for live-compatible version] Heros that have been created now show up properly in the encyclopedia. This seems to only work when a new campaign is started (don't ask me why the game is the way it chooses to be). This also has the side-effect of the heros sticking around in-game, and it seems they join random culturally-appropriate clans when you, uh, downsize your party. So it might be worth throwing on that mod that lets heros die...

update 1.4.2: [1.3.0b version only, use version 1.2.1 for live-compatible version] Added proper conditional statements, and culture-specific templates (both male and female) for Native cultures. If a modded unit does not have a Native culture, it will default to Imperial.

update 1.4.1: [1.3.0b version only, use version 1.2.1 for live-compatible version] Fixed tournament crash bug.

update 1.4.0: [1.3.0b version only]
This is a fairly big overhaul on the mod. I've added MissionLogic and CampaignBehaviour classes to calculate the total number of kills your dudes have, and also the individual number per-unit. This ties into the new settings parameters, which control how many kills are required for a unit to be eligible, as well as how that number of kills increases their odds. I have also introduced balancing for the total kills your party has, so more kills means there's a higher chance of any nomination happening. I also removed the base template stats to prevent the new companion from being miles above any of the native companions.


update 1.3.0: Perk choices now persist, and the new companion is given equipment directly from their CharacterObject's first battle equipment set. This means you can, once again, sell their clothes (after they've entrusted you with their lives, no less), but this wonderful exploit also comes bundled with the reintroduction of random stat bonuses.

update 1.2.1: Functionally the same as 1.4.1, as of April 30 2020, but compatible with the most recent live version of the game.

update 1.1.0: I've fixed (I hope) the inability to save perk choices made, and they will also not spawn with their armour (stripping somebody of armour and pawning it all off is a holy practice only to be done between man and wife - or horse, if you're Khuzait).

I fixed this by introducing a generic template for the companions, which unfortunately lowers facial diversity. But being able to actually give them perks was the main issue I wanted to solve first.