Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
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? |
#1 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
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/ |
#2 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
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
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
At 12:22 AM 7/13/2007, you wrote:
Quote:
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.... |
|
#4 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
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!! |
#5 |
|
|