Search results for query: *

  1. mrj760

    Resolved 1.2 Beta - two bugs and some wonky behaviour

    Hey, our team is aware of this first issue you have mention and it is fixed. The fix will be implemented to the game as soon as possible. The AI beviour you have mentioned is the intended design, the kingdoms will get aggressive as they lose land and money to compensate their losses. Thank you for your time and sorry for the inconvenience.
    Hi, is the fix for the siege going to be patched in? When mercenary factions end their contract with an enemy faction who is besieging me it still kicks me out of the fief while defending and leaves the rest of my army's parties inside.
  2. mrj760

    Final steps to package mod for distribution

    @NPC99 Sorry. For some reason it used to not work when I tried deleting all the .dll files generated in my Visual Studio build except for the harmony one and my own. But now it does.
    Not sure what went wrong before but to OP and anyone else... yeah just delete all the .dll files of assemblies you referenced but keep the 0Harmony.dll and yourmod.dll
  3. mrj760

    Digital Companion Release

    some of y'all are needlessly negative. just don't use the thing if you don't want to. No need to be snarky like a 14 year old mad at their teacher
  4. mrj760

    Final steps to package mod for distribution

    You ever figure this out? Curious myself
  5. mrj760

    Where is the code which spawns troops and chooses gear from their XML equipment rosters?

    eyyyyy got it let's go
    C#:
            [HarmonyPrefix]
            [HarmonyPatch(typeof(Equipment), nameof(Equipment.GetRandomEquipmentElements))]
            public static bool AssignGearPatch(ref Equipment __result, BasicCharacterObject character, bool randomEquipmentModifier, bool isCivilianEquipment = false, int seed = -1)
            {
                Equipment equipment = new Equipment(isCivilianEquipment);
                List<Equipment> list = character.AllEquipments.Where((Equipment eq) => eq.IsCivilian == isCivilianEquipment && !eq.IsEmpty()).ToList();
                if (list.IsEmpty())
                {
                    __result = equipment;
                    return false;
                }
    
                int count = list.Count;
                Random random = new Random(seed);
                int weaponSetNo1 = MBRandom.RandomInt(count);
                for (int i = 0; i < 12; i++)
                {
                    equipment[i] = list[weaponSetNo1].GetEquipmentFromSlot((EquipmentIndex)i);
                    if (randomEquipmentModifier)
                    {
                        ItemModifier itemModifier = equipment[i].Item?.ItemComponent?.ItemModifierGroup?.GetRandomItemModifierLootScoreBased();
                        if (itemModifier != null)
                        {
                            equipment[i].SetModifier(itemModifier);
                        }
                    }
                }
    
                __result = equipment;
                return false;
            }
  6. mrj760

    Where is the code which spawns troops and chooses gear from their XML equipment rosters?

    Each roster is only treated as a unique equipment set in the Encyclopaedia. In game, the roosters are just treated as pools from which agents are randomly equipped. AFAIK this is Taleworlds intended behaviour to ensure variety as there will be many more agents of a type that rosters in large battles.
    I don’t know if this is hard-coded in C++ or could be modified in C# to match the encyclopaedia treatment, allowing agents to be randomised from fixed rosters rather than pooling kit. You probably need to ask in the #bl-coding channel of Mount & Blade Modding discord.
    I see. The reason behind that behaviour makes total sense, but it does make it difficult to manually create your own varieties while accomodating for balance (e.g. one roster with a strong chest piece, one roster with a weak chest piece but strong cape).
    I ended up finding the c# code at TaleWorlds.Core.Equipment.GetRandomEquipmentElements so I think I can make a harmony patch, but #bl-coding will be useful if I find myself stumped. Thank you @NPC99
  7. mrj760

    Where is the code which spawns troops and chooses gear from their XML equipment rosters?

    I had this [link] problem a while ago... Since then I have moved my mod to XSL entirely but the issue is still not solved and I'm tired of ignoring it. Rosters on the battlefield are still mixed, which adds unwanted and unbalanced RNG to the fights since soldiers are often either too weak or...
  8. mrj760

    Troops are semi-ignoring Equipment Rosters on battlefield

    My problem is best described by the picture below, so let me explain what you're seeing. There are 2 Equipment Rosters I made available to the Khuzait Nomad troop: 1) In the first Roster, the troop has an Iron Saber and a headpiece. 2) In the second Roster, the troop has a wooden hammer, a...
  9. mrj760

    How to replace (rather than add to) Equipment Rosters with XML ?

    For anyone else who might come across this, here is my final xslt result to replace entire troops.
    I copied my original XML file over then used regex with find&replace in VSCode to change the format from XML to XSLT.
    Thank you again @order_without_power
    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     
        <xsl:output omit-xml-declaration="yes"/>
     
        <!--Identity Transform -->
        <xsl:template match="@*|node()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
    
        <xsl:template match='NPCCharacter[@id="aserai_recruit"]' >
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <face>
                    <face_key_template value="BodyProperty.fighter_aserai" />
                </face>
                <skills>
                    <skill id="Athletics" value="18" />
                    <skill id="Riding" value="12" />
                    <skill id="OneHanded" value="30" />
                    <skill id="TwoHanded" value="10" />
                    <skill id="Polearm" value="30" />
                    <skill id="Bow" value="10" />
                    <skill id="Crossbow" value="10" />
                    <skill id="Throwing" value="10" />
                </skills>
                <upgrade_targets>
                    <upgrade_target id="NPCCharacter.aserai_tribesman" />
                    <upgrade_target id="NPCCharacter.aserai_mameluke_soldier" />
                </upgrade_targets>
                <Equipments>
                    <EquipmentRoster>
                        <equipment slot="Item0" id="Item.military_fork_pike_t3" />
                        <equipment slot="Head" id="Item.aserai_civil_e_hscarf" />
                        <equipment slot="Body" id="Item.aserai_civil_e" />
                        <equipment slot="Leg" id="Item.eastern_leather_boots" />
                    </EquipmentRoster>
                    <EquipmentRoster>
                        <equipment slot="Item0" id="Item.peasant_pickaxe_1_t1" />
                        <equipment slot="Item1" id="Item.peasant_pitchfork_1_t1" />
                        <equipment slot="Head" id="Item.aserai_civil_c_head" />
                        <equipment slot="Body" id="Item.aserai_civil_c" />
                        <equipment slot="Leg" id="Item.eastern_leather_boots" />
                    </EquipmentRoster>
                    <EquipmentSet id="aserai_troop_civilian_template_t1" civilian="true" />
                </Equipments>
            </xsl:copy>
        </xsl:template>
     
        <xsl:template match='NPCCharacter[@id="aserai_tribesman"]' >
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <face>
                    <face_key_template value="BodyProperty.fighter_aserai" />
                </face>
                <skills>
                    <skill id="Athletics" value="37" />
                    <skill id="Riding" value="28" />
                    <skill id="OneHanded" value="70" />
                    <skill id="TwoHanded" value="20" />
                    <skill id="Polearm" value="40" />
                    <skill id="Bow" value="20" />
                    <skill id="Crossbow" value="20" />
                    <skill id="Throwing" value="20" />
                </skills>
                <upgrade_targets>
                    <upgrade_target id="NPCCharacter.aserai_skirmisher" />
                    <upgrade_target id="NPCCharacter.aserai_footman" />
                </upgrade_targets>
                <Equipments>
                    <EquipmentRoster>
                        <equipment slot="Item0" id="Item.eastern_spear_1_t2" />
                        <equipment slot="Item1" id="Item.desert_round_shield" />
                        <equipment slot="Item2" id="Item.aserai_sword_1_t2" />
                        <equipment slot="Head" id="Item.desert_helmet" />
                        <equipment slot="Body" id="Item.desert_padded_cloth" />
                        <equipment slot="Leg" id="Item.eastern_leather_boots" />
                        <equipment slot="Gloves" id="Item.buttoned_leather_bracers" />
                        <equipment slot="Cape" id="Item.stitched_leather_shoulders" />
                    </EquipmentRoster>
                    <EquipmentRoster>
                        <equipment slot="Item0" id="Item.eastern_spear_1_t2" />
                        <equipment slot="Item1" id="Item.desert_round_shield" />
                        <equipment slot="Item2" id="Item.aserai_mace_1_t2" />
                        <equipment slot="Head" id="Item.desert_helmet" />
                        <equipment slot="Body" id="Item.desert_padded_cloth" />
                        <equipment slot="Leg" id="Item.eastern_leather_boots" />
                        <equipment slot="Gloves" id="Item.rough_tied_bracers" />
                        <equipment slot="Cape" id="Item.stitched_leather_shoulders" />
                    </EquipmentRoster>
                    <EquipmentSet id="aserai_troop_civilian_template_t1" civilian="true" />
                </Equipments>
            </xsl:copy>
        </xsl:template>
    
    </xsl:stylesheet>
  10. mrj760

    How to replace (rather than add to) Equipment Rosters with XML ?

    What a beautiful little application. That tool along with some example code from this mod really pushed me into the final click of getting my mod working. Thank you order_without_power, I appreciate the help.
  11. mrj760

    How to replace (rather than add to) Equipment Rosters with XML ?

    I did try it. Attempting to start a new sandbox game results in unhandled exception:
    Code:
    TaleWorlds.MountAndBladeLauncher.exe (7144)
    Exception: "System.InvalidOperationException"
    Message: "Token StartElement in state and EndRootElement would result in an invalid XML document.
              Make sure that the ConformanceLevel setting is set to ConformanceLevel.Fragment or ConformanceLevel.Auto
              if you want to write an XML fragment."

    I've spent a lot of time looking for nesting errors both by eye and with regex in my 'skills.xslt' file and have found nothing. (For now trying to get only one .xslt working at a time)

    I would assume this has something to do with setting up an Identity Transform? Like the guy here answered which looks similar to the one in the Bannerlord docs. Whenever I try to use some variation of it in my .xslt though it results in:
    Could not load merged xml file correctly: HeroesError: Object reference not set to an instance of an object.

    I have tried using two Identity Transforms:

    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
        <!-- <xsl:output omit-xml-declaration="yes"/> -->
    
        <xsl:template match="@*|node()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
     
        <xsl:template match='NPCCharacter[@id="aserai_recruit"]/skills' >
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <skill id="Athletics" value="18" />
                <skill id="Riding" value="12" />
                <skill id="OneHanded" value="30" />
                <skill id="TwoHanded" value="10" />
                <skill id="Polearm" value="30" />
                <skill id="Bow" value="10" />
                <skill id="Crossbow" value="10" />
                <skill id="Throwing" value="10" />
            </xsl:copy>
        </xsl:template>
        ...
        ...Other troops...
        ...
    
    </xsl:stylesheet>

    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
        <!-- <xsl:output omit-xml-declaration="yes"/> -->
    
        <xsl:template match="/">
            <top>
                <xsl:apply-templates/>
            </top>
        </xsl:template>
    
        <xsl:template match='NPCCharacter[@id="aserai_recruit"]/skills' >
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <skill id="Athletics" value="18" />
                <skill id="Riding" value="12" />
                <skill id="OneHanded" value="30" />
                <skill id="TwoHanded" value="10" />
                <skill id="Polearm" value="30" />
                <skill id="Bow" value="10" />
                <skill id="Crossbow" value="10" />
                <skill id="Throwing" value="10" />
            </xsl:copy>
        </xsl:template>
        ...
        ...Other troops...
        ...
    
    </xsl:stylesheet>

    I have also tried combinations of that with uncommenting <xsl:output omit-xml-declaration="yes"/>.

    Could my approach to the Identity Transform be wrong? It seems like the most likely culprit, but truthfully I just don't know.
  12. mrj760

    How to replace (rather than add to) Equipment Rosters with XML ?

    Have looked through all the available resources and tried my best. Not sure what I'm missing. Hopefully you're willing to take a quick look below at my last attempt. Thanks again.


    submodule.xml
    XML:
    <Xmls>
            <XmlNode>
                <XmlName id="NPCCharacters" path="equipment" />
                <IncludedGameTypes>
                    <GameType value="Campaign" />
                    <GameType value="CampaignStoryMode" />
                </IncludedGameTypes>
            </XmlNode>
          
            <XmlNode>
                <XmlName id="NPCCharacters" path="skills" />
                <IncludedGameTypes>
                    <GameType value="Campaign" />
                    <GameType value="CampaignStoryMode" />
                </IncludedGameTypes>
            </XmlNode>
        </Xmls>


    skills.xml
    XML:
    <?xml version="1.0" encoding="utf-8"?>
    <NPCCharacters>
    </NPCCharacters>


    skills.xslt
    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <!-- <xsl:output omit-xml-declaration="yes"/> -->
        <xsl:template match='NPCCharacter[@id="aserai_recruit"]/skills' >
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <skill id="Athletics" value="18" />
                <skill id="Riding" value="12" />
                <skill id="OneHanded" value="30" />
                <skill id="TwoHanded" value="10" />
                <skill id="Polearm" value="30" />
                <skill id="Bow" value="10" />
                <skill id="Crossbow" value="10" />
                <skill id="Throwing" value="10" />
            </xsl:copy>
        </xsl:template>
    ...
    ...
        <xsl:template match='NPCCharacter[@id="steppe_bandits_boss"]/skills' >
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <skill id="Athletics" value="80" />
                <skill id="Riding" value="100" />
                <skill id="OneHanded" value="80" />
                <skill id="TwoHanded" value="40" />
                <skill id="Polearm" value="140" />
                <skill id="Bow" value="160" />
                <skill id="Crossbow" value="20" />
                <skill id="Throwing" value="60" />
            </xsl:copy>
        </xsl:template>
    </xsl:stylesheet>


    equipment.xml
    XML:
    <?xml version="1.0" encoding="utf-8"?>
    <NPCCharacters>
    </NPCCharacters>


    equipment.xslt

    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <!-- <xsl:output omit-xml-declaration="yes"/> -->
        <xsl:template match='NPCCharacter[@id="aserai_recruit"]/Equipments' >
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <EquipmentRoster>
                    <equipment slot="Item0" id="Item.military_fork_pike_t3" />
                    <equipment slot="Head" id="Item.aserai_civil_e_hscarf" />
                    <equipment slot="Body" id="Item.aserai_civil_e" />
                    <equipment slot="Leg" id="Item.eastern_leather_boots" />
                </EquipmentRoster>
                <EquipmentRoster>
                    <equipment slot="Item0" id="Item.peasant_pickaxe_1_t1" />
                    <equipment slot="Item1" id="Item.peasant_pitchfork_1_t1" />
                    <equipment slot="Head" id="Item.aserai_civil_c_head" />
                    <equipment slot="Body" id="Item.aserai_civil_c" />
                    <equipment slot="Leg" id="Item.eastern_leather_boots" />
                </EquipmentRoster>
                <EquipmentSet id="aserai_troop_civilian_template_t1" civilian="true" />
            </xsl:copy>
        </xsl:template>
    ...
    ...
        <xsl:template match='NPCCharacter[@id="steppe_bandits_boss"]/Equipments' >
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <EquipmentRoster civilian="true">
                    <equipment slot="Item0" id="Item.ridged_sabre_sword_t4" />
                    <equipment slot="Body" id="Item.bandit_envelope_dress_v1" />
                    <equipment slot="Leg" id="Item.wrapped_shoes" />
                </EquipmentRoster>
                <EquipmentRoster>
                    <equipment slot="Item0" id="Item.khuzait_polearm_1_t4" />
                    <equipment slot="Item1" id="Item.composite_steppe_bow" />
                    <equipment slot="Item2" id="Item.default_arrows" />
                    <equipment slot="Item3" id="Item.ridged_sabre_sword_t4" />
                    <equipment slot="Head" id="Item.plumed_nomad_helmet" />
                    <equipment slot="Body" id="Item.eastern_stitched_leather_coat" />
                    <equipment slot="Leg" id="Item.eastern_leather_boots" />
                    <equipment slot="Gloves" id="Item.guarded_padded_vambrace" />
                    <equipment slot="Horse" id="Item.t2_khuzait_horse" />
                    <equipment slot="HorseHarness" id="Item.light_harness" />
                </EquipmentRoster>
            </xsl:copy>
        </xsl:template>
    </xsl:stylesheet>
  13. mrj760

    How to replace (rather than add to) Equipment Rosters with XML ?

    As you may see below, I made the Equipment Roster for the Mameluke Axeman include some throwing daggers ... but in-game there are two other (default) Rosters that still remain and take up space in the Roster pool. How can I get my custom Roster to be the only one available to the troop? My...
  14. mrj760

    FULL-Version+SUBMOD 1257AD 1.13AP Repolished 1.4 New!

    Link to patch doesn't work
  15. mrj760

    -

    - Edit: Nevermind. My bad.
  16. mrj760

    nvm

    nvm
  17. mrj760

    The liquid noise in taverns...

    It sounds like someones dumping sludge in my ear every 2 seconds when I just wanna play some Tablut. I'm just suggesting to make it loop a lot less quickly so it at least plays every 15 seconds instead
Back
Top Bottom