• 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

Does anyone know the formula to add bonus HP per hit die/level?

Senko

Well-known member
I'm trying to create the mighty template and it adds

A mighty creature gains +10 bonus hit points per Hit Die (minimum +50)

Amongst other things. I've tried hunting for something that adds HP per hit die to adapt but I haven't found any so I'm wondering does anyone know the fomula to do this off the top of their head please? Otherwise I'll just keep hunting, thanks in advance for any help.
 
Off the top of my head, I'd have a look at scripts on the Toughness feat (which adds 1 hp/lvl, min 3). Not near HL to see whether it's indeed helpful.
 
Stupid password difficulties.

Good idea thanks, I hadn't thought of that.

The scripts there do nothing in the template but I'll play around and see if I can figure out why.


~ If we are using the wounds and vigor variant we need to adjust for that
if (hero.tagis[source.UCWound] <> 0) then
~ our bonus is our hit dice
field[abValue].value += herofield[tHitDice].value
else
~ our bonus is our hit dice or 3, whichever is higher
field[abValue].value += maximum(herofield[tHitDice].value, 3)
endif


and


~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

~ If we are using the wounds and vigor variant we need to adjust for that
if (hero.tagis[source.UCWound] <> 0) then
~ add that bonus to our wounds total
container.child[Wounds].field[wndFeat].value += field[abValue].value
else
~ add that bonus to our hit points
container.child[Totals].field[tBonusHP].value += field[abValue].value
endif
 
There's an adjustment, it's either part of hero lab entirely or part of the Community Package.
You can add X hit points per level with it.

That does exactly what you're looking for, so I'd look at that.
 
Stupid password difficulties.

Good idea thanks, I hadn't thought of that.

The scripts there do nothing in the template but I'll play around and see if I can figure out why.


~ If we are using the wounds and vigor variant we need to adjust for that
if (hero.tagis[source.UCWound] <> 0) then
~ our bonus is our hit dice
field[abValue].value += herofield[tHitDice].value
else
~ our bonus is our hit dice or 3, whichever is higher
field[abValue].value += maximum(herofield[tHitDice].value, 3)
endif


and


~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

~ If we are using the wounds and vigor variant we need to adjust for that
if (hero.tagis[source.UCWound] <> 0) then
~ add that bonus to our wounds total
container.child[Wounds].field[wndFeat].value += field[abValue].value
else
~ add that bonus to our hit points
container.child[Totals].field[tBonusHP].value += field[abValue].value
endif

You should be looking at Priority and Timing as well, not just the script. Everything in Hero Lab has a Phase and Priority, if you don't time the script right it won't do anything. Also, the else part of that first if then is not needed if you just want to add a number of hit points equal to HD.
 
There's an adjustment, it's either part of hero lab entirely or part of the Community Package.
You can add X hit points per level with it.

That does exactly what you're looking for, so I'd look at that.

I actually tried that first if your talking about what I think you are. I can use that in permanent adjustment on the character sheeet and just give a character bonus HP but I need to change it each level manually for each character. I don't know where to find that in the editor to make it part of a template. I've a community tab but nothing there really makes sense to me.

You should be looking at Priority and Timing as well, not just the script. Everything in Hero Lab has a Phase and Priority, if you don't time the script right it won't do anything. Also, the else part of that first if then is not needed if you just want to add a number of hit points equal to HD.

I didn't include the timing and priority information before because I figured that could just be migrated across since they're both post levels at 5,000 and 15,000 priority with no timing information specified and be fine. I was actually digging through the tutorials on the theory its the hero child or the like that is not mapping correctly.

Good to get confirmation on the or else part I thought I could just cut the first half of that but until I got it adding the hp that was just being left alone to keep it as close to the toughness feat.
 
Phase and Priority are essential, they determine the timing on when the script runs. Keep in mind this script is adding the bonus directly to the class levels not the overall hp.
 
Phase and Priority are essential, they determine the timing on when the script runs. Keep in mind this script is adding the bonus directly to the class levels not the overall hp.

Interesting though I don't see how it would affect anything here. A direct copy script, phase, priority. Add template, add levels no HP, add template, add levels, add toughness feat, get bonus hp.
 
Senko, that code from post #2 in this thread is what you put in an eval script on the template itself? Or was this on an ability bootstrapped from the template? Because that shouldn't have even compiled if it was on the template - the abValue field does not exist on the "Template" compset, the way it does on the "Feat" compset.

You'll need to use a variable instead - replace all references to abValue with the variable.
Code:
var hitpointstoadd as number

hitpointstoadd += herofield[tHitDice].value

Oh, and in the Develop menu, make sure you have "Enable Data File Debugging" turned on. That would have given you extra error messages that might have flagged this.

Also, in the second section of that template, Helper.FtDisable is a test that is only relevant to feats.
 
Ok in order . . .

1) It was in the eval script on the template itself. It not compiling would explain why it didn't add hp I thought I had an invalid identifier in there good to know I was on the right track even if it would probably have taken me a lot longer to track it down.

2) Thanks for the correct variable I'll play around with it when I have some more time. I'm obviously still entering it wrong as its not changing anything.

3) I'll enable that debugger.

4) So I take it . . .

~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

~ If we are using the wounds and vigor variant we need to adjust for that
if (hero.tagis[source.UCWound] <> 0) then
~ add that bonus to our wounds total
container.child[Wounds].field[wndFeat].value += field[abValue].value
else
~ add that bonus to our hit points
container.child[Totals].field[tBonusHP].value += field[abValue].value
endif

can be deleted in its entirety?

Thanks for the help.
 
4) This:
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

Will never change anything, because Helper.FtDisable will never exist outside of a feat, so this test will always find that it is not there, and therefore nothing will change because of that line. The next two sections are critical - that's where it actually adds the HP bonus to the character.
 
Fair point. Here they are but I'm still working on them just very busy with things till next Monday.

I have in Eval scripts

1

field[livename].text = "Mighty"


(Working)

2


~ If we are using the wounds and vigor variant we need to adjust for that
if (hero.tagis[source.UCWound] <> 0) then
var hitpointstoadd as number
hitpointstoadd += herofield[tHitDice].value
else
~ our bonus is our hit dice or 3, whichever is higher
var hitpointstoadd as number
hitpointstoadd += (herofield[tHitDice].value, 50)
endif

(Template adds 10 hp per level minimum 50. I think my issue here is I don't have an amount of hp to add just that it needs to do so. I also suspect I need to change hero.tagis to something else just haven't had time look through the tutorials yet.)

3)


~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

~ If we are using the wounds and vigor variant we need to adjust for that
if (hero.tagis[source.UCWound] <> 0) then
~ add that bonus to our wounds total
container.child[Wounds].field[wndFeat].value += field[abValue].value
else
~ add that bonus to our hit points
container.child[Totals].field[tBonusHP].value += field[abValue].value
endif

(Going by the response to my question I can delete the first two lines. Again I probably need to change source.ucwoun to something else. Though I can probably delete all these as the wounds variant isn't being used).

I also need to figure out how to add some other things.

The templates from the genius guide to simple monster templates.

Mighty
+10 bonus hit points per Hit Die (minimum +50) (Currently working on this)
+5 dodge bonus to AC
+5 bonus to initiative, all saving throws, damage, ability checks, and skill checks.
It also gains a +30-foot bonus to its speed (to a maximum of double),
+10 to all attack rolls and CMB
+15 to CMD.
The saving throw DC for any ability or spell of a mighty creature is increased by 7.
It gains DR 1/— for every three full Hit Dice it possesses. This overlaps (does not stack with) any other DR the base creature might have.
Immunities: A mighty creature is immune to mind-affecting abilities, sleep, and paralysis.
SR is equal to the base creature’s CR +12.

CR +5

Very powerful but useful for creating a challenging variant of a weak monster to challenge higher level players.
 
Unlike a field that stores a value (the field[abValue].value part), a variable can't persist from script to script, so you can't have script #2 calculate the right value for the variable, and then script #3 try to make use of it (oh, and script #3 isn't currently trying to make use of it - it's still referencing field[abValue].value, where it should be using hitpointstoadd.


You'll have to put both of those pieces of code into the same script for this to work in a template, where you don't have access to the value fields like abValue.
 
Back
Top