BL Coding Changing troop group names and default group assignment

Currently viewing this thread:

Aleolex

Sergeant
I'm trying to change the soldier group assignments, because I'm tired of the game refusing to abide by my groups when I enter a battle with my own clan members. I already attempted this using "Module_Strings" from native to override the group names, and "spnpccharacters" And manually changing the group assignments. That didn't work. So if somebody who actually knew what they were doing had any advice, it would be greatly appreciated.

Originally, I latched onto these specific lines in SPNPCCharacters.xml, and I went through manually changing most of the actual soldiers and find/replacing the rest:
There aren't that many soldiers in the game, so it wasn't hard. Unfortunately, when I tried to load it into the game, it didn't recognize any of my changes. For instance, I changed the recruit default group to ranged, and when I went into the game, it still showed them grouped under infantry by default.
I also tried to change the actual names of the groups through module_strings.xml, copied from the Native module folder.
Which, as it turns out, did absolutely nothing, because, well, for one I have no idea what I'm doing, for two I failed to realize that more files than just spnpccharacters.xml referenced the default group. So now I'm thinking, either something other than the .xml files governs group distribution, I messed something up (likely), or I have to manually change every single instance of default_group in every single file, and I don't know which one.

Anyway, here's the project I put together so far if someone wants to take a whack at it.
 
Last edited:

Aleolex

Sergeant
using System;

namespace TaleWorlds.Core
{
// Token: 0x0200005F RID: 95
public enum TroopType
{
// Token: 0x04000379 RID: 889
Invalid = -1,
// Token: 0x0400037A RID: 890
Infantry,
// Token: 0x0400037B RID: 891
Ranged,
// Token: 0x0400037C RID: 892
Cavalry,
// Token: 0x0400037D RID: 893
NumberOfTroopTypes
}
}
Looks like it's hardcoded, so, nevermind then.
 
Upvote 0
Top Bottom