Tutorial XML Editing Coding Glorified's Bannerlord Modding Tutorial Video Series

Users who are viewing this thread

One thing I'd love to see a tutorial for, is how to setup Visual Studio to debug MB mods. I've spent a long time trying to figure out why code fails by using message boxes and it would be much easier to be able to step through the code at runtime.
 
@SirHack'nSmash that is actually quite simple to setup and basically the same for every application you want to debug with Visual Studio.
When you run your mod from visual studio, you can set breakpoints so your program will stop at that line and you can exhibit all data that is on the stack and you can then walk through the execution of the code line for line.
Here is the Tutorial from the bannerlord modding documentation on how to setup your project for debugging:
https://docs.bannerlordmodding.com/_tutorials/basic-csharp-mod#debugging-your-project-optional
And here is a visual studio debugging guide by microsoft that should help you getting started:
https://docs.microsoft.com/en-us/visualstudio/debugger/debugging-absolute-beginners?view=vs-2019
 
Thanks @pfinnn, I had managed to figure out steps 1 and 2 last weekend but that wasn't enough. The extra steps in the link you provided are a great help but I still get an error when attempting to start debugging. The dialog message is:
"Unable to find module info file in $BASE/Modules/Native/engine_module.ini"

It gives me the option to try and continue, which just fails to start the game. Examining the "engine_module.ini" file I don't see anything that helps, though I also don't know what I'm looking for. I presume there's some parameter name I need to add with a file path to something?
 
Back
Top Bottom