Search results

  1. Ster

    Community Modding Documentation

    A light theme is in the works! Until then, I recommend using the Dark Reader Extension (yes, it has a light theme mode too). If you are using light theme mode, go to the More tab and then select Static under Theme Generation to ensure that the background is changed as well.
  2. Ster

    Community Modding Documentation

    Very cool! While I don't think that I would be able to use DocFX for the community docs, I could use some help with descriptions/overviews of important classes. I am writing my own solution to automate building the docs, which will allow for much more freedom in the overall...
  3. Ster

    BL Coding CalculateStrikeMagnitudeForSwing is called on save load

    Modifying damage does not require you to patch via Harmony. Instead, I would recommend that you create a AgentApplyDamageModel to override the old model.You can then read the AttackCollisionData and add your custom logic for damage. You can take a look at SandboxAgentApplyDamageModel class for...
  4. Ster

    [Release v1.0.0] NoHarmony : mod loader for bannerlord

    Agreed. This is one of the reasons I want to get the documentation updated as soon as possible. Too many people are using Harmony for things that don't require it, either out ignorance or or laziness (convenience). Not going to make a comment on the mod loader, just wanted to say that I agree...
  5. Ster

    Learning C# by making a mod for fun

    I learned C# by modding games as well. The issue with this is that you don't get exposed to everything. It took me over a year to finally find out about reflection and 2 years to properly understand how delegates and events actually work. Mostly because I never really knew about them or felt...
  6. Ster

    Learning C# by making a mod for fun

    The best way to learn C# is to go through a proper tutorial. For practicing, I would advise against trying to create a game mod and instead experiment with console applications, which will offer much faster feedback. Doing things this way will be much more beneficial in the long run.
  7. Ster

    BL Coding Stack trace / debug mode?

    Stack traces for crashes should be printed to the logs. You can find these logs in C:\ProgramData\Mount and Blade II Bannerlord\logs. If you are expecting a crash to happen, you can attach a debugger to the application and break when an exception is thrown.
  8. Ster

    Community Modding Documentation

    There isn't a file in that location. Also, the path to your DLL should be Modules\ExampleMod\bin\Win64_Shipping_Client\ExampleMod.dll (relative to your game files). Please verify that your files are in the correct path and that your SubModule.xml file matches what is provided in the tutorial.
  9. Ster

    Community Modding Documentation

    Try it with ViewCreatorManager._viewCreators instead. It seems that the ViewCreatorManager is the only one that adds the behaviors. If this doesn't work, try it with both.
  10. Ster

    Community Modding Documentation

    If you don't know what inheritance is, nor how to properly use it, you are going to have a hard time modding the game. There is no point in me writing a tutorial about inheritance (and other topics) when there are thousands of tutorials you can find by simply Googling the topic. My...
  11. Ster

    Community Modding Documentation

    You can try using reflection to modify the ViewCreatorManager._viewCreators dictionary. If it's a SandBox ViewMethod, you may need to modify the SandBoxViewCreator._viewCreators dictionary instead. I would do this in your OnSubModuleLoad() override. Let me know if this works for you, I'm curious...
  12. Ster

    Community Modding Documentation

    The tutorial/documentation is not meant to teach you C#. You should have a basic understanding of C# before attempting to do the tutorial (this is mentioned). Regarding the SubModule.xml needing to be named such, the tutorial says in step 4: This should have been quite clear, but I will add a...
  13. Ster

    Modding in C# feels incredibly boring and tedious.

    Hopefully the following will help to address your concerns. Then create a method (or extension method) to do exactly this. These are beginner concepts... Easy to do through an AgentApplyDamageModel, which will allow you to access the AttackCollisionData as well for extra logic. You can do...
  14. Ster

    Modding in C# feels incredibly boring and tedious.

    This is decompiled C# code and is not consistent with what the actual code looks like. While the function of the code is the same, the way it is written is not. Also, many things are incredibly easy to add/modify. While there are some things that can definitely be improved, the overall system is...
  15. Ster

    Community Modding Documentation

    I think questions like these are best asked in a separate thread, you'll probably get better support by doing so as well.
  16. Ster

    Community Modding Documentation

    Rename MyMod.xml to SubModule.xml. Otherwise, it won't be found.
  17. Ster

    Community Modding Documentation

    The documentation is still in the early stages, so missing information is to be expected and there are still thousands of things to be covered. The goal for right now is to help modders create their own working mod. Once you have something that works, it's easier to learn by experimentation. If...
  18. Ster

    Community Modding Documentation

    A new tutorial has been added to the community documentation. This time, it's modding Gauntlet UIs without any C#. Don't worry, it's quite easy :xf-smile: View it here: https://docs.bannerlordmodding.com/_tutorials/modding-gauntlet-without-csharp
  19. Ster

    Warning: all mods need all vanilla <DependedModules>

    Good catch. I'll update the documentation with this as well.
  20. Ster

    Bannersample - An example mod using Harmony

    Great guide, however, there's actually a simpler/more organized way of doing this. Create a new Harmony instance called Patcher (can be anything). Call Patcher.PatchAll() in your OnSubModuleLoad() override. Create a new static class called Patches (can be anything). Create a new subclass for...