Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old February 23rd, 2018, 01:56 PM
I am working on script with the following foreach loop:

Quote:
foreach pick in hero from BaseWep where “wCategory.Melee”
~#situational[eachpick,sText,field[thingname].text]
nexteach
The portion that reads:

Quote:
foreach pick in hero from BaseWep where “wCategory.Melee”
gives me the following error. The #Situational line is commented out while I try to figure out what I am doing wrong with the actual foreach loop . . .

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'p5CAbsEle' (Eval Script '#2') on line 23
-> Invalid tag expression specified

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #1 Reply With Quote
jjashley
Senior Member
 
Join Date: Jan 2017
Posts: 139

Old February 23rd, 2018, 02:02 PM
Quote:
Originally Posted by Mergon View Post
I am working on script with the following foreach loop:



The portion that reads:



gives me the following error. The #Situational line is commented out while I try to figure out what I am doing wrong with the actual foreach loop . . .

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'p5CAbsEle' (Eval Script '#2') on line 23
-> Invalid tag expression specified
I'm using the below and it doesn't seem all that different than yours:

foreach pick in hero from BaseWep where "wCategory.Melee"
#extradamage[eachpick, " damage plus 10 (3d6) poison", field[thingname].text]
nexteach
jjashley is offline   #2 Reply With Quote
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old February 23rd, 2018, 02:22 PM
It doesn't make any sense to me either.

If I commect out the foreach and nexteach lines, I get no errors.

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #3 Reply With Quote
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old February 23rd, 2018, 02:25 PM
This is my full script in acess it matters:
Phase: Render, Priority: 10000

Quote:
~If we're disabled, do nothing &
doneif (tagis[Helper.Disable] = 1)
~ If nothing chosen then get out now!
doneif (field[pChosen].ischosen = 0)

var iLevel as number
var sText as string
var iCount as number

iLevel = #totallevelcount[]
if (iLevel >= 17) then
iCount = 4
elseif (iLevel >= 11) then
iCount = 3
elseif (iLevel >= 5) then
iCount = 2
else
iCount = 1
endif

sText = "+" & iCount & "d6 "
sText &= field[pChosen].chosen.tagnames[DamageRes.?]
foreach pick in hero from BaseWep where “wCategory.Melee”
~#situational[eachpick,sText,field[thingname].text]
nexteach

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #4 Reply With Quote
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old February 23rd, 2018, 02:32 PM
I don't know why, but I copy/pasted the foreach line from your script into mine, and now it works. They both appear identical to me . . .

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #5 Reply With Quote
jjashley
Senior Member
 
Join Date: Jan 2017
Posts: 139

Old February 23rd, 2018, 02:34 PM
Quote:
Originally Posted by Mergon View Post
This is my full script in acess it matters:
Phase: Render, Priority: 10000
What if you change "wCategory.Melee" to "IsWeapon.wSpear"

do you still get the error message?

EDIT:wow, I took out your foreach and pasted the one I used here and it took the script.

EDIT 2: ok I removed the foreach saved, tested, and then manually typed your foreach statement saved and tested and it took this time.

Last edited by jjashley; February 23rd, 2018 at 02:41 PM.
jjashley is offline   #6 Reply With Quote
jjashley
Senior Member
 
Join Date: Jan 2017
Posts: 139

Old February 23rd, 2018, 02:42 PM
Pretty sure I typed what you had.


sText = "+" & iCount & "d6 "
sText &= field[pChosen].chosen.tagnames[DamageRes.?]
foreach pick in hero from BaseWep where "wCategory.Melee"
#extradamage[eachpick,sText,field[thingname].text]
nexteach

EDIT, nope I changed situational to extradamage.

Edit 2, went back and changed it to situational and it took.

Not sure what is wrong with what you have pasted above, but I got same error when I copied and pasted.

J
jjashley is offline   #7 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old February 23rd, 2018, 03:08 PM
Quote:
foreach pick in hero from BaseWep where “wCategory.Melee”
~#situational[eachpick,sText,field[thingname].text]
nexteach
That is not valid QUOTES. You have something from Word or something but “ is not a ".

This is fixed:
Quote:
foreach pick in hero from BaseWep where "wCategory.Melee"
~#situational[eachpick,sText,field[thingname].text]
nexteach

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   #8 Reply With Quote
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old February 23rd, 2018, 03:17 PM
<bah> humbug. I missed that completely. That would explain my error.

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #9 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 12:18 AM.


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