• 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

Improved Toughness Feat!!!

bodrin

Well-known member
I'm trying to get the Improved Toughness Feat from Complete Warrior into Hero Lab.

Managed to get the Base Fortitude save Pre-Requisite to work using this script,

if (child[vFort].field[vBase].value >= 2) then
@valid = 1
endif

However I can't get the current Hit Dice to add to the Hit point total of a test character.

I've looked at the standard Toughness feat Eval script and thought I could just modify the end to add the Total.Field [tHitDice] as a modifier instead of the +3 but it Doesn't work though.

Toughness Feat Eval Script

container.child[Totals].field[tHP].value = container.child[Totals].field[tHP].value + 3

Heres the Eval script i'm trying for Improved Toughness.

container.child[Totals].field[tHP].value = container.child[Totals].field[tHP].value + container.child[Totals].field[tHitDice].value

Does anyone have any ideas why it's not working?
 
bodrin wrote:
>
>
> I'm trying to get the Improved Toughness Feat from Complete Warrior into
> Hero Lab.
>
> However I can't get the current Hit Dice to add to the Hit point total
> of a test character.
>
> I've looked at the standard Toughness feat Eval script and thought I
> could just modify the end to add the Total.Field [tHitDice] as a
> modifier instead of the +3 but it Doesn't work though.
>
> Toughness Feat Eval Script
>
> container.child[Totals].field[tHP].value =
> container.child[Totals].field[tHP].value + 3
>
> Heres the Eval script i'm trying for Improved Toughness.
>
> container.child[Totals].field[tHP].value =
> container.child[Totals].field[tHP].value +
> container.child[Totals].field[tHitDice].value
>
> Does anyone have any ideas why it's not working?


That sounds like it should be working. What phase and priority are you
running the script at? Try changing it to phase "UserPostLv" / priority
10000 and see if it works - the "hit dice" field isn't set until the
PostLevel phase.


--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/
 
I don't know much about scripting. I'm just cobbling together scripts from existing feats. The last time I tried programming was in basic on a ZX Spectrum 48k!!!

Thanks for the tip, I don't understand the Phases at the moment but I will eventually.
 
At 12:22 AM 7/13/2007, you wrote:
Thanks for the tip, I don't understand the Phases at the moment but I will eventually.
Phases and priorities control the sequence in which everything is processed within Hero Lab. Most behaviors need to be processed before or after other behaviors in order to get everything to work correctly. So every script is assigned a phase and priority that tells HL exactly when to process each one. Phases are a way to group a bunch of operations into a logical, er, group. Each phase is assigned a name that describes it's timing, such as "PreLevel" for operations that must occurs before levels are applied, "PostLevel" for operations that occur just afterwards, "PreAttr" for operations that occur just before attribute adjustments, etc. The list of phases is defined uniquely for each game system.

Within a given phase, numeric priorities are used to control which scripts are invoked in what order. Smaller values are evaluated before larger values (e.g. 10 before 15). Since the terms "lower" and "higher" can be confusing, scripts with a smaller priority value are said to be at an "earlier priority" and those with a higher value are at a "later priority".

By combining both the phase and priority, Hero Lab properly evaluates everything for the game system. Scripts with the same phase and priority can generally be assumed to get evaluated at the exact same time. This is fine for scripts that don't bear any relation to one another, such as two separate scripts that derive modifiers from different attributes. However, two scripts that read and write the same information should always have distinct timing (i.e. phase/priority) to ensure that one script is always processed before the other.

If you write a script at priority 100 that accesses a value which is set by a script that runs at priority 200, the value you access won't contain the proper value. This will result in your script behaving incorrectly. So it's important you schedule your scripts appropriately.

The list of phases for each game system are defined within the documentation for that game system. When you're writing a script, you should typically have no problem inferring the proper phase to assign it. The priority may be less obvious, which is why the documentation includes details on the various priority values used for different purposes within a given phase. You should normally be able to determine the phase based on the documentation. If not, post the question here and we'll be happy to get you an accurate answer.

I hope this explanation proves helpful....
 
Thank you for the Explanation.
It makes sense now, (Common sense, Doh!! :oops:) and Thank you once more for the priority phase tip, it works superbly.

Improved Toughness is live and operational 1st level fighter with Imp Toughness not valid but still has 11 Hit points with no con modifier, 10th lvl Fighter max hit points no con modifier 100 + 10HD (110HP)

And it works backwards to, Retro actively adding or subtracting according to level!! :D
 
Back
Top