Mount & Blade II: Bannerlord

Mount & Blade II: Bannerlord

View Stats:
Lawh Apr 10, 2022 @ 6:18am
Modding Help?
Hey!

I'm not familiar with modding Bannerlord, and I was wondering, could someone help me get started with a really simple mod? I made this mod by editing the actual game files, where the speed of parties on the world map was greatly reduced.

I would like to know how to achieve this by creating a mod instead. I feel that if I see how it's done, I could use it on other things and get started. I checked out the modding tutorial Taleworlds put out, but it didn't help me.
< >
Showing 1-10 of 10 comments
AfLIcTeD Apr 10, 2022 @ 6:47am 
You would be best off posting on the TW forums modding pages or Nexus. That's where most of the modders hang out. Maybe check some discords too. Steam really isn't a mod making discussion scene.
Lawh Apr 10, 2022 @ 6:56am 
Gotcha, thanks!
Although, we can have one nonetheless!

This is your first port of call:
https://github.com/Bannerlord-Modding/Documentation

Once you understand how to setup correctly, then you can begin with implementing changes.

The biggest task for anyone starting out is to get comfortable reading the games code and understanding how stuff works internally. I'm quite new to modding too and have just started to get more complex with what I am doing. A lot of trial an error will be involved.

To set party speeds, off the top of my head and looking at similar implementations, one way you could do so, would be to create your own class and then using the ExplainedNumber class, 'x.AddFactor(percentageValue, null)' <- which will apply the new value (you will have to prepare the value as a valid percentage change). Might need harmony - but unsure on that and I haven't actually tried using harmony yet myself.

Best advice though, get a dll viewer such as dnspy and have a look at other mods and native files to see how they do things similar to what you'd like to implement.
Last edited by ᴍᴜꜱʜ-ᴄʀÆᴍ?; Apr 10, 2022 @ 7:34am
Lawh Apr 10, 2022 @ 12:30pm 
Ok, I've spent the evening looking at things, and I have a few issues.

I haven't really gotten anywhere. Just as an example, I want to change a single variable which is speed on the campaign map for all parties. I can decompile the files and so on, but that will be overwritten as soon as the game updates. I tried accessing certain things in the files, but what I want seems to be sealed, so I can't access it. Is this a permanent limitation to using a standalone mod?
Lawh Apr 10, 2022 @ 12:31pm 
I also asked in the other forum but there is no response, and I asked something a few months ago and I don't think I got a response to that either.
You need a way to save the settings, and probably need harmony as mentioned above. In your main you need to override OnGameLoaded, and then something like deserialize your settings, however you decide to save them, assuming you want users to have access to a file to set the value they want. Or override OnGameInitilizationFinished, but honestly I don't really know - I think you'll need harmony either way. Your best bet is reading through threads on official forums and reading other mod authors code to see how they have done things.
Lawh Apr 10, 2022 @ 1:04pm 
I've been looking all evening and the only thing missing really is me having access to certain files and a lack of knowledge of C#.

I found the variables I would like to change, and so on using dnspy. I've watched a tutorial but that did something different, and of course I ran into something I couldn't duplicate in his tutorial, which eats away at confidence, because not only have you got something really simple you want to do, but everything you see goes through all kinds of things but never addressing the stuff you need, or if they do, it doesn't work.
I don't know of any up-to-date worth watching videos - reading is your main resource. The github I linked to has a lot of useful info but it is wip. Lack of C# knowledge might be holding you back - what you are trying to implement has been implemented and is working in mods for 1.7.2 as we speak.

As for looking through files - another good way is reading the meta-data, load up a project in Visual studio and reference all the native dlls, write some TW native code and then view its definitions, I had access to everything I've been looking for that way.
Last edited by ᴍᴜꜱʜ-ᴄʀÆᴍ?; Apr 10, 2022 @ 1:15pm
Unleashed Apr 12, 2022 @ 11:04am 
All instructions are with every mod. just subscribe to Nexus, download mod manager and you're set.
https://www.nexusmods.com/mountandblade2bannerlord
StoleMyCoconut Apr 12, 2022 @ 2:48pm 
It's not easy to get into modding like this even the most simple things are like pretty hard to do. And you also need to know that I'd you start our the most simple things will take ages I'm sure you will understand it better over time but. The question is is it worth it for the amount of time you will be investing. As psycho already said there's a whole programming language behind it. One of the reasons I do somewhat understand it is because I did watch c# tutorials c++ tutorials and even did modding for aoe3 which uses xs which is a semi c# language really lol. And then I'm saying that I semi understand it I couldn't get it to work either and when I got an tutorial from a fellow modder I was like. What the heck. This is bloody frustrating being forced to use certain tools. Maybe I get back to it at a later point quite sure of that but. For now given that it's early access alot of the game things are changing and I don't blame TW for that. They do it for the better which is good and I think they do a very good job really.

Like how much time you want to invest into getting things to work is a serious question. And are you willing to redo it all in the future if need be. For me that's when I decided to postpone it to a later date when I know less things are going to change. But hopefully that's like atleast 2 years later because I think the game does need quite some development still but I'm also sure TW can definitely do it. Anyways if you decided you want to your best bet is to ask here https://discord.gg/KZ4J9qMt
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Apr 10, 2022 @ 6:18am
Posts: 10