搜索结果: *

  1. BL Coding Overriding Native XML files using Submodules

    Generally speaking if you're editing an element with the same id attribute as an existing element it will overwrite it. Now if that element has child elements it won't remove them.

    So for instance, I was trying to make an adjustment to change the equipsets of the looters that are already in bandits.xml in SandBox with my submodule.

    My element of <NPCCharacter id="looter" /> overrode the default element with the new name that I gave them.
    The new child elements that I created for the alternate equipsets also became available for looters

    However, the existing equipsets that were already defined were still there, and since these don't have ids, I can't specifically override them. I can just add more.

    This would require some kind of code patch to do more.


    The best way around this is to create a new unit that is an exact copy of the other (eg. battania_peasant to battania_peasant1) and work it into the troop tree while removing upgrade paths to the old unit.

    I do this in the personal mods I've made.
  2. BL Coding Culture Backgrounds

    Looks like the descriptions for the bonuses (what the game calls "Feats") are in TaleWorlds.CampaignSystem.DefaultFeats. There is also TaleWorlds.CampaignSystem.CharacterFeats, but I don't really understand what that particular one is doing. I can't see anything, so far, that is obviously setting those bonuses though.

    It does look like the DefaultFeats are being called in Taleworlds.CampaignSystem.Campaign as well though.
  3. BL Coding Has anyone worked out how to overwrite equipment data on troops?

    I've run into, and seen other people mention experiencing, an issue with XML overwriting where I will make a change to equipment and it will not take effect. For example, here is the default entry for the Vlandian Squire (edited for brevity) <NPCCharacter id="vlandian_squire"...
  4. BL Coding HELP - How do I correctly modify Native XMLs..?

    As regards the "Type" value, as far as I can tell, it is not necessary for most modifications. I leave it out in my SubModule.xml.

    As regards the ID, I believe this refers to the general type of edits that your XML is making. For example, if you are editing items, then the type is "Items". If you are editing cultures, then it is "SPCultures" for Single Player Cultures.

    As regards the path, yes it always looks in ModuleData as far as I can tell; however I have not played around with this yet. It is not necessary to do the full location.

    This is the SubModule.xml for my personal mod.

    插入代码块:
     <?xml version="1.0" encoding="utf-8"?>
     <Module>
         <Name value="Troop Tree Overhaul"/>
         <Id value="zyTroopTreeOverhaul"/>
         <Version value="v1.0.0"/>
         <SingleplayerModule value="true"/>
         <DependedModules>
             <DependedModule Id="Native"/>
             <DependedModule Id="Sandbox"/>
             <DependedModule Id="SandBoxCore"/>
             <DependedModule Id="StoryMode"/>
         </DependedModules>
         <SubModules/>
         <Xmls>                             
            <XmlNode>               
                <XmlName id="NPCCharacters" path="spnpccharacters_Empire"/>
                <IncludedGameTypes>
                    <GameType value = "Campaign"/>
                    <GameType value = "CampaignStoryMode"/>
                    <GameType value = "CustomGame"/>
                </IncludedGameTypes>
            </XmlNode>
            <XmlNode>               
                <XmlName id="NPCCharacters" path="spnpccharacters_Sturgia"/>
                <IncludedGameTypes>
                    <GameType value = "Campaign"/>
                    <GameType value = "CampaignStoryMode"/>
                    <GameType value = "CustomGame"/>
                </IncludedGameTypes>
            </XmlNode>   
            <XmlNode>               
                <XmlName id="NPCCharacters" path="spnpccharacters_Aserai"/>
                <IncludedGameTypes>
                    <GameType value = "Campaign"/>
                    <GameType value = "CampaignStoryMode"/>
                    <GameType value = "CustomGame"/>
                </IncludedGameTypes>
            </XmlNode>
            <XmlNode>               
                <XmlName id="NPCCharacters" path="spnpccharacters_Battania"/>
                <IncludedGameTypes>
                    <GameType value = "Campaign"/>
                    <GameType value = "CampaignStoryMode"/>
                    <GameType value = "CustomGame"/>
                </IncludedGameTypes>
            </XmlNode>
            <XmlNode>               
                <XmlName id="NPCCharacters" path="spnpccharacters_Vlandia"/>
                <IncludedGameTypes>
                    <GameType value = "Campaign"/>
                    <GameType value = "CampaignStoryMode"/>
                    <GameType value = "CustomGame"/>
                </IncludedGameTypes>
            </XmlNode>
        </Xmls>
     </Module>
  5. BL Coding Where are armor factors in M&B2 Bannerlord?

    I think those are now handled in C++. In the spitems.xml there only lists a [body part]_armor value. I imagine there is a calculation somewhere in the dlls that controls how that value is used.
  6. BL Coding Modify Default Starting Inventory

    Check the npccharacters.xml in SandboxCore. About a quarter of the way down there is a commented heading as follows

    <!--STARTING EQUIPMENT SETS BEGIN (Only change the equipment sets, other fields except the id are ignored.-->

    This section, I believe, includes all of the "starting equipment sets". There are different ones depending on your background though.
  7. BL Coding How do i add new units to the unit tree?

    First check all of your syntax. No missing quotes and all that.

    If that fails, make sure that you have the correct XML header at the top (something about xml version="1.0").

    Failing that, make sure you aren't inserting troops into the middle of minor faction trees. For some reason that I am still diagnosing, inserting troops into the middle of those trees (eg. Wolfskins tree or Jawwal tree) breaks everything.

    Finally, make sure the troop you are adding is a higher level than the troop below it and vice versa. This shouldn't crash your game, but it will break the upgrade process in game.
  8. BL Coding Has anyone worked out how to edit which troops are recruitable?

    I'm messing around with the empire troop trees, and I would like to add an additional unit to the recruit pool at the same weight as the basic Imperial Recruit or whatever it is called. Is there a way to do this?
后退
顶部 底部