Mount & Blade II: Bannerlord
0 of 0

File information

Last updated

Original upload

Created by

Stenella

Uploaded by

Stenella

Virus scan

Safe to use

About this mod

Allows prisoner-menu recruitment of Tier 5 and Tier 6 units, which is currently impossible due to a bug in the base game.

Works as of 1.1.0 and 1.0.10

Permissions and credits
To install, extract to "C:\Steam\steamapps\common\Mount & Blade II Bannerlord\Modules" so that "Recruitable" is a folder inside Modules. i.e., you want the "Recruitable" folder, not the "Recruitable 1.0.4-112-1-0-4-1586293815" folder.

Make sure the dll is unblocked in the file's Windows properties, or it will not run. If your game crashes, this is probably why.

Enable the mod in the launcher.

###########################################################################

Recruitment of prisoners currently works this way: every day, once for every unique stack of prisoner (that is recruitable and tier 6 or below), check an array for a value for their corresponding tier. If that value is above a random value between 0 and 1, add one prisoner in the stack as recruitable, and subtract the corresponding array value by 1.

The default game is missing array values for tier 5 and 6 prisoners, so they are never recruitable. Also by default, you can only recruit one prisoner per tier per day.

Chance to recruit can be edited via values.txt. each line, in order, represents the individual tiers of units, with the first line being tier 0. As of this moment, setting any individual value to e.g. 2 will guarantee two recruitments of a specific tier, provided there are two stacks of that tier. 1.5 would guarantee one, then have a (roughly) 50% chance on the second stack. Values between 0 and 1 serve as a percentage chance to recruit up to one unit of a tier, with chances given for each unique unit in that tier (since you would get multiple rolls).

I will look into a solution for recruiting multiple prisoners of one stack but this code currently cannot do it.

This array is not checked by any code, modify at your own risk; putting non-integer values or adding new lines will lead to undefined behavior.

For reference, the default values are effectively (1, 0.5, 0.3, 0.2, 0.1, 0.0, 0.0). I have taken some creative liberty in my choice of adding .7 and .4, sequentially. If you wish to have a harder game, you may instead use the aforementioned default values and change the previously omitted zeros to 0.1, for example. In my testing, this works just fine, but is not necessarily more fun, so I did not do this myself.

###########################################################################

Allows prisoner-menu recruitment of Tier 5 and Tier 6 units, which is currently impossible due to a bug in the base game (as of 1.0.0.4)

GetDailyRecruitedPrisoners in TaleWorlds.CampaignSystem.SandBox.GameComponents contains 5 entries  1f, 0.5f, 0.3f, 0.2f, 0.1f. This leads to an array size of 5.

When this length is checked in  RecruitPrisonersCampaignBehavior.DailyTick(), it precludes the possibility of Tier 5 and Tier 6 units being marked as recruitable, since the array does not contain enough elements.

This mod adds 0.7f and 0.4f as values in the array, allowing all units to be recruited.

https://github.com/stenellad/Recruitable

For bug reports only please: https://discord.gg/T8rBGS7

###########################################################################

There has been a small amount of debate as to whether or not this is a bug. I have highlighted the relevant code in the following image; green is the check for whether a unit is recruitable. Purple is where the code fails wrt tier 5 and 6 units, because the array it is checking does not have 7 elements, it has 5.

https://i.imgur.com/3ch2Phj.png