How to edit chat lines?

Users who are viewing this thread

Mocb

Recruit
I'm trying to make a pretty basic mod which requires editing out some particular chat lines. Lets say edit "Daily Gold Change" message or completely hide it. I assumed this string was hidden in some specific xmls so I tried "Search in Files" in Notepad++. As a result I found it in "std_TaleWorlds_CampaignSystem.xml" located in "SandBox\ModuleData\Languages". So, basically, localization files. However changing it (or commenting a whole line out) does literally nothing - in-game chat daily message is still "Daily Gold Earned X".

So how do I edit it? Do I have to decompile dlls? If so, how can I determine what specific dll to decompile? Also why editing this (and some other) string in aforementioned file has no in-game effect? Are this xml's some kind of placeholders?

My in-game language is set to English, mods are disabled in launcher (although there's quite a few in Module folder).
 
I'm in the same situation! Found the .xmls for languages with the lines I want to modify but they have no effect. I have actually taken a look at the .dlls and found the conversations are called there, along with the id's from the .xmls in the character behaviours. (For example, in BanditsCampaignBehaviour, there is a function called AddDioalogs.) Not sure why if the Id's are referenced here, they don't take effect if changed in the .xml. I haven't worked out how to modify the dialog lines in C#. Will keep you posted on what I find though! Anybody else know anything??:smile:
 
Upvote 0
Hey Mocb,

Did you see this thread yet? https://forums.taleworlds.com/index.php?threads/is-hardcoded-dialogue-the-expectation.408516/

Gonna take some ideas from this and see what I can do tonight hopefully:smile: Add my discord: Sonic#2127
Great find!

I'm decompiling myself and it seems a whole lot of dialog, skill descriptions and chat notifications, among other things, are stored inside dlls, which is super weird.

I'm in the same situation! Found the .xmls for languages with the lines I want to modify but they have no effect. I have actually taken a look at the .dlls and found the conversations are called there, along with the id's from the .xmls in the character behaviours. (For example, in BanditsCampaignBehaviour, there is a function called AddDioalogs.) Not sure why if the Id's are referenced here, they don't take effect if changed in the .xml. I haven't worked out how to modify the dialog lines in C#. Will keep you posted on what I find though! Anybody else know anything??:smile:
I'm not sure this is the best way, but you can use Harmony lib to change functions inside the game code. Or, better yet, refer to solution presented inside SquidyBallinx's thread. That would cause way less incompatibilities between different mods.
 
Upvote 0
Hi Mocb,

I found you can add dialog lines to NPC conversations and player dialog, currently I have only overwritten lines for NPCs by using exisiting dialog IDs and adding more player dialog in response, again using exisiting ids. To do this, I Added the dialog to a gameStarterObject exposed as a parameter in "OnGameStart(...)". Take a look below.

Code:
protected override void OnGameStart(Game game, IGameStarter gameStarterObject)
 {
            if(game.GameType is Campaign &&gameStarterObject is CampaignGameStarter campaignGameStarter)
            {
                campaignGameStarter.AddDialogLine("bandit_start_attacker", "start", "bandit_attacker", "Hello world!", new ConversationSentence.OnConditionDelegate(this.bandit_neutral_greet_on_condition), new ConversationSentence.OnConsequenceDelegate(this.bandit_neutral_greet_on_consequence), 100, (ConversationSentence.OnClickableConditionDelegate)null);
                campaignGameStarter.AddPlayerLine("common_encounter_ultimatum", "bandit_attacker", "common_encounter_ultimatum_answer", "That old spiel? Prepare to fight.", (ConversationSentence.OnConditionDelegate)null, (ConversationSentence.OnConsequenceDelegate)null, 100, (ConversationSentence.OnClickableConditionDelegate)null, (ConversationSentence.OnPersuasionOptionDelegate)null);
                campaignGameStarter.AddPlayerLine("common_encounter_fight", "bandit_attacker", "bandit_attacker_leave", "Innocent noob, you may go.", (ConversationSentence.OnConditionDelegate)null, (ConversationSentence.OnConsequenceDelegate)null, 100, (ConversationSentence.OnClickableConditionDelegate)null, (ConversationSentence.OnPersuasionOptionDelegate)null);
            }
 }

So this code first makes a check that that the game is the campaign, and casts(I don't know term C# code:smile:) the gameStarterObject as a CampaignGameStarter object, which has the dialog functions. Then it adds a dialog line to the bandit_start_attacker situation.
 
Upvote 0
Hi Mocb,

I found you can add dialog lines to NPC conversations and player dialog, currently I have only overwritten lines for NPCs by using exisiting dialog IDs and adding more player dialog in response, again using exisiting ids. To do this, I Added the dialog to a gameStarterObject exposed as a parameter in "OnGameStart(...)". Take a look below.

Code:
protected override void OnGameStart(Game game, IGameStarter gameStarterObject)
{
            if(game.GameType is Campaign &&gameStarterObject is CampaignGameStarter campaignGameStarter)
            {
                campaignGameStarter.AddDialogLine("bandit_start_attacker", "start", "bandit_attacker", "Hello world!", new ConversationSentence.OnConditionDelegate(this.bandit_neutral_greet_on_condition), new ConversationSentence.OnConsequenceDelegate(this.bandit_neutral_greet_on_consequence), 100, (ConversationSentence.OnClickableConditionDelegate)null);
                campaignGameStarter.AddPlayerLine("common_encounter_ultimatum", "bandit_attacker", "common_encounter_ultimatum_answer", "That old spiel? Prepare to fight.", (ConversationSentence.OnConditionDelegate)null, (ConversationSentence.OnConsequenceDelegate)null, 100, (ConversationSentence.OnClickableConditionDelegate)null, (ConversationSentence.OnPersuasionOptionDelegate)null);
                campaignGameStarter.AddPlayerLine("common_encounter_fight", "bandit_attacker", "bandit_attacker_leave", "Innocent noob, you may go.", (ConversationSentence.OnConditionDelegate)null, (ConversationSentence.OnConsequenceDelegate)null, 100, (ConversationSentence.OnClickableConditionDelegate)null, (ConversationSentence.OnPersuasionOptionDelegate)null);
            }
}

So this code first makes a check that that the game is the campaign, and casts(I don't know term C# code:smile:) the gameStarterObject as a CampaignGameStarter object, which has the dialog functions. Then it adds a dialog line to the bandit_start_attacker situation.
Any idea where the lord's dialogues are located? I digged for hours but couldnt find them anywhere.
All I can find are the persuasion dialogues, but not basic ones like "I am here to deliver my demands" and ****.
 
Upvote 0
Back
Top Bottom