Lesser_Scholar
Recruit
I present to you what I believe to be the most comprehensive modding tutorial for Bannerlord. In total the whole thing is 8+hrs of (lightly) edited videos covering everything from the tools I use to creating custom UI in GauntletUI.
I don't have any insider knowledge so everything presented is just stuff I've figured out on my own or found in existing documentation. Whenever I found some piece of documentation useful, they are also featured in the videos.
You can find all the videos in this YouTube playlist
But I will also list all the episodes here for your convenience and so that they are searchable.
If you are new to modding I would recommend you try to follow along at least until episode 14. Following along you will learn a little bit about all sorts of internal systems and knowing what is possible/easy will help you decide what types of mods you want to build in the future.
Advanced modders may find the episodes useful as a reference material. Just note that some things might have been explained in previous episodes (e.g. GauntletUI is split over episodes 10, 11 and 15)
Ep 0: Introduction
Introduction and description of the project and its scope. This is meant to provide a gentle landing for people who want to follow the whole series or people new to modding.
Ep 1: Tools and Project setup
We go over the of tools I recommend and use during the series. I will also show how I use the BUTR mod template to create a new project.
Tools I recommend are: Visual Studio Community, Notepad++, VS Code, dnSpy, ripgrep, Blender, Gimp, the mod kit and the BUTR template
Ep 2: Adding new Item XML
We start to modify the game. We create an XML file that adds a new type of item into the game. So we create a new ItemObject.
Ep 3: Programming an HP Potion
We start programming. So we'll write some C# to add the behavior we want to the game combat.
Ep 4: Custom 3D Assets
In this episode we well use Blender to do 3D modelling and load the mesh into our game using the Bannerlord Modding Kit.
Ep 5: Campaign Behavior
In this episode we'll learn how to affect the world state with a simple behavior. By listening to the right campaign events, you can affect the campaign state in pretty much what ever way you want.
Link: https://youtu.be/MGKjydqXPM
Ep 6: Using dnSpy
I show how I use dnSpy to figure out the game API and find code that is relevant to what I want to build.
Link: https://youtu.be/SUBcBx9WWgA
Ep 7: Spawning NPCs
We'll create a LocationCharacter in a town center scene, based on the code used to spawn shop workers in workshops.
Link: https://youtu.be/B6bjiarh4QM
Ep 8: Dialogs
We'll go through adding new dialog trees for our Artisan Brewer NPC. We'll also add new dialog for the tavern keeper.
Link: https://youtu.be/9oeXfDguUl4
Ep 9: Custom CharacterObject
We make our NPCs more interesting by customizing their equipment & animations. We create a custom CharacterObject NPC type with XML.
Link: https://youtu.be/uLCS-xbtCRo
Ep 10: Combat HUD
In this episode we'll take our first stab at GauntletUI. We will look at how screens and UIs are constructed from Gauntlet Layers and how Layers are made of Movies and ViewModels. Then we can create a new Gauntlet Movie .xml UI definition and our own ViewModel.
Link: https://youtu.be/67KRDuPG1mM
Ep 11: Loading UI Sprites. GauntletUI Layouting
In this episode we finish our Combat HUD part with a UI sprite. We also learn a bit about layouting in Gauntlet UI. This is important for learning the basics of making nice looking UI in Bannerlord.
Link: https://youtu.be/TGJe6Ia7_0g
Ep 12: Sound Effects
In this episode we look at how you can add sounds into your mod how to play them from your C# code.
Link: https://youtu.be/SAONxyzDuic
Ep 13: Saving your Mod Data
In this episode we make our artisan workshops have persistent state. This will pave the way for the workshop management features that we'll build in the next couple of episodes.
Link: https://youtu.be/RteqVUpEN8E
Ep 14: Quick Way to edit Menus
In this episode we cover GameMenu and how to add and edit them. This is a system that allows you to easily add interactivity to the campaign map.
Link: https://youtu.be/WIsGqcGOeZQ
Ep 15: Completely custom GauntletUI screen
In this episode we'll create a more complete example of an UI made with Gauntlet. We'll do a UI that we can use to manage your Artisan Workshop Production.
We'll create a new GameState using GameStateManager and write a custom Gauntlet Screen for that new state.
In Gauntlet we'll use the Standard widget library to get some nice buttons and sliders. Our ViewModel will also be a bit more interesting than what was needed for the combat UI.
Link: https://youtu.be/JHRnBrK0zwQ
Ep 16: Using Harmony
We made it this far without talking about Harmony, but now we must change the vanilla code to implement our feature. So we have to talk about Harmony and how to patch the original game code.
I go over harmony docs explaining prefix, postfix and transpiler patch types. Then I override one method with a prefix and then implement effectively the same patch without overriding using a transpiler instead.
Link: https://youtu.be/WmuOjlhulyo
Ep 17: Translation Support
In this episode we'll implement localization or i18n. This will allow people to contribute translation files for your mod.
Link: https://youtu.be/46qr2yCo4lg
Ep 18: Final polishing
Let's tie the remaining loose ends and test the mod to see if we there are any obvious flaws we should fix before release.
Link: https://youtu.be/U0lsx6KrS8w
Ep 19: Packaging & Publishing to Nexus Mods
I show I build my mods for multiple versions of the game using my version switcher program. Also I show how to make your code build with multiple versions using conditional compilation and preprosessor if statements.
Finally we package our mod with 7zip and upload it to Nexus.
Link: https://youtu.be/1788IeNzOYQ
I don't have any insider knowledge so everything presented is just stuff I've figured out on my own or found in existing documentation. Whenever I found some piece of documentation useful, they are also featured in the videos.
You can find all the videos in this YouTube playlist
But I will also list all the episodes here for your convenience and so that they are searchable.
If you are new to modding I would recommend you try to follow along at least until episode 14. Following along you will learn a little bit about all sorts of internal systems and knowing what is possible/easy will help you decide what types of mods you want to build in the future.
Advanced modders may find the episodes useful as a reference material. Just note that some things might have been explained in previous episodes (e.g. GauntletUI is split over episodes 10, 11 and 15)
Ep 0: Introduction
Introduction and description of the project and its scope. This is meant to provide a gentle landing for people who want to follow the whole series or people new to modding.
Ep 1: Tools and Project setup
We go over the of tools I recommend and use during the series. I will also show how I use the BUTR mod template to create a new project.
Tools I recommend are: Visual Studio Community, Notepad++, VS Code, dnSpy, ripgrep, Blender, Gimp, the mod kit and the BUTR template
Ep 2: Adding new Item XML
We start to modify the game. We create an XML file that adds a new type of item into the game. So we create a new ItemObject.
Ep 3: Programming an HP Potion
We start programming. So we'll write some C# to add the behavior we want to the game combat.
Ep 4: Custom 3D Assets
In this episode we well use Blender to do 3D modelling and load the mesh into our game using the Bannerlord Modding Kit.
Ep 5: Campaign Behavior
In this episode we'll learn how to affect the world state with a simple behavior. By listening to the right campaign events, you can affect the campaign state in pretty much what ever way you want.
Link: https://youtu.be/MGKjydqXPM
Ep 6: Using dnSpy
I show how I use dnSpy to figure out the game API and find code that is relevant to what I want to build.
Link: https://youtu.be/SUBcBx9WWgA
Ep 7: Spawning NPCs
We'll create a LocationCharacter in a town center scene, based on the code used to spawn shop workers in workshops.
Link: https://youtu.be/B6bjiarh4QM
Ep 8: Dialogs
We'll go through adding new dialog trees for our Artisan Brewer NPC. We'll also add new dialog for the tavern keeper.
Link: https://youtu.be/9oeXfDguUl4
Ep 9: Custom CharacterObject
We make our NPCs more interesting by customizing their equipment & animations. We create a custom CharacterObject NPC type with XML.
Link: https://youtu.be/uLCS-xbtCRo
Ep 10: Combat HUD
In this episode we'll take our first stab at GauntletUI. We will look at how screens and UIs are constructed from Gauntlet Layers and how Layers are made of Movies and ViewModels. Then we can create a new Gauntlet Movie .xml UI definition and our own ViewModel.
Link: https://youtu.be/67KRDuPG1mM
Ep 11: Loading UI Sprites. GauntletUI Layouting
In this episode we finish our Combat HUD part with a UI sprite. We also learn a bit about layouting in Gauntlet UI. This is important for learning the basics of making nice looking UI in Bannerlord.
Link: https://youtu.be/TGJe6Ia7_0g
Ep 12: Sound Effects
In this episode we look at how you can add sounds into your mod how to play them from your C# code.
Link: https://youtu.be/SAONxyzDuic
Ep 13: Saving your Mod Data
In this episode we make our artisan workshops have persistent state. This will pave the way for the workshop management features that we'll build in the next couple of episodes.
Link: https://youtu.be/RteqVUpEN8E
Ep 14: Quick Way to edit Menus
In this episode we cover GameMenu and how to add and edit them. This is a system that allows you to easily add interactivity to the campaign map.
Link: https://youtu.be/WIsGqcGOeZQ
Ep 15: Completely custom GauntletUI screen
In this episode we'll create a more complete example of an UI made with Gauntlet. We'll do a UI that we can use to manage your Artisan Workshop Production.
We'll create a new GameState using GameStateManager and write a custom Gauntlet Screen for that new state.
In Gauntlet we'll use the Standard widget library to get some nice buttons and sliders. Our ViewModel will also be a bit more interesting than what was needed for the combat UI.
Link: https://youtu.be/JHRnBrK0zwQ
Ep 16: Using Harmony
We made it this far without talking about Harmony, but now we must change the vanilla code to implement our feature. So we have to talk about Harmony and how to patch the original game code.
I go over harmony docs explaining prefix, postfix and transpiler patch types. Then I override one method with a prefix and then implement effectively the same patch without overriding using a transpiler instead.
Link: https://youtu.be/WmuOjlhulyo
Ep 17: Translation Support
In this episode we'll implement localization or i18n. This will allow people to contribute translation files for your mod.
Link: https://youtu.be/46qr2yCo4lg
Ep 18: Final polishing
Let's tie the remaining loose ends and test the mod to see if we there are any obvious flaws we should fix before release.
Link: https://youtu.be/U0lsx6KrS8w
Ep 19: Packaging & Publishing to Nexus Mods
I show I build my mods for multiple versions of the game using my version switcher program. Also I show how to make your code build with multiple versions using conditional compilation and preprosessor if statements.
Finally we package our mod with 7zip and upload it to Nexus.
Link: https://youtu.be/1788IeNzOYQ