Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Ozob
Junior Member
 
Join Date: Jul 2015
Posts: 8

Old July 20th, 2015, 11:03 AM
I am now looking at the derived traits and how to adapt them, but am confused by the sample data set.

The health trait (HP) shows in the top (form_static.dat) using the following code:
@text = "HP: " & herofield[acHPSumm].text

However, that does not change the derived trait of Health, which shows 0. The code for the health trait is mostly unchanged:
<!-- Health Trait -->
<thing
id="trHealth"
name="Integrity"
compset="Trait"
isunique="yes"
description="Description goes here">
<fieldval field="trtAbbrev" value="Int"/>
<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 = 0
]]></eval>
</thing>


If I try to change that to display the acHPSumm, it gives me an error. So what exactly is this trait supposed to do? I'd like it to display the characters "HP" but that's not what it seems to do in the sample set.
Ozob is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old July 20th, 2015, 11:17 AM
What error message does it give? You can right-click error messages in HL and copy them.

Also, look in actor.str - how is the acHPSumm field set up there?
Mathias is offline   #2 Reply With Quote
Ozob
Junior Member
 
Join Date: Jul 2015
Posts: 8

Old July 20th, 2015, 11:29 AM
This is straight out of the sample files. I guess I don't understand how derived traits work. There is no error, the file compiles fine.

There is a derived trait Health, and a HP total at the top of the screen. I am just not sure mechanically what the sample files are trying to do, or what a derived trait is good for.

Clarification:
What would the trHealth thing in the sample files be used for if not to track HP or show the starting HP?

And to answer your question...
<!-- Health summary for display -->
<field
id="acHPSumm"
name="Health Summary"
type="derived"
maxfinal="50">
<!-- Calculate a value that is based on all the fields referenced by the
"finalize" script. This ensures that the field always changes if any of
its pieces changes, which triggers the finalized value to be updated.
-->
<calculate phase="Render" priority="1000">
<after name="Calc acHPNow"/><![CDATA[
~make sure this value consists of the elements that could cause the summary to change
@value = field[acHPNow].value * 10000 + field[acHPMax].value * 100 + field[acHPPenal].value
]]></calculate>
<!-- Final value for display show the current and maximum health, plus any
penalty value in parentheses.
-->
<finalize><![CDATA[
@text = field[acHPNow].value & " / " & field[acHPMax].value
if (field[acHPPenal].value < 0) then
@text &= " {text clrwarning}(" & field[acHPPenal].value & "){text clrreset}"
endif
]]></finalize>
</field>

Last edited by Ozob; July 20th, 2015 at 11:32 AM.
Ozob is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old July 20th, 2015, 12:11 PM
trHealth is where you calculate the number of health points a character has - it's for those game systems where this isn't a fixed number, but a formula.

Then, the damage tracking code looks up the value that's calculated for the amount of health you have, and uses that as the maximum value for how much damage you can take. The acHPSumm field then displays the results of that - the current damage and the maximum damage - how close you are to death.

Derived traits are those that aren't entered by the user directly, but instead calculated based on the attributes that the user has set elsewhere. For example, in Shadowrun, there are two separate health stats - physical damage and stun, and the formula for physical is Body/2 + 8, and the formula for stun is Willpower/2 + 8. So the user enters Body and Willpower, depending on the character creation rules for that system, and then HL calculates the physical and stun damage maximums based on the attributes that the user has set.
Mathias is offline   #4 Reply With Quote
Ozob
Junior Member
 
Join Date: Jul 2015
Posts: 8

Old July 20th, 2015, 12:52 PM
Okay, so in the sample rules, the trHealth trait as it appears will NEVER do anything unless you give it some kind of formula. Since as far as I can tell it's just set to 0.

So if my health stat is equal to skill+10, then should I put that formula in the derived trait?

If so, then I would reference this trait in the form_static instead of using the built in HP calculations? Or how does it work the two of them together?

Also, thanks so much for the help. This is a rather daunting task, but it's nice as I can see progress.
Ozob is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old July 20th, 2015, 01:54 PM
Have you read the derived traits section in the Savage Worlds walkthrough in the authoring kit wiki? That covers how they turned the Health trait of the skeleton files into the Toughness trait of the Savage Worlds game system.

http://hlkitwiki.wolflair.com/index....s_%28Savage%29
Mathias is offline   #6 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:28 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.