BL Coding Looking for info creating custom troops and troop tier.

正在查看此主题的用户

Nicx274

Recruit
I'm new to modding MB and have been searching for anything to help push me in the right direction for creating a custom troop and troop tier mod. I haven't been able to find anything related to modding troops except for a tutorial video that was for the beta. I have tried "reverse engineering" another troop mod with no success. Any tips would be awesome!
 
解决方案
I'm far from an expert myself but I've made some female troops for certain factions, I made a new xml for my troops called spnpccharacters_female, then defined the troops in it by copying and edting troops from the sandbox xmls, example

<NPCCharacters>
<NPCCharacter id="sturgian_recruit_female" default_group="Infantry" level="4" civilianTemplate="NPCCharacter.sturgia_troop_civilian_template_t1" name="{=BBJKgKj2}Sturgian Fighter Woman" occupation="Soldier" is_basic_troop="true" culture="Culture.sturgia" is_female="true">
<face>
<face_key_template value="NPCCharacter.villager_sturgia" />
</face>
<skills>
<skill id="Athletics" value="20" />
<skill id="Riding" value="5" />
<skill id="OneHanded"...
I'm far from an expert myself but I've made some female troops for certain factions, I made a new xml for my troops called spnpccharacters_female, then defined the troops in it by copying and edting troops from the sandbox xmls, example

<NPCCharacters>
<NPCCharacter id="sturgian_recruit_female" default_group="Infantry" level="4" civilianTemplate="NPCCharacter.sturgia_troop_civilian_template_t1" name="{=BBJKgKj2}Sturgian Fighter Woman" occupation="Soldier" is_basic_troop="true" culture="Culture.sturgia" is_female="true">
<face>
<face_key_template value="NPCCharacter.villager_sturgia" />
</face>
<skills>
<skill id="Athletics" value="20" />
<skill id="Riding" value="5" />
<skill id="OneHanded" value="20" />
<skill id="TwoHanded" value="10" />
<skill id="Polearm" value="20" />
<skill id="Bow" value="5" />
<skill id="Crossbow" value="0" />
<skill id="Throwing" value="10" />
</skills>
<equipmentSet>
<equipment slot="Item0" id="Item.sturgia_axe_2_t2" />
<equipment slot="Body" id="Item.nordic_padded_cloth" />
<equipment slot="Leg" id="Item.highland_leg_wrappings" />
<equipment slot="Head" id="northern_fur_cap" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0" id="Item.sturgia_axe_2_t2" />
<equipment slot="Body" id="Item.nordic_padded_cloth" />
<equipment slot="Leg" id="Item.highland_leg_wrappings" />
<equipment slot="Gloves" id="Item.ragged_armwraps" />
<equipment slot="Head" id="nordic_fur_cap" />
<equipment slot="Cape" id="Item.scarf" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0" id="Item.sturgia_axe_2_t2" />
<equipment slot="Body" id="Item.northern_leather_vest" />
<equipment slot="Leg" id="Item.highland_leg_wrappings" />
<equipment slot="Head" id="nordic_fur_cap" />
</equipmentSet>
<upgrade_targets></upgrade_targets>
</NPCCharacter>

add your next tier troop in the upgrade targets.

I've made a module folder with submodule.xml as per other tutorials then included my xml in it by adding this

<Xmls>
<XmlNode>
<XmlName id="NPCCharacters" path="spnpccharacters_female" />
<IncludedGameTypes>
<GameType value="Campaign" />
<GameType value="CampaignStoryMode" />
<GameType value="CustomGame" />
</IncludedGameTypes>
</XmlNode>

I added them to my game in NPC parties with party templates, with mixed success (I have my own question thread) Not sure the best way how to make them recruitable other than replacing a kingdoms default troop with them in Spcultures.xml, I havent messed with that I just wanted them showing up occasionally in NPC armies.
 
点赞 0
解决方案
I'm far from an expert myself but I've made some female troops for certain factions, I made a new xml for my troops called spnpccharacters_female, then defined the troops in it by copying and edting troops from the sandbox xmls, example

<NPCCharacters>
<NPCCharacter id="sturgian_recruit_female" default_group="Infantry" level="4" civilianTemplate="NPCCharacter.sturgia_troop_civilian_template_t1" name="{=BBJKgKj2}Sturgian Fighter Woman" occupation="Soldier" is_basic_troop="true" culture="Culture.sturgia" is_female="true">
<face>
<face_key_template value="NPCCharacter.villager_sturgia" />
</face>
<skills>
<skill id="Athletics" value="20" />
<skill id="Riding" value="5" />
<skill id="OneHanded" value="20" />
<skill id="TwoHanded" value="10" />
<skill id="Polearm" value="20" />
<skill id="Bow" value="5" />
<skill id="Crossbow" value="0" />
<skill id="Throwing" value="10" />
</skills>
<equipmentSet>
<equipment slot="Item0" id="Item.sturgia_axe_2_t2" />
<equipment slot="Body" id="Item.nordic_padded_cloth" />
<equipment slot="Leg" id="Item.highland_leg_wrappings" />
<equipment slot="Head" id="northern_fur_cap" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0" id="Item.sturgia_axe_2_t2" />
<equipment slot="Body" id="Item.nordic_padded_cloth" />
<equipment slot="Leg" id="Item.highland_leg_wrappings" />
<equipment slot="Gloves" id="Item.ragged_armwraps" />
<equipment slot="Head" id="nordic_fur_cap" />
<equipment slot="Cape" id="Item.scarf" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0" id="Item.sturgia_axe_2_t2" />
<equipment slot="Body" id="Item.northern_leather_vest" />
<equipment slot="Leg" id="Item.highland_leg_wrappings" />
<equipment slot="Head" id="nordic_fur_cap" />
</equipmentSet>
<upgrade_targets></upgrade_targets>
</NPCCharacter>

add your next tier troop in the upgrade targets.

I've made a module folder with submodule.xml as per other tutorials then included my xml in it by adding this

<Xmls>
<XmlNode>
<XmlName id="NPCCharacters" path="spnpccharacters_female" />
<IncludedGameTypes>
<GameType value="Campaign" />
<GameType value="CampaignStoryMode" />
<GameType value="CustomGame" />
</IncludedGameTypes>
</XmlNode>

I added them to my game in NPC parties with party templates, with mixed success (I have my own question thread) Not sure the best way how to make them recruitable other than replacing a kingdoms default troop with them in Spcultures.xml, I havent messed with that I just wanted them showing up occasionally in NPC armies.
Ok this definitely helps. Does the mod overwrite the native xmls? If so couldnt you copy the entire native troop xml, add your custom troops, and then add your troops as an extra upgrade target for one of the native troops? Im gonna give it a try
 
点赞 0
My troops mod is a separate xml with separate ids for the troops so it's in addition to the native troops, I think your idea would work as long as the game loads the right file.

My party templates doesn't overwrite the native one, a lot of people seem to be having that problem with various xmls, I edited the native one in the end. Dont think mine actually does anything.
 
点赞 0
If you add a module that edits the spnpccharacters.xml and activate it. It will add the stuff you edited but not overwrite it.
For example, if you create new equipment for certain Native units, instead of overwriting it you will add it to the spawnpool. Making them use half from native and half from you.

I'm also looking for a solution. Editing the original .xml is not ideal. Since it breaks with every update.
 
点赞 0
Sorry Im new to this and want to modify Imperial troop tree, where is this sandbox.xml?
And I would have to update it with each patch right?


This guide is pretty basic and can get you started. It doesnt tell you how to make a mod, but shows you how to edit anything about the troops. And yes, you would have to go and check that the changes you make weren't reverted with every patch
 
点赞 0

This guide is pretty basic and can get you started. It doesnt tell you how to make a mod, but shows you how to edit anything about the troops. And yes, you would have to go and check that the changes you make weren't reverted with every patch

Well thank you all, I got time and inspiration and manage to do something, see if you like and tell what you think,

 
点赞 0
后退
顶部 底部