Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
A feat I'm entering adds 2 HP for every feat of a specific category (Arcana in this case).
I figure I just need to count the fCategory.Arcana tags, multiply by 2 and += them to HP but I'm no sure how to do the tag counting part. I'm thinking: var count as num foreach feat where tagis[fCategory.Arcana] count += 1 end count *= 2 container.child[Totals].field[tHP].value += count I know my syntax is very likely wrong I just wanted to write out my idea and see if I'm on the right track. Thanks, Andrew |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
On the Class Level tab (not the Class tab), copy the Loremaster class - one of the prereqs on that needs to count feats by category.
|
#2 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
so I could do something like:
var count as num count = tagcount[fCategory.Metamagic] * 2 container.child[Totals]field[tHP].value += count |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Code:
field[abValue].value += tagcount[fCategory.Metamagic] * 2 hero.child[Totals]field[tHP].value += field[abValue].value You could do Code:
hero.childfound[ID_OF_FEAT].field[abValue].value += -2 Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
|
#4 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
I get an error using that:
Hero Lab was forced to stop compilation after the following errors were detected: Syntax error in 'eval' script for Thing 'fRPArcaneB' (Eval Script '#1') on line 7 -> Invalid child transition syntax used |
#5 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Also I'm already using abValue in this feat, so I think I just use abValue2 but I can't remember.
|
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
ShadowChemosh, as long as you're talking about best practices, I'd suggest using -= 2, rather than += -2.
Also remember that herofield[] is a shortcut for hero.child[Totals].field[], and #value[] is a shortcut for hero.childfound[].field[abValue].value, so you can cut down the typing required for that code even further. |
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
AndrewD2, the error message refers to line 7. I recommend you copy and paste line #7 here (or paste your whole script, empty lines and all, if you can't figure out which one is the problem). You've probably got a typo, but without seeing the code, we can't see what it is.
|
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
Actually, I think I can see it, if you copied ShadowChemosh's script exactly and then modified it - he forgot a period inbetween hero.child[Totals] and field[tHP].value
|
#9 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Ok so I got it working ... kinda
Code:
~ Add to abValue first so outside things can adjust us field[abValue].value += 1 ~ add to the pool total #trkmax[trkArcaneP] += field[abValue].value field[abValue2].value += tagcount[fCategory.Arcana] * 2 herofield[tHP].value += field[abValue2].value I was running it at post-attributes 10000, but I've tried it in most every other phase and it only ever adds 2 HP even when having 4 other Arcana feats. Am I missing something? |
#10 |
|
|