Adding Abilities to Units

Has anyone figured out a way to add modder defined abilities to units or race/faction in a <GameModifier> tag via spells or items? 

 

3,855 views 4 replies
Reply #1 Top

Give an example of what you are trying to do.

Edit: Check out throwing knives for an example of an item that unlocks an ability.

Reply #2 Top

Actually, Heaven, I took a look at your Unitstat Lib and saw how you did it there.  That suffices for my needs.

 

What if I wanted to grant a Core ability?  Such as creating a spell that permanently adds "<AbilityBonus InternalName="AcrobatAbility">?

Or an item that adds such an ability when equipped?

Or while I'm thinking about it... is there a way to have a spell and/or goodie hut grant a specific technology?

Reply #3 Top

Sorry, I had a brain fart.  I momentarily forgot about your Unistat BG mod.

Reply #4 Top

Yes, stuff can unlock traits for particular units.

       <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>UnlockUnitAbility</Attribute>
            <StrVal>Fire1</StrVal>
            <Provides>Grants the Fire Apprentice ability</Provides>
        </GameModifier>

 

To make an equippable item give a unit a trait is a little more complex but it is doable. First consider if you can't just place your desired trait modifiers inside the item instead. Also keep in mind that traits, once given, cannot be removed, unless they have a <Duration> which is X turns (strategic/tactical).

To make an equippable item grant you a trait, I would make the item give the unit a battleautocastspell trigger

           <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>BattleAutoCastSpell</Attribute>
                <StrVal>Fear_Ability</StrVal>
                <Value>100</Value>
            </GameModifier>

that spell would then unlock the trait for the unit for the battle. Let me just reiterate that  I don't see any reason to do this, because anything you can put in a trait you can put in an item.