[eInfo] Easy Trick for Checking Pulled Stats

If your not sure you're pulling a stat correctly...

I'm relatively new to modding this game, and I wasn't sure if I was pulling a stat the other day, so I used the formatted description of the spell to check it.  Example:

<SpellDef InternalName="GinsuKnife">
        <DisplayName>Throwing Knives</DisplayName>
        <Description>Throw knives at a nearby enemy.</Description>
        <FormattedDescription>The pulled stat value is %d</FormattedDescription>
        ...
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>DefendableDamage</Attribute>
        <IsForFormattedDescription>1</IsForFormattedDescription>
            <Calculate InternalName="Calc" ValueOwner="CastingUnit">
                <Expression><![CDATA[[Unit_GetLevel]]]></Expression>
            </Calculate>
            ...
            <Calculate InternalName="ValueForFormattedDescription"  ValueOwner="CastingUnit">
                <Expression><![CDATA[[Calc]]]></Expression>
            </Calculate>
        </GameModifier>
        ...
    </SpellDef>

In the code above, I'm attempting to pull the unit's level.  I apply the attempted pull to "Calc" then designate [Calc] as the value for the formatted description.

In game, I can check to see if I'm pulling the stat properly by mousing over my special ability (see screenshot below).

 

 

OK, I edited this like 10 times to get the colors right, and it still sucks... I hate HTML editors :annoyed:

 

6,089 views 4 replies
Reply #1 Top


You can also use:  

<DisplayName> insert words here </DisplayName>

 

to give the floating text as you cast a spell for feedback

 

this is used for the spider webs, chaos spell, destiny's gift etc.

 

Reply #2 Top

Quoting Glowing_Ember, reply 1

You can also use:  

<DisplayName> insert words here </DisplayName>
...

 
End of Glowing_Ember's quote

I couldn't get it to work! >:(   Now that you've verified, I'll try again.

Reply #3 Top

Here are three examples for you.

 

 <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>AdjustUnitStat</Attribute>

             <StrVal>UnitStat_HitPoints</StrVal>

             <DisplayName>+10 Hit Points</DisplayName>

             <Value>10</Value>

         </GameModifier>

 

 

     <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>SetUnitStat</Attribute>

             <StrVal>UnitStat_Moves</StrVal>

             <DisplayName>Imprisoned</DisplayName>

             <Duration>5</Duration>

             <Effect>E_Imprison_Particle</Effect>

             <PerTurn>1</PerTurn>

             <Value>0</Value>

       </GameModifier>

 

 <GameModifier>

             <ModType>Unit</ModType>

             <Attribute>SetUnitStat</Attribute>

             <StrVal>UnitStat_Moves</StrVal>

             <DisplayName>Webbed</DisplayName>

             <Duration>3</Duration>

             <Effect>E_TangledWeb_Particle</Effect>

             <PerTurn>1</PerTurn>

             <Value>0</Value>

 </GameModifier>

Reply #4 Top

Excellent.  Thanks much! :grin: