Mount & Blade II: Bannerlord

Mount & Blade II: Bannerlord

38 ratings
How to edit units
By Jon Hellhopper
Short guide on how to get started with editing your own units in Bannerlord.
2
   
Award
Favorite
Favorited
Unfavorite
Getting Started
1. Right-click on M&B Bannerlord --> Manage --> Browse local files

Modules
Now open the folder: Modules

SandboxCore
Open the folder SandboxCore (ignore the other folders for now)

ModuleData
Now head for the folder ModuleData

spnpccharacters.xml
Open the spnpccharacters.xml with any editor ( I recommend Notepad++ )
(!BUT FIRST MAKE A COPY JUST TO BE SAFE!)

fin
(!! BEFORE YOU CHANGE ANYTHING, MAKE SURE YOU MADE A COPY OF THE .xml !!)

This should look like this now:



You can skip the following textwall if you want and head to the next section :)


Under skills you can change the value of the skills,
under equipment you can change the equipment the unit has. (some might have multiple equipment trees. you can give the trees different equipment, so that the unit gets randomized equipment in battle.)

for example: EQ-tree 1 got 1 sword:
<equipment slot="Item0"
id="Item.sturgia_sword_2_t3" />

and EQ-tree 2 got an axe:
<equipment slot="Item0"
id="Item.sturgia_axe_3_t3" />

now the unit can hold a sword OR an axe in battle, since both weapons are for item slot 0 ("Item0") so there is a 50% chance for one of the items. if you make 3 different "Item0" weapons there is a 33.333333% chance and so on.

------------------------------------------------------------------------------------------------------------------------------------
Character sektion

<NPCCharacter id="sturgian_soldier" <-------- don't change
default_group="Infantry" <-------- infantry, archer or chavalry etc
level="16" <------- level of the unit
civilianTemplate="NPCCharacter.sturgia_troop_civilian_template_t2" <--- Character model
name="{=brlJJW5I}Sturgian Veteran Fyrd" <-------- Ingame Name
occupation="Soldier" <---- don't change
culture="Culture.sturgia" <---- don't change
skill_template="NPCCharacter.infantry_heavyinfantry_level16_template_skills"> <--- don't change

:D
------------------------------------------------------------------------------------------------------------------------------------
Gear section

<equipmentSet> <--- Start <...>
<equipment slot="Item0" <---- item 1
id="Item.sturgia_sword_2_t3" />
<equipment slot="Item1" <--- item 2
id="Item.northern_round_shield" />
<equipment slot="Item2" <--- item 3
id="Item.northern_spear_2_t3" />
<equipment slot="Head" <--- Headgear
id="Item.goggled_helmet_over_leather" />
<equipment slot="Cape" <--- Shouldergear
id="Item.wrapped_scarf" />
<equipment slot="Body" <--- Bodygear
id="Item.northern_padded_gambeson" />
<equipment slot="Gloves" <--- Handgear
id="Item.highland_gloves" />
<equipment slot="Leg" <--- Thicc legs
id="Item.highland_boots" />
</equipmentSet> <--- end (always with </...>)

easy isn't it? just don't do any spelling mistakes and it will work out :D


------------------------------------------------------------------------------------------------------------------------------------

Skill sektion (oh i'm so organized xD )
just dont change the names of the "<skill id="..." and you will be fine. just touch the numbers and destroy the balance of the game, haha. or fix the heavy lancers...you know which ones...

<skills>
<skill id="Athletics"
value="70" />
<skill id="Riding"
value="30" />
<skill id="OneHanded"
value="70" />
<skill id="TwoHanded"
value="40" />
<skill id="Polearm"
value="70" />
<skill id="Bow"
value="30" />
<skill id="Crossbow"
value="10" />
<skill id="Throwing"
value="40" />
</skills>

------------------------------------------------------------------------------------------------------------------------------------
Facetime. Honestly, i never touched this.

<face>
<face_key_template value="NPCCharacter.villager_sturgia" /> <---- change to make beautiful
</face>
But wait! There is more!
In the spitems.xml you can find all the precious item-ID's your heart desires.



Now have fun messing with the game. :D

-------------------------------------------------------------------------------------------------------------------------------------

The original xml is gone! What now?!

If you f'ed it up and forgot to make a copy of the xml. you can always delete it and repair M&B Bannerlord via Steam. After that, the old xml should be back.

------------------------------------------------------------------------------------------------------------------------------------
Timesaver:

copy the xml, and edit the copy on a second screen, while playing. so you can look up the armor etc ingame.

------------------------------------------------------------------------------------------------------------------------------------
how to get all items ingame:

\documents\mygames\Mount and Blade II Bannerlord\Configs\engine_config.txt ---> cheat_mode = 0

change the 0 to a 1
now you are able to look up all ingame items if you open your inventory. and then search for the ID in the spitems.xml via search.

Praise the sun and have fun! :)

If anyone with the actual technical know-how is here: i'm open for any corrections and detailed information. i will edit the guide accordingly :)

Suggestions from the Commentary Section:
Closet Deadpooler :

Found the file for parties:
partyTemplates.xml

You can find it in SandBox/ModuleData
<MBPartyTemplate id="ID_template" >
<stacks>
<PartyTemplateStack min_value="4" max_value="36" troop="NPCCharacter.(id of troop)" />
</stacks>

And you can edit existing parties here to add in new troops.

I *think* you might be able to assign upgrades with this line from the file you mention in your post:

<upgrade_targets>
<upgrade_target id="NPCCharacter.company_of_the_boar_tier_3" />
</upgrade_targets>

Where company_of_the_boar_tier_3 is the unit's id in the file, I have no idea of how recruiting is handled or how you could assign new units to say a player cultural group or something. You could probably do it with a party template file, by having them be prisoners or an enemy you could recruit but I haven't seen any party templates in that file.
________________________________________________________________________________

Is this okay for you? If not, i will delete this section :)
Making custom units aviable in town (did not test it cuz of time reasons, so it might not work properly :v)
This might help with the units spawning in the towns. Might not work, got no time to actually test it :'D






or like this, I feel like the latter was the actual functional one. (Been a while)



16 Comments
Jon Hellhopper  [author] 6 Aug, 2024 @ 10:06am 
I'm sorry if it's not working, been a while since I touched Bannerlord. If this wonky stuff was of any help, I'm glad..otherwise: please tell me if not, then I will delete it from the guide.
Jon Hellhopper  [author] 6 Aug, 2024 @ 9:27am 
I updated the guide, but I have not tested it so far, should theoretically work...but yeah :D
Raykoben 20 Jul, 2024 @ 10:59am 
Hi. I have a mod that adds a new unit, but it can be get only in taverns and want to make it recruitable as a standard unit. I'm comparing constantly some values of the mod but still don't appear in the towns. (Changed their ID from mercenary to soldier but seems nos enough)
TomatoCherries 11 May, 2021 @ 7:54pm 
thanks
Jon Hellhopper  [author] 7 May, 2021 @ 10:37am 
ignore the brackets ^^ i think i just left them as they are :v
Jon Hellhopper  [author] 7 May, 2021 @ 10:36am 
you can just change the "Sturgian Veteran Fyrd" into something else
TomatoCherries 7 May, 2021 @ 8:42am 
what are you supposed to type in name?

example: name="{=brlJJW5I}Sturgian Veteran Fyrd"



is this random: {=brlJJW5I} ?

can i type anything in place of this?
Zaylidin 25 Jul, 2020 @ 7:36am 
Thank you very much for this guide, it has helped me tremendously! :8bitheart:
Now my Vlandians look more like Rhodoks :Halb:
ALBERT SUCKS 20 Jul, 2020 @ 7:14pm 
wow! nice job. very cool.
GInger 12 Jul, 2020 @ 4:50am 
1