View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 24th, 2010, 08:55 AM
The linkage[] transition only works if you have established a linkage in the component (traits.str). Also, when using it, you use the name you established for the linkage, rather than the Id of the pick you want to target.

Also, your script has "field[trt.Final].value" - the compiler will not know what to do with the "." inside of trtFinal.

Adding the trtFinal of trDefense and skDamCap to the current thing can be done with:

Code:
 
field[trtBonus].value += hero.childfound[trDamage].field[trtFinal].value + hero.childfound[skDamCap].field[trtFinal].value
You can use macros to reduce the amount you have to type for that last statement:

Code:
 
field[trtBonus].value += #trait[trDamage] + #trait[skDamCap]
To get the starting value of 9, add the following earlier in the trait definition:

Code:
 
<fieldval field="trtBonus" value="9"/>
Here's the whole health trait, incorporating my suggestions:

Code:
 
  <thing
    id="trHealth"
    name="Health"
    compset="Trait"
    isunique="yes"
    description="Description goes here">
    <fieldval field="trtAbbrev" value="Hlth"/>
    <fieldval field="trtBonus" value="9"/>
    <tag group="explicit" tag="1"/>
    <tag group="User" tag="Power"/>
    <!-- Calculate the Health trait as appropriate -->
    <eval value="1" phase="Traits" priority="4000">
      <before name="Derived trtFinal"/>
      <after name="Calc trtFinal"/><![CDATA[
      field[trtBonus].value += #trait[trDamage] + #trait[skDamCap]
      ]]></eval>
    </thing>
Mathias is online now   #2 Reply With Quote