((BANNERLORD)) ((Partly Solved)) Questions about certain files (any solution will be greatly appreciated)

Users who are viewing this thread

So i have been modding quite a bit on Bannerlord, but i can't for the life of me find some specific files i'd like to edit.

1) I'd like to change the starting year. (Solved, Not solved, note* I thought i had it solved, as i managed to get the year i wanted to display in the game, however, after a passing year, the year did not change, and stayed at the same year)


2) I would also like to be able to increase the amount of days a year there is. (And also i like to know if there are any side effects by changing this)


3) so anyone who has played bannerlord and owned a town, knows about the private stash. I would like to know if it is possible to add gear into those stashes with modding? I would like to have specific uniforms arranged by me, as a reward for conquering towns, which will appear inside the towns stashes. pretty sure it is possible, but i don't know how to go on about it.


4) And then there is the storyline which i would like to rewrite.

I have found that the storyline is writting inside a folder called Sandbox > ModuleData >> Languages >>> std_StoryMode.xml

At first i thought that it was simply a translation file, if someone wants to change the localization, however it was the only file where i could find the storyline writted
So i tried to edit that file, however no changes happened in my game.

Does anyone knows the file on where to edit the main story plot, or is that off limit to modders to edit?
 
Last edited:
Solution
I just wanted to change the writing and manipulate the conversations and the characters which are mentioned, so it is not about a war that happened some years ago, and about a banner.
StoryMode.dll is the official mod that adds main story quests to the game. If you want to modify the main story, you should learn how this mod works, what it does.

Install dnSpy and learn how to use it.
Open StoryMode.dll in dnSpy and find StoryModeSubModule class.
There will be a method AddBehaviors. It adds new behaviors to the game. Some of these behaviors add new dialogues. For example BannerInvestigationQuestBehavior adds dialogues about the battle of Pendraic.
You will find a lot of code with a text there. Let's take for...
3) The Settlement class has a public field Stash
Code:
// Add item
Settlement.CurrentSettlement.Stash.AddToCounts(item, 1);

// Remove item
Settlement.CurrentSettlement.Stash.AddToCounts(item, -1);

4) Most of the main story quests are implemented in StoryMode.dll
There you can find story-related models, behaviors, quests, events.
What exactly do you want to rewrite?
 
Upvote 0
thank you for the respond.

I want to write new conversations for the storyline plot, as i am doing a overhaul, with historical geographies, cultures, and events.
I found myself being done, making the geography, troops, kingdoms, lore, nearly all conversations which i had a urge to change, etc, etc.
And as a bonus, i wanted to include the storyline to fit real life events with historical characters and documented conversations.

I have no desire on changing how the storyline quests works, the plot where you have to talk to lords and so on, will still be in game,
i just wanted to change the writing and manipulate the conversations and the characters which are mentioned, so it is not about a war that happened some years ago, and about a banner.
But instead refer to an historical political crisis which happened in the timeline, i have set my mod in.

So yeah, basically all i am looking for is a way to rewrite all the conversations about the war in the storyline.



Btw.
That code you gave me,where is it located in the files?
And does it permanently add specific items of one's choosing to a town stash?
So they will appear every time a new campaign is started in that specific town, for you to take out of the stash once the town is conquered?

-

Best regards, Rurik
 
Upvote 0
I just wanted to change the writing and manipulate the conversations and the characters which are mentioned, so it is not about a war that happened some years ago, and about a banner.
StoryMode.dll is the official mod that adds main story quests to the game. If you want to modify the main story, you should learn how this mod works, what it does.

Install dnSpy and learn how to use it.
Open StoryMode.dll in dnSpy and find StoryModeSubModule class.
There will be a method AddBehaviors. It adds new behaviors to the game. Some of these behaviors add new dialogues. For example BannerInvestigationQuestBehavior adds dialogues about the battle of Pendraic.
You will find a lot of code with a text there. Let's take for example this line
C#:
answer = new TextObject("{=NGbgfPoP}I was there. Many of the Khuzaits went. Mostly the Khergit clan, who were hungry for glory, but I was also young and hungry for glory so I went along as well.", null);
The {=NGbgfPoP} there is an identifier of that string in the XML files.
You can find this id in std_StoryMode.xml
XML:
<string id="NGbgfPoP" text="I was there. Many of the Khuzaits went. Mostly the Khergit clan, who were hungry for glory, but I was also young and hungry for glory so I went along as well." />
If you create a new mod with the XML like this

MyMod\ModuleData\Languages\my_mod_text.xml
XML:
<?xml version="1.0" encoding="utf-8"?>
<base xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="string">
  <tags>
    <tag language="English" />
  </tags>
  <strings>
    <string id="NGbgfPoP" text="Hello, World!" />
  </strings>
</base>
It will replace original text with the "Hello, World!"

So you need to look through all story behaviors to find all IDs and overwrite their text.

======================

That code you gave me, where is it located in the files?
It is not located anywhere, I wrote it for you as an example of how to use Stash.

And does it permanently add specific items of one's choosing to a town stash?
Yes.
So they will appear every time a new campaign is started in that specific town, for you to take out of the stash once the town is conquered?
No. It just one line of code that adds an item to the stash. If this code is not called, nothing will happen.

You need to add new behavior to your mod in order to listen for an event that triggers when the town was conquered. And when it happens there will be a code that adds items to the stash.

For example, this mod will add a horse to the stash if town was captured by siege
C#:
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.Actions;
using TaleWorlds.Core;
using TaleWorlds.MountAndBlade;

namespace zenDzeeMods_MyMod
{
    public class SubModule : MBSubModuleBase
    {
        protected override void OnGameStart(Game game, IGameStarter gameStarter)
        {
            if (game.GameType is Campaign)
            {
                CampaignGameStarter campaignStarter = (CampaignGameStarter)gameStarter;
                campaignStarter.AddBehavior(new AddItemsToStashBehavior());
            }
        }
    }

    internal class AddItemsToStashBehavior : CampaignBehaviorBase
    {
        public override void SyncData(IDataStore dataStore)
        {
        }

        public override void RegisterEvents()
        {
            CampaignEvents.OnSettlementOwnerChangedEvent.AddNonSerializedListener(this, AddItemsToStash);
        }

        private void AddItemsToStash(Settlement settlement, bool openToClaim, Hero newOwner, Hero oldOwner, Hero capturerHero, ChangeOwnerOfSettlementAction.ChangeOwnerOfSettlementDetail detail)
        {
            if (detail == ChangeOwnerOfSettlementAction.ChangeOwnerOfSettlementDetail.BySiege)
            {
                ItemObject itemObject = Items.FindFirst((ItemObject x) => x.IsMountable);
                settlement.Stash.AddToCounts(itemObject, 1);
            }
        }
    }
}
 
Last edited:
Upvote 0
Solution
Thank you so much for taking the time to explain this and creating the codes to showcase to me, i understand the concept better now, and those files may actually also be the solution to one other problem i have, so thank you.


So before i begin my adventure, i would like to understand this right.
If i sucessfully manage to open up the .dll file, can i then directly edit the file how i want it to be and then simply save it as the original .dll?
and then for an example this id {=NGbgfPoP} (with my new text written) will appear in the game?

And secondly, (apologies if i did not understand this right)

--------------------------
If you create a new mod with the XML like this

MyMod\ModuleData\Languages\my_mod_text.xml
--------------------------

Are you saying that i can skip doing anything with the .dll, as long as i create a new mod (with my overwritten conversations), as long as they refers to the proper conversation id's found in both the .dll file and in the std_StoryMode.xml file?
 
Upvote 0
If i sucessfully manage to open up the .dll file, can i then directly edit the file how i want it to be and then simply save it as the original .dll?
This dll is signed by TaleWorlds. If you want to modify the dll, you have to forge the signature. In most countries, this is considered a crime. Please don't do it.

You need to create a new mod with your dll and your XML files.

Are you saying that i can skip doing anything with the .dll, as long as i create a new mod (with my overwritten conversations), as long as they refers to the proper conversation id's found in both the .dll file and in the std_StoryMode.xml file?
Exactly!
 
Upvote 0
If you want to modify the dll, you have to forge the signature. In most countries, this is considered a crime. Please don't do it.
----------

Oh my, i would not wanna have that to happen, thanks for telling me so i did not make a mistake which i would later regret.


And again thank you so much for sharing your knowledge and helping me out. You have been really helping in understanding certain things, and this was actually a crucial part of the mod i am making, so all due credits to whom they belong to, you have just helped me advance in creating a mod which will make history nerds blush (hopefully, haha)

Have a wonderful day
 
Upvote 0
Back
Top Bottom