Documentation Coding Community Modding Documentation

Users who are viewing this thread

Ah, just figured the ui.toggle_debug_mode out.
Enable it, then go back to Visual Studio change something, build and watch it update ingame.

A quick question to modding the UI following the above linked tutorial:
How to use:
ui.toggle_debug_mode

It doesn't seem to do anything. I tried that command on different screens, mainscreen, quest screen (where the modified title text does show), party screen, but it doesn't actually do anything.
 
Last edited:
Hey mate it's really good and I'd love to contribute. However it seems to be missing a lot of key information. I'm left with more questions than answered. I've followed what I could in terms of creating a basic readable module for the launcher. Named my Module Folder exactly the same as the XML. And the ID's are exactly the same. Case Sensitive. However when I load up the launcher it does not see my new module at all. Am I missing something? Do I need to copy any folders out of the Native? I've basically got a Singleplayer module. No DLL yet. So I left out the SubModules as per instructions. Any tips? Thanks :smile:

Also, do you need all the depended modules for a basic Singleplayer mod? I'd imagine I don't need CustomBattle, Sandbox + SandBoxCore? What about Story Mode though? What's the difference between that and Native? Is Native the Base game and Story Mode is the campaign? It's very confusing haha.
 
Hey mate it's really good and I'd love to contribute. However it seems to be missing a lot of key information. I'm left with more questions than answered. I've followed what I could in terms of creating a basic readable module for the launcher. Named my Module Folder exactly the same as the XML. And the ID's are exactly the same. Case Sensitive. However when I load up the launcher it does not see my new module at all. Am I missing something? Do I need to copy any folders out of the Native? I've basically got a Singleplayer module. No DLL yet. So I left out the SubModules as per instructions. Any tips? Thanks :smile:

Also, do you need all the depended modules for a basic Singleplayer mod? I'd imagine I don't need CustomBattle, Sandbox + SandBoxCore? What about Story Mode though? What's the difference between that and Native? Is Native the Base game and Story Mode is the campaign? It's very confusing haha.

I had the same issue fixed like this: make sure to name your xml in the submodule folder 'submodule.xml'
 
Hey mate it's really good and I'd love to contribute. However it seems to be missing a lot of key information. I'm left with more questions than answered. I've followed what I could in terms of creating a basic readable module for the launcher. Named my Module Folder exactly the same as the XML. And the ID's are exactly the same. Case Sensitive. However when I load up the launcher it does not see my new module at all. Am I missing something? Do I need to copy any folders out of the Native? I've basically got a Singleplayer module. No DLL yet. So I left out the SubModules as per instructions. Any tips? Thanks :smile:

Also, do you need all the depended modules for a basic Singleplayer mod? I'd imagine I don't need CustomBattle, Sandbox + SandBoxCore? What about Story Mode though? What's the difference between that and Native? Is Native the Base game and Story Mode is the campaign? It's very confusing haha.
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 you follow the step-by-step instructions for the tutorial, you should have a working mod. Going off of what you have said, it seems that you probably don't have your mod in the right location. Go to your game files and open the Modules folder. Inside this folder is where you should create a folder for your mod and then inside that folder, you will put your SubModule.xml. Once you do this, your mod should be visible from the launcher's Singleplayer > Mods tab.

The depended modules are a bit buggy right now and seem to be causing issues all around for some people, so experiment with them at your own discretion. In theory, you should add any modules that your mod depends on to your Depended Modules. Most mods will depend on Native as it contains many assets required to play the game, the SandBox/SandBoxCore modules are for campaign, you may not need CustomBattles though.
 
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 you follow the step-by-step instructions for the tutorial, you should have a working mod. Going off of what you have said, it seems that you probably don't have your mod in the right location. Go to your game files and open the Modules folder. Inside this folder is where you should create a folder for your mod and then inside that folder, you will put your SubModule.xml. Once you do this, your mod should be visible from the launcher's Singleplayer > Mods tab.

The depended modules are a bit buggy right now and seem to be causing issues all around for some people, so experiment with them at your own discretion. In theory, you should add any modules that your mod depends on to your Depended Modules. Most mods will depend on Native as it contains many assets required to play the game, the SandBox/SandBoxCore modules are for campaign, you may not need CustomBattles though.

Thanks for your hastey reply. I have my mod xml located as followed: Bannerlord\Modules\MyMod\MyMod.xml
And I've even tried copying the Native modules subfolders into that mod folder.

XML File reads as follows:


<Module>
<Name value="MyMod"/>
<Id value="MyMod"/>
<Version value="v1.0.0"/>
<SingleplayerModule value="true"/>
<MultiplayerModule value="false"/>
<DependedModules>
<DependedModule Id="Native"/>
<DependedModule Id="SandBoxCore"/>
<DependedModule Id="SandBox"/>
<DependedModule Id="StoryMode"/>
</DependedModules>
<Xmls>
<XmlNode>
<XmlName type="1" id="Items" path="customitems"/>
</XmlNode>
<XmlNode>
<XmlName type="1" id="SPCultures" path="customcultures"/>
</XmlNode>
<XmlNode>
<XmlName type="1" id="NPCCharacters" path="customcharacters"/>
</XmlNode>
</Xmls>
</Module>
 
Aaah of course! Thank you sir, I for some reason was under the assumption that SubModule.xml was just a placeholder name haha. Do you think we could add that specificy to the docos incase somebody else falls into that trap or am I just special? xD

I take it you don't need ALL of the contents of Native inside the mod folder either? As in, to modify later?
 
Aaah of course! Thank you sir, I for some reason was under the assumption that SubModule.xml was just a placeholder name haha. Do you think we could add that specificy to the docos incase somebody else falls into that trap or am I just special? xD

That is exactly what I explained to you 2 posts above.

I had the same issue fixed like this: make sure to name your xml in the submodule folder 'submodule.xml'
 
I've got the basis of whats going on down, but am unable to figure out how to look at the taleworlds code itself and not sure if its possible (im sure it is). For example, if i wanted to edit say, the skills system, I would need to know what classes, methods, and variables they use for me to then override and edit, however when I go through the references and object browser in visual studio it wont show me the actual code. I come from UE4 and they have their own documentation so I never had to worry about that.
 
That's a good question actually. I'm assuming you have linked all the DLL files, I'd imagine they would be buried in some kind of xml file somewhere which I "believe" is read by these DLLs? Is that fair to assume that?

Also, in the documentation, Step 4: Setup an override for the OnSubModuleLoad() inherited method.
Now, I'm not too cluey with code, and I'm doing my darndest to learn on the fly (Inheriting the MBSubModuleBase was I'm assuming the base class for the MySubModule class, so I.E class MySubModule : MBSubModuleBase), but I'm stuck on the next step, 4. Is the Override function being written straight into the MySubModule class as a public override method? What is it's return type and what method are we actually overriding?

Or is OnSubModuleLoad() the method the actual method in our class we are overriding? And from what? Man I feel like a complete dunce sometimes with coding.

This is what I've got so far but I'm getting an error saying: The modifier 'override' is not valid for this item and that the method must have a return type. This is my code:

using TaleWorlds.Core;
using TaleWorlds.Localization;
using TaleWorlds.MountAndBlade;

namespace MyMod
{
class MySubModule : MBSubModuleBase
{
public override OnSubModuleLoad()
{
Module.CurrentModule.AddInitialStateOption(new InitialStateOption("Message",
new TextObject("Message", null),
9990,
() => { InformationManager.DisplayMessage(new InformationMessage("Hello World")); },
false));
}
}
}
 
Last edited:
I've got the basis of whats going on down, but am unable to figure out how to look at the taleworlds code itself and not sure if its possible (im sure it is). For example, if i wanted to edit say, the skills system, I would need to know what classes, methods, and variables they use for me to then override and edit, however when I go through the references and object browser in visual studio it wont show me the actual code. I come from UE4 and they have their own documentation so I never had to worry about that.


You want to watch this video from GlorifiedPig where he explains this :
 
That's a good question actually. I'm assuming you have linked all the DLL files, I'd imagine they would be buried in some kind of xml file somewhere which I "believe" is read by these DLLs? Is that fair to assume that?

Also, in the documentation, Step 4: Setup an override for the OnSubModuleLoad() inherited method.
Now, I'm not too cluey with code, and I'm doing my darndest to learn on the fly (Inheriting the MBSubModuleBase was I'm assuming the base class for the MySubModule class, so I.E class MySubModule : MBSubModuleBase), but I'm stuck on the next step, 4. Is the Override function being written straight into the MySubModule class as a public override method? What is it's return type and what method are we actually overriding?

Or is OnSubModuleLoad() the method the actual method in our class we are overriding? And from what? Man I feel like a complete dunce sometimes with coding.

This is what I've got so far but I'm getting an error saying: The modifier 'override' is not valid for this item and that the method must have a return type. This is my code:

using TaleWorlds.Core;
using TaleWorlds.Localization;
using TaleWorlds.MountAndBlade;

namespace MyMod
{
class MySubModule : MBSubModuleBase
{
public override OnSubModuleLoad()
{
Module.CurrentModule.AddInitialStateOption(new InitialStateOption("Message",
new TextObject("Message", null),
9990,
() => { InformationManager.DisplayMessage(new InformationMessage("Hello World")); },
false));
}
}
}

OnSubModuleLoad is not a public method, its a protected method, thus it would be "protected override void OnSubModuleLoad()"


You want to watch this video from GlorifiedPig where he explains this :


Appreciate it!
 
Hello, I'm trying to make a mod that will edit and add more policies to Kingdoms. So far, I haven't found any XML docs under ModuleData for any modules that would have that stuff so I'm guessing this will have to be a .dll mod. What method would I have to override in order to do this? Which .dll could I open up to see how the game currently does policies? The documentation is very basic right now so I have no idea what anything does when I open up a .dll aside from how to create a basic mod.
 
Alright so I found out there is some stuff for policies and decisions under TaleWorlds.CampaignSystem and found the PolicyObject initializer but I haven't been able to find where the PolicyObjects are actually created. Nor have I found out where to see what their effects are, there is just some UI TextObject and weights. Any clues as to where I can find the array the policies are stored in?
 
Back
Top Bottom