Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old January 17th, 2013, 01:54 PM
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
AndrewD2 is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old January 17th, 2013, 02:31 PM
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.
Mathias is offline   #2 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old January 17th, 2013, 03:32 PM
so I could do something like:
var count as num
count = tagcount[fCategory.Metamagic] * 2
container.child[Totals]field[tHP].value += count
AndrewD2 is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old January 17th, 2013, 03:43 PM
Quote:
Originally Posted by AndrewD2 View Post
so I could do something like:
var count as num
count = tagcount[fCategory.Metamagic] * 2
container.child[Totals]field[tHP].value += count
My advice is to follow the HL standard and do
Code:
field[abValue].value += tagcount[fCategory.Metamagic] * 2
hero.child[Totals]field[tHP].value += field[abValue].value
The big advantage of using field[abValue] is that you can affect changes to this feat then from other Things. What if some feat or ability gives a -2 HP for taking this feat.

You could do
Code:
hero.childfound[ID_OF_FEAT].field[abValue].value += -2
By not using abValue you lose out on that ability.

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.
ShadowChemosh is offline   #4 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old January 17th, 2013, 03:52 PM
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
AndrewD2 is offline   #5 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old January 17th, 2013, 03:54 PM
Also I'm already using abValue in this feat, so I think I just use abValue2 but I can't remember.
AndrewD2 is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old January 17th, 2013, 03:57 PM
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.
Mathias is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old January 17th, 2013, 03:58 PM
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.
Mathias is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old January 17th, 2013, 04:00 PM
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
Mathias is offline   #9 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old January 17th, 2013, 04:13 PM
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
is the whole eval script.
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?
AndrewD2 is offline   #10 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 01:11 PM.


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