Update:
While creating an Archetype in the Pathfinder game system, I want to give my Archetype specific bonus feats at various levels.
I am using a technique where I create a Class Special using ClSpecWhen so it shows up on the list of class abilities for the user, then the Class Special bootstraps the Feat, using the bootstrap Conditions to verify level.
Overall, everything is working perfectly, until I get to the feats that have a choice, and I want to pre-select the choice.
Weapon Focus (Longbow) at 2nd level
Bootstrap: fWepFoc
- Group Id: Target - Tag Id: wLongbow
Point Blank Master (Longbow) at 6th
Bootstrap: fPointBMas
- Group Id: Target - Tag Id: wLongbow
- Group Id: thing - Tag Id: skipprereq
Both feats are being added at the proper level.
Both are even being pre-selected properly and the user can't change.
Great!
However, here's the problem I'm getting.
While
Weapon Focus works perfectly without complaint or error.
Point Blank Master works, but complains:
Invalid tag expression specified for 'foreach' statement
Location: 'eval' script for Thing 'fPointBMas' (Eval Script '#1') near line 23
So I coped the fPointBMas feat, and examined line 23 of the script. It's the last "foreach" line.
Code:
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
~ If we haven't chosen anything, get out now
doneif (field[usrChosen1].ischosen + tagis[Target.?] = 0)
~ Assign the appropriate tag to all weapons that meet the criteria
var id as string
id = field[usrChosen1].chosen.idstring
if (tagcount[Hero.MartVersa] + hero.tagcount[Hero.MartMaster] <> 0) then
perform field[usrChosen1].chosen.pulltags[wFtrGroup.?]
id = tagids[wFtrGroup.?," | "]
foreach thing in BaseWep where id
if (eachthing.tagmatch[wFtrGroup,wFtrGroup,initial] <> 0) then
perform eachthing.amendthing[description,eachthing.field[descript].text & "{br}{br}{b}Addition from Point Blank Master{/b}: You do not provoke attacks of opportunity for firing this weapon."]
endif
nexteach
else
id = field[usrChosen1].chosen.idstring
foreach thing in BaseWep where "IsWeapon." & id
perform eachthing.amendthing[description,eachthing.field[descript].text & "{br}{br}{b}Addition from Point Blank Master{/b}: You do not provoke attacks of opportunity for firing this weapon."]
nexteach
endif
This section of code appears to add the flavor text of the feat to the weapon description for all weapons that match a field called usrChosen1. Weapon Focus does not have this issue because it does not modify any weapon description.
Do I have to set this field manually? What should go in there? By the code I would guess that in my case it would be "wLongbow", but I have zero clue how to set this.
Also, I looked at regular character with Point Blank Master, and the usrChosen1 field contains a dash character "-", which is the same thing the feat contains on my archetype. In fact, I see zero differences between the debug fields between the two feats (other than abOrder), so I'm not even sure what the issue is.
I tried using Fields on the class special...
Field Id: usrChosen1 -
Value: wLongbow
...but this did nothing to prevent the error.
Next, I tried setting the Field on the Bootstrap itself...
Field Id: usrChosen1 -
Value: wLongbow - Assign (default, not sure what this does)
...but then I got a new error:
Hero Lab was forced to stop compilation after the following errors were detected:
Thing 'cL47PBMast' - Conditional bootstrap is not allowed with the value assignment on 'user' field 'userChosen1'
Thing cL47PBMast' - Menu field 'userChosen1' referenced in bootstrap may only be used with 'thing', 'pick', or 'hero' behavior
So, I tried each of those (thing, pick, hero) in turn, instead of 'Assign', which removed the 2nd line of the error (about menu field), but I still got the 1st line of the error (about the conditional bootstrap)...
Any suggestions?