Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 12th, 2007, 10:08 AM
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 is offline   #1 Reply With Quote
Colen
Senior Member
Lone Wolf Staff
 
Join Date: Dec 2008
Posts: 4,690

Old July 12th, 2007, 04:50 PM
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/
Colen is offline   #2 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 12th, 2007, 11:22 PM
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.

Dormio Forte Somnio


Community Created Resources :
Data Package Repositories :
d20pfsrd
Custom Character Sheets
Community Server Setup (Packs)

Hero Lab Help- Video Tutorials and Pathfinder FAQ

Created by the community for the community
bodrin is offline   #3 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 13th, 2007, 04:23 AM
At 12:22 AM 7/13/2007, you wrote:
Quote:
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....
rob is offline   #4 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 13th, 2007, 06:24 AM
Thank you for the Explanation.
It makes sense now, (Common sense, Doh!! ops 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!!
bodrin is offline   #5 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 06:46 AM.


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