• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Help with eval Script

Kaleb

Well-known member
I am trying to make an eval script to change my Stealth Attack die type form a d6 to a d8. would this script do it.

foreach pick in hero where "thingid.cRstStAtt”
eachpick.field[listname].text = "Stealth Attack +" & eachpick.field[xIndex].value & "d8”

nexteach

~If we’re not shown get out now.
Doneif (tagis [Helper.ShowSpec] = 0)

foreach Pick in Hero where “thingid.cRstStAtt”
eachpick.field[livename].text= “Stealth Attack +”&
eachpick.field[abValue].value &”d8”

eachpick.field[abSumm].text=”+”&
eachpick.field[absumm].value&”d8 damage when your target is caught flat footed or flanked.”

nexteach
 
Honestly it would be easier to change the script running on "Stealth Attack" so that your ability/feat that is increase from d6 to d8 would be easy.

So your original class special script I think is this:

Code:
field[livename].text = "Stealth Attack +" & field[abValue].value & "d6"
field[abSumm].text = "+" field[abValue].value & "d6 damage if you flank your target or your target is flat-footed."
field[listname].text = "Stealth Attack +" & field[xIndex].value & "d6"

So what you do is set abValue2 to be your die size. So abValue is number of dice and abValue2 is your die size.

Post-Levels/10000
Code:
~ Set die size to d6
field[abValue2].value += 6

field[livename].text = "Stealth Attack +" & field[abValue].value & "d" & field[abValue2].value
field[abSumm].text = "+" field[abValue].value & "d" & field[abValue2].value & " damage if you flank your target or your target is flat-footed."
field[listname].text = "Stealth Attack +" & field[xIndex].value & "d"  & field[abValue2].value

Now you have a variable holding the die size.

Your new ability/feat would have this script:
Pre-Levels/10000
Code:
~ Increase die size to d8
#value2[cRstStAtt] += 2

Now we have easy to modify scripts and no foreach loops running which are very CPU intensive.
 
what does this error message mean.

Line 5: thing 'Stealth Attack Greater' (unique id: StatkGR) from component set 'CustomSpec'

this is the script
~ Set die size to d6
field[abValue2].value += 6

field[livename].text = "Stealth Attack +" & field[abValue].value & "d" & field[abValue2].value
field[abSumm].text = "+" field[abValue].value & "d" & field[abValue2].value & " damage if you flank your target or your target is flat-footed."
field[listname].text = "Stealth Attack +" & field[xIndex].value & "d" & field[abValue2].value


in the error message why is there a prentices after the unique ID there is not one in the unique id box for the custom ability
 
Last edited:
When I use the 2nd eval script

#value2[cRstStAtt] += 2

I get a syntax error thing does not exist [cRstStAtt]

[cRstSTAtt] is the name id for stealth attack in the class special. Why if is there do I get a syntax error in custom special where I am trying to increase its value?
 
When I use the 2nd eval script

#value2[cRstStAtt] += 2

I get a syntax error thing does not exist [cRstStAtt]

[cRstSTAtt] is the name id for stealth attack in the class special. Why if is there do I get a syntax error in custom special where I am trying to increase its value?
Capitalization counts in HL. You have it it listed above as both cRstStAtt and cRstSTAtt. HL Will see these as two different unique IDs.

To make sure you may want to copy the Unique ID in the editor and past into the script.
 
Tim I feel dumb on the caps issue. I'm very near sighted and was having trouble reading the small text im the popup windw. I fixed it and it compiles but when I tried it out on a portfolio I got the following error.

Attempt to access field 'listname' that does not exist for thing 'StatkGR'
 
Tim I feel dumb on the caps issue. I'm very near sighted and was having trouble reading the small text im the popup windw. I fixed it and it compiles but when I tried it out on a portfolio I got the following error.
No issue. My eyes are starting to go and I totally understand this actually. The "L" and "I" in HL are really really hard to see also. I just learned to do the copy/paste allot to make sure I don't miss type. ;)

I also write most scripts in TextPad so that I can get nice 14+ point and BOLD font. :) At work I have source code IDE set to 14 point BOLD on a 38 inch monitor. People laugh at me cause they can read the source code from across the hallway!

Attempt to access field 'listname' that does not exist for thing 'StatkGR'
What is "StatkGR"? Is it a feat or something? Somehow the script is running on something that is not a "Class Special" as only they have "listnames" to change. All other things do not.
 
Last edited:
StatkGR is the unique ID for the custom special Stealth Attack Greater. This could be the problem, I have Stealth attack greater as a custom special so it can be selected as a ranger talent. Do you have to do a special script to run a custom special on something that is Class Special?
 
StatkGR is the unique ID for the custom special Stealth Attack Greater. This could be the problem, I have Stealth attack greater as a custom special so it can be selected as a ranger talent. Do you have to do a special script to run a custom special on something that is Class Special?
So Custom Specials don't have listnames fields. So remove the reference in your script to the listname.

Ok lets start a little over here as some of the scripts listed above I think are running on the wrong Thing. I admit I got a little confused on what was what. So to get on the same page lets cover both scripts on the Class Special and the Custom Special.

So lets start off with the script that should be running on the "Stealth Attack" Class Special Thingid.cRstStAtt

Post-Levels/10000
Code:
~ Set die size to d6
field[abValue2].value += 6

~Set the list name
field[listname].text = field[thingname].text & " " & signed(field[xIndex].value) & "d" & field[abValue2].value

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)
~ if we've been disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

field[abValue].value += field[xCount].value
field[livename].text = field[thingname].text & " " & signed(field[abValue].value) & "d" & field[abValue2].value
Then cRstStAtt is bootstrapped multiple times to the class. Each time set at when Stealth Attack is increased. So assuming that we get Stealth Attack at level 1,3,5,7,9,11,13,15,17,19. You would have this ability bootstrapped 10 times to the class.

Then on the Custom Special (Thingid.StatkGR) "Stealth Attack Greater" you need to run just before the Class Special script runs so that we can increase the die size.
Post-Levels/9000
Code:
~ Increase stealth attack die size from d6 to d8
#value2[cRstStAtt] += 2

Hopefully this gets you squared away. :)
 
Back
Top