In Progress Rebellion Party Leaders Might Have Civilian Armor

Users who are viewing this thread

Version number
No, I didn't use any mods.


Not entirely sure if this is a proper way to explain this but here we go.
Based on the current codebase, rebellion leaders can have civilian equipment rather than battle equipment. This is mainly because of the issue on education_character templates.

This creates several issues, first and most obvious, they are more susceptible to get killed in the battles because of this armour penalty. Secondly, this looks strange on the campaign map and thirdly, if the same template logic is used for other lord generation, then this can also cause the same issue for newly spawned lords.
The issue is the following:
We have the following method in RebellionsCampaignBehavior
private void CreateRebelPartyAndClan(Settlement settlement)
I won't go into specific details however it's using the following piece for template fetching.
List<CharacterObject> e = new List<CharacterObject>();
      foreach (CharacterObject template in CharacterObject.Templates)
        if (template.Occupation == Occupation.Lord && template.Culture == settlement.Culture)
This looks okay at first glance however, we have things like the following in education_character_templates.xml
<NPCCharacter id= "child_education_templates_stage_2_page_0_branch_0_battania"
                name = "{=!}stage_2_page_0_branch_0_battania"
                age = "45"
                default_group = "Infantry"
                is_hero = "false"
                occupation = "Lord"
                culture = "Culture.battania"
                skill_template = "SkillSet.infantry_heavyinfantry_level1_template_skills"
      <face_key_template value = "BodyProperty.fighter_battania" />
        <equipment slot="Head" id="Item.ridged_northernhelm" />
        <equipment slot="Cape" id="Item.battania_shoulder_strap_cloak" />
        <equipment slot="Body" id="Item.ranger_mail" />
        <equipment slot="Gloves" id="Item.ragged_armwraps" />
        <equipment slot="Leg" id="Item.battania_fur_boots" />
      <EquipmentRoster civilian="true"/>
And the template code piece above is able to pick this one and since this equipment roster doesn't have any battle-ready equipment, lords spawned with this equipment is destined to be killed or defeated unless they gather big armies.

Following code ensures that no education/child template is fetched for lord template generation. This is based on StringId so it might not be perfectly reliable.
List<CharacterObject> e = new List<CharacterObject>();
      foreach (CharacterObject template in CharacterObject.Templates)
        if (template.Occupation == Occupation.Lord && template.Culture == settlement.Culture && !template.StringId.Contains("child") && !template.StringId.Contains("education"))
Another solution would be removing the occupation = "Lord" tag from education templates. Since education templates don't seem to be fetched by their "occupation", this removal shouldn't cause any issue.
if (this.Target == EducationCampaignBehavior.ChildAgeState.Year8)
          if (result == 0)
            characterObject = Game.Current.ObjectManager.GetObject<CharacterObject>(string.Format("child_education_templates_stage_{0}_page_0_branch_{1}_{2}", (object) (int) this.Target, (object) strArray[2], (object) child.Culture.StringId));
            characterObject = Game.Current.ObjectManager.GetObject<CharacterObject>(string.Format("child_education_templates_stage_{0}_page_0_branch_{1}_{2}", (object) (int) this.Target, (object) previousOptions[0].Split(';')[2], (object) child.Culture.StringId));

How to Reproduce:
Check source code and explanation above

Have you used cheats and if so which:
I checked the source code. Could be considered as real-life cheating I guess ¯\_(ツ)_/¯

MArdA TaleWorlds

Community Support & Localization
Community Support
Forwarded to the QA team for further investigation. We will reach out again if we need more information. Thanks for reporting and sorry for any inconvenience!
Top Bottom