[how to] add a weapon to a tech

Wondering how to add the practice sword into the tech tree.  I don't have my game open right now, but the tech I think the tech is called weaponsmith.  It's the one that gives most of the basic weapons, including the dagger.  Just seems strange that there are no swords at that level.  I know I can use the dagger, but seems weird to have mounted people with daggers.  I'm using Stormworld if that makes a matter.  Anyone knows I can add this in for my next game (got a great one going right now!)

3,093 views 2 replies
Reply #1 Top

The tech is decided in the <Prereq> node, for example from CoreWeapons.xml:

   <GameItemType InternalName="Mace">
        <DisplayName>Mace</DisplayName>
        <Description>Not designed for the subtle, the mace is deadly even in a peasant's hands.</Description>
        <Type>Weapon</Type>
        <WeaponType>Blunt</WeaponType>
        <CanBeEquipped>1</CanBeEquipped>
        <AdditionalTrainingTurns>16</AdditionalTrainingTurns>
        <ShopValue>45</ShopValue>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_Attack_Blunt</StrVal>
            <Value>15</Value>
        </GameModifier>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_CombatSpeed</StrVal>
            <Value>-3</Value>
        </GameModifier>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_CurrentWeight</StrVal>
            <Value>15</Value>
        </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_BashChance</StrVal>
                <Value>100</Value>
                <Provides>Bash- Has a chance equal to the damage done of knocking the victim prone</Provides>
            </GameModifier>
        <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
        <Likelihood>200</Likelihood>
        <RarityDisplay>Uncommon</RarityDisplay>
        <Prereq>
            <Type>Tech</Type>
            <Attribute>Weaponsmithing</Attribute>
        </Prereq>
        <AIData AIPersonality="AI_General">
            <AIPrefType>AIPrefType_BLUNT</AIPrefType>
            <AIPriority>240</AIPriority>
        </AIData>
        <ArtDef>Mace_ArtDef</ArtDef>
        <GameItemTypeArtDef InternalName="Mace_ArtDef">
            <GameItemTypeModelPack InternalName="Mace_Default">
                <IconFile>W_Mace_Icon_01.png</IconFile>
                <TintR>0</TintR>
                <TintG>0</TintG>
                <TintB>0</TintB>
                <AttackSFX>Hit_Hammer1</AttackSFX>
                <AttackSFX>Hit_Hammer2</AttackSFX>
                <AttackSFX>Hit_Hammer3</AttackSFX>
                <EquipSFX>Equip_WoodenItem_01</EquipSFX>
                <EquipSFX>Equip_WoodenItem_02</EquipSFX>
                <EquipSFX>Equip_WoodenItem_03</EquipSFX>
                <GameItemTypeModel>
                    <ModelFile>gfx/hkb/weapons/W_Mace_01.hkb</ModelFile>
                    <Texture_All>gfx/hkb/Weapons/FE_Weapons_01.png</Texture_All>
                    <Attachment>hand_right_Lcf</Attachment>
                </GameItemTypeModel>
            </GameItemTypeModelPack>
        </GameItemTypeArtDef>
    </GameItemType>

You can create a new sword to your fancy (remember to give it a unique internalname) or alter an existing one.

For example

    <GameItemType InternalName="Shortsword_Practice_NEWWEAPON">
      <Prereq>
            <Type>Tech</Type>
            <Attribute>Weaponsmithing</Attribute>
        </Prereq>
        <DisplayName>Practice Sword</DisplayName>
        <Description>As slow and dull as those who use it - though over time at least the latter improves.</Description>
        <Type>Weapon</Type>
        <WeaponType>OneHanded</WeaponType>
        <CanBeEquipped>1</CanBeEquipped>
        <ShopValue>90</ShopValue>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_Attack_Cutting</StrVal>
            <Value>9</Value>
        </GameModifier>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_CurrentWeight</StrVal>
            <Value>5</Value>
        </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_MaxCounterAttack</StrVal>
                <Value>1</Value>
                <Provides>+1 Counterattack per round</Provides>
            </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_ExpBonus</StrVal>
                <Value>10</Value>
                <Provides>+10% Experience</Provides>
            </GameModifier>
        <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
        <Likelihood>0</Likelihood>
        <RarityDisplay>Common</RarityDisplay>
        <HeroOnly>0</HeroOnly>
        <IsAvailableForUnitDesign>1</IsAvailableForUnitDesign>
        <AIData AIPersonality="AI_General">
            <AIPrefType>AIPrefType_CUTTING</AIPrefType>
            <AIPriority>260</AIPriority>
        </AIData>
        <ArtDef>Shortsword_Practice_ArtDef</ArtDef>
    </GameItemType>

 

I also changed its liklihood so you don't start getting a lot of practice swords in random drops. Also changed <HeroOnly> to 0 and <IsAvailableForUnitDesign> to 1 so you can use it in unit designs.

Reply #2 Top


Cool!  I like the idea of a more unique item to add instead of the practice sword!  I'm bookmarking this page so I can have it when I start a new game up.