• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Hit Points from Skills

RayPrancer

Well-known member
Okay, I've found the main hitpoint script in thing_traits.dat (the block beginning id=trHealth). Fudge by default has it as 9+Damage Capacity Attribute. As I think I mentioned before, I've downgraded Damage Capacity to a skill.

What I need the health trait to actaully calculate is 9+Damage Capacity+Armour Class (the setting uses British English spellings) - so is this a safe script to change the current calculate script to (assuming trDefense and skDamCap are valid ids)?

<script>
<!-- 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 = field[trt.Final].value+linkage[trDefense]+linkage[skDamCap]
]]></eval>
</thing>
</script>
 
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>
 
Back
Top