trying to mod in crude shortbow into the archer player ability

Here's the xml i'm working with, i can't think what's not making it work. It should be available for making a unit just like the club, but i don't see it appear. I have it in a xml file in the mods folder under the name CrudeShortBow.xml :

 

EDIT: should i change the entry in coreweapons instead in the main folder, or replace coreweapons in the mod folder ?

 

<GameItemType InternalName="Shortbow_Crude">

         <DisplayName>Crude Shortbow</DisplayName>

         <Description>A crude bow made of driftwood and twine.</Description>

         <Type>Weapon</Type>

         <Type>Defense</Type>

         <WeaponType>Bow</WeaponType>

        <CanBeEquipped>1</CanBeEquipped>

         <AdditionalTrainingTurns>15</AdditionalTrainingTurns>

         <ShopValue>25</ShopValue>

         <GameModifier>

             <ModType>Unit</ModType>

            <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_Accuracy</StrVal>

             <Value>-5</Value>

         </GameModifier>

         <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_Attack_Pierce</StrVal>

             <Value>6</Value>

         </GameModifier>

         <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_CombatSpeed</StrVal>

             <Value>-8</Value>

         </GameModifier>

         <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_CurrentWeight</StrVal>

             <Value>10</Value>

         </GameModifier>

             <GameModifier>

                 <ModType>Unit</ModType>

                 <Attribute>UnlockRangedAction</Attribute>

                 <StrVal>BowAttack_Basic</StrVal>

                 <Provides>Ranged attack</Provides>

             </GameModifier>

         <RarityDisplay>Common</RarityDisplay>

         <TacticalRange>6</TacticalRange>

         <IsUsable>0</IsUsable>

            <Prereq>

                    <Type>AbilityBonusOption</Type>

                    <Attribute>Archers</Attribute>

                    <Target>Player</Target>

             </Prereq>

         <AIData AIPersonality="AI_General">

             <AIPrefType>AIPrefType_BOW</AIPrefType>

             <AIPriority>55</AIPriority>

         </AIData>

         <ArtDef>Shortbow_Crude_ArtDef</ArtDef>

         <GameItemTypeArtDef InternalName="Shortbow_Crude_ArtDef">

             <GameItemTypeModelPack InternalName="Shortbow_Crude_Default">

                 <IconFile>W_Shortbow_Crude_Icon_01.png</IconFile>

                 <TintR>0</TintR>

                 <TintG>0</TintG>

                 <TintB>0</TintB>

                 <AttackSFX>Hit_Arrow1</AttackSFX>

                 <AttackSFX>Hit_Arrow2</AttackSFX>

                 <EquipSFX>Equip_BowandArrow_01</EquipSFX>

                 <EquipSFX>Equip_BowandArrow_02</EquipSFX>

                 <EquipSFX>Equip_BowandArrow_03</EquipSFX>

                 <SoundPack>SoundPack_Bow</SoundPack>

                 <SupportedUnitModelType>AmarianFemale</SupportedUnitModelType>

                <SupportedUnitModelType>AmarianMale</SupportedUnitModelType>

                 <SupportedUnitModelType>EmpireFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>EmpireMale</SupportedUnitModelType>

                 <SupportedUnitModelType>FallenFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>FallenMale</SupportedUnitModelType>

                 <SupportedUnitModelType>HenchmanMale</SupportedUnitModelType>

                 <SupportedUnitModelType>IroneerFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>IroneerMale</SupportedUnitModelType>

                 <SupportedUnitModelType>KingdomFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>KingdomMale</SupportedUnitModelType>

                 <SupportedUnitModelType>MancerFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>MancerMale</SupportedUnitModelType>

                 <SupportedUnitModelType>QuendarFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>QuendarMale</SupportedUnitModelType>

                 <SupportedUnitModelType>SlaveMale</SupportedUnitModelType>

                 <SupportedUnitModelType>TarthanFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>TarthanMale</SupportedUnitModelType>

                 <SupportedUnitModelType>UrxenFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>UrxenMale</SupportedUnitModelType>

                 <SupportedUnitModelType>WraithFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>WraithMale</SupportedUnitModelType>

                 <GameItemTypeModel>

                     <ModelFile>Gfx\HKB\Weapons\W_Shortbow_Crude_01.hkb</ModelFile>

                     <Texture_All>Gfx\HKB\Armor\FE_Weapons_02.png</Texture_All>

                     <Attachment>hand_Left_Lcf</Attachment>

                 </GameItemTypeModel>

                 <GameItemTypeModel>

                     <ModelFile>Gfx\HKB\Armor\K_ArcherQuiver_01.hkb</ModelFile>

                     <Texture_All>Gfx\HKB\Armor\K_Female_Armor_Archer_Texture_01.dds</Texture_All>

                     <Attachment>back_Lcf</Attachment>

                 </GameItemTypeModel>

             </GameItemTypeModelPack>

         </GameItemTypeArtDef>

     </GameItemType>

4,458 views 9 replies
Reply #1 Top

This may not fix it, but try taking the whole GameItemTypeArtDef section out (it's already defined elsewhere, you only need to point to the reference -- the ArtDef node.).

 

Reply #2 Top


I've had some partial success, i changed all the crude shortbow references to basic shortbow, but now i have no graphics - i have archers with invisble bows :P

I'm going to go out on a limb and say that the art references got changed too lol

 

Reply #3 Top


Ok i got them both in, the names were conflicting - i only use the original names to reference the graphics.

Reply #4 Top

<GameItemType InternalName="Shortbow_Flaming">

         <DisplayName>Flaming Shortbow</DisplayName>

         <Description>These are known for having a powerful enchantment on inferior material, and have been known to burst into flames in the middle of battle.</Description>

         <Type>Weapon</Type>

         <Type>Defense</Type>

         <WeaponType>Bow</WeaponType>

         <AdditionalTrainingTurns>30</AdditionalTrainingTurns>

         <CanBeEquipped>1</CanBeEquipped>

         <ShopValue>90</ShopValue>

  <ProductionRequirement>

      <Type>Resource</Type>

      <Attribute>RefinedCrystal</Attribute>

                    <Value>1</Value>

   </ProductionRequirement>

         <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_Attack_Pierce</StrVal>

             <Value>7</Value>

         </GameModifier>

         <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_Attack_Fire</StrVal>

             <Value>2</Value>

         </GameModifier>

         <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_CombatSpeed</StrVal>

             <Value>-8</Value>

         </GameModifier>

         <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_CurrentWeight</StrVal>

             <Value>10</Value>

         </GameModifier>

             <GameModifier>

                 <ModType>Unit</ModType>

                 <Attribute>UnlockRangedAction</Attribute>

                 <StrVal>BowAttack_Flaming</StrVal>

                 <Provides>Ranged attack</Provides>

             </GameModifier>

         <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>

         <Likelihood>400</Likelihood>

         <RarityDisplay>Uncommon</RarityDisplay>

         <TacticalRange>6</TacticalRange>

         <IsUsable>0</IsUsable>

       <Prereq>

                      <Type>AbilityBonusOption</Type>

                      <Attribute>Archers</Attribute>

                      <Target>Player</Target>

         </Prereq>

         <Prereq>

               <Type>Tech</Type>

               <Attribute>Enchantment</Attribute>

         </Prereq>

         <AIData AIPersonality="AI_General">

             <AIPrefType>AIPrefType_BOW</AIPrefType>

             <AIPriority>84</AIPriority>

         </AIData>

         <ArtDef>Shortbow_Ignys_ArtDef</ArtDef>

         <GameItemTypeArtDef InternalName="Shortbow_Flaming_ArtDef">

             <GameItemTypeModelPack InternalName="Shortbow_Flaming_Default">

                 <IconFile>W_Shortbow_Ignys_Icon_01.png</IconFile>

                 <TintR>0</TintR>

                 <TintG>0</TintG>

                <TintB>0</TintB>

                <AttackSFX>Hit_Arrow1</AttackSFX>

                 <AttackSFX>Hit_Arrow2</AttackSFX>

                <EquipSFX>Equip_BowandArrow_01</EquipSFX>

                 <EquipSFX>Equip_BowandArrow_02</EquipSFX>

                 <EquipSFX>Equip_BowandArrow_03</EquipSFX>

                 <SoundPack>SoundPack_Bow</SoundPack>

                 <SupportedUnitModelType>AmarianFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>AmarianMale</SupportedUnitModelType>

                 <SupportedUnitModelType>EmpireFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>EmpireMale</SupportedUnitModelType>

                 <SupportedUnitModelType>FallenFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>FallenMale</SupportedUnitModelType>

                 <SupportedUnitModelType>HenchmanMale</SupportedUnitModelType>

                 <SupportedUnitModelType>IroneerFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>IroneerMale</SupportedUnitModelType>

                 <SupportedUnitModelType>KingdomFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>KingdomMale</SupportedUnitModelType>

                 <SupportedUnitModelType>MancerFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>MancerMale</SupportedUnitModelType>

                 <SupportedUnitModelType>QuendarFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>QuendarMale</SupportedUnitModelType>

                 <SupportedUnitModelType>SlaveMale</SupportedUnitModelType>

                 <SupportedUnitModelType>TarthanFemale</SupportedUnitModelType>

                <SupportedUnitModelType>TarthanMale</SupportedUnitModelType>

                 <SupportedUnitModelType>UrxenFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>UrxenMale</SupportedUnitModelType>

                 <SupportedUnitModelType>WraithFemale</SupportedUnitModelType>

                 <SupportedUnitModelType>WraithMale</SupportedUnitModelType>

                 <GameItemTypeModel>

                     <ModelFile>Gfx\HKB\Weapons\W_Shortbow_01.hkb</ModelFile>

                     <Texture_All>Gfx\HKB\Armor\FE_Weapons_02.png</Texture_All>

                     <Attachment>hand_Left_Lcf</Attachment>

                 </GameItemTypeModel>

                 <GameItemTypeModel>

                     <ModelFile>Gfx\HKB\Armor\K_ArcherQuiver_01.hkb</ModelFile>

                     <Texture_All>Gfx\HKB\Armor\K_Female_Armor_Archer_Texture_01.dds</Texture_All>

                     <Attachment>back_Lcf</Attachment>

                 </GameItemTypeModel>

            </GameItemTypeModelPack>

        </GameItemTypeArtDef>

     </GameItemType>

Reply #5 Top


step 2: getting it to show up in the store

 

Reply #6 Top


Heavenfalls escape scroll trick isnt working for me, so i need to look a little deeper. I will deal with that tomorrow.

Does anyone know if the venom bows are working properly ?

 

Reply #7 Top

The XML in the OP looks right to me, and it shows up in-game for me when I put it in (for anyone with Archers). Obviously you don't need to repeat the gameartdef stuff. Think of it like an external type altogether, they just bundled it in coreweapons.xml for some reason. As long as it exists anywhere in the installation directory, you don't need to re-define it.

<?xml version="1.0"?>
<GameItemType InternalName="Shortbow_Crude">
  <DisplayName>Crude Shortbow</DisplayName>
  <Description>A crude bow made of driftwood and twine.</Description>
  <Type>Weapon</Type>
  <Type>Defense</Type>
  <WeaponType>Bow</WeaponType>
  <CanBeEquipped>1</CanBeEquipped>
  <AdditionalTrainingTurns>15</AdditionalTrainingTurns>
  <ShopValue>25</ShopValue>
  <GameModifier>
    <ModType>Unit</ModType>
    <Attribute>AdjustUnitStat</Attribute>
    <StrVal>UnitStat_Accuracy</StrVal>
    <Value>-5</Value>
  </GameModifier>
  <GameModifier>
    <ModType>Unit</ModType>
    <Attribute>AdjustUnitStat</Attribute>
    <StrVal>UnitStat_Attack_Pierce</StrVal>
    <Value>6</Value>
  </GameModifier>
  <GameModifier>
    <ModType>Unit</ModType>
    <Attribute>AdjustUnitStat</Attribute>
    <StrVal>UnitStat_CombatSpeed</StrVal>
    <Value>-8</Value>
  </GameModifier>
  <GameModifier>
    <ModType>Unit</ModType>
    <Attribute>AdjustUnitStat</Attribute>
    <StrVal>UnitStat_CurrentWeight</StrVal>
    <Value>10</Value>
  </GameModifier>
  <GameModifier>
    <ModType>Unit</ModType>
    <Attribute>UnlockRangedAction</Attribute>
    <StrVal>BowAttack_Basic</StrVal>
    <Provides>Ranged attack</Provides>
  </GameModifier>
  <RarityDisplay>Common</RarityDisplay>
  <TacticalRange>6</TacticalRange>
  <IsUsable>0</IsUsable>
  <Prereq>
    <Type>AbilityBonusOption</Type>
    <Attribute>Archers</Attribute>
    <Target>Player</Target>
  </Prereq>
  <AIData AIPersonality="AI_General">
    <AIPrefType>AIPrefType_BOW</AIPrefType>
    <AIPriority>55</AIPriority>
  </AIData>
  <ArtDef>Shortbow_Crude_ArtDef</ArtDef>
</GameItemType>

Reply #8 Top

An item will only show up in the city shop if it has been

1) researched

or

2) unlocked using the <UnlocksShopItem> from an improvement.

I would recommend you add a prereq to unlock the bow from Training or something like that, it is by far the easiest solution. Otherwise, if you desperately want it in the shop from turn 1, I would recommend you create a techdef that isn't in the tech tree, and then automatically unlock it from the Archers playerability. All this can be done from /mods/.

Reply #9 Top


after i changed the names in for the second version i assumed there was a problem overriding the main files but you say it worked for you... odd. What did you name the xml file ?