View Single Post
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old December 30th, 2017, 11:43 AM
Quote:
Originally Posted by insaneurge View Post
I am running the script and it tests it and allows me to use the class the script is assigned to and then gives the following message.

Invalid tag expression specified for 'foreach' statement.

var refbd as number
var fortbd as number
var willbd as number
foreach pick in hero from BaseClHelp where "c?.Bad"
refbd += eachpick.field[tLevel].value
fortbd += eachpick.field[tLevel].value
willbd += eachpick.field[tLevel].value
nexteach

hero.child[svRef].field[Bonus].value/=3
hero.child[svFort].field[Bonus].value/=3
hero.child[svWill].field[Bonus].value/=3
Are you running this in d20 or Pathfinder? svRef, svFort, and svWill are used in Pathfinder, but in d20 you have to remove the s at the beginning.

I checked the foreach, and it looks like you can't use the ? in this case. Sorry about that. Easy enough fix though, just change it to:

Code:
foreach pick in hero from BaseClHelp where "cFort.Poor | cWill.Poor | cRef.Poor"
The | stands for "or".

Also, you'll need to change tLevel to cTotalLev when setting the variables.
Sendric is offline   #6 Reply With Quote