• 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

Sanity Points

What's the difference between how you're getting to usrChosen1 in these two lines:

Code:
if (field[usrChosen1].ischosen <> 0) then

Code:
sp = [usrChosen1].field[aFinalVal].value * 5

The error is reported for line #3 - the second one of those, but not for line #1 - the first one of those - so why is the first one right, and the second one wrong?
 
Well we have been trying to figuare it out, but still no luck (sorry not a programer). This is what we got so far:

if (field[usrChosen1].ischosen <> 0) then
var sp as number
sp = field[usrChosen1].field[aFinalVal].value * 5
sp = round(sp, 0, -1)

and the error is

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

Syntax error in 'eval' script for Thing 'cMHMind' (Eval Script '#1') on line 3
-> Invalid use of a reserved word in script


BTW - Thank you for your patience
 
Okay, that was the first error.

Now for the second (I only see these two errors) - there is still something missing in that line.

I'd recommend looking at existing things that use field[usrChosen1].

You're missing something between field[usrChosen1] and the next use of field[] - those can't follow each other directly.
 
if (field[usrChosen1].ischosen <> 0) then
var sp as number
sp = field[usrChosen1].chosen.field[aFinalVal].value * 5
sp = round(sp, 0, -1)
endif

Well the script doesn't give an error, but it doesn't seem to multiply the value, (the tracker has a 0 value)
 
Yep, that was the other syntax error.

(I presume there's a line you haven't copied that adds the sp variable to field[trkMax].value)

Now for timing.

Going into the editor's help menu, and looking at the "Choosing a Phase" link at the bottom, here's the description of the Final phase:

Should be used by anything that can be run after all other scripts.
For example, if you want to calculate a field based on the final results of a number of other scripts, that isn't used by anything else, you should use this phase.

If you set a number of uses, Hero Lab needs to be able to compare that to the number you've actually used - that means that the Final phase, for scripts that "can be run after all other scripts" is too late.

You do need the final value of the attribute though - that means you need to be in the Post-Attribute phase or later, so, use Post-Attributes as the phase for this script.
 
Frodie,

I am trying to get this to work as well.

I have the sanity adjustment in place.

I have Knowledge skill: Forbidden Lore Adjustment working

and have created the Knowledge skill: Forbidden Lore.

I cannot get the following to work:

- adjustment of the sanity tracker based on increase of the Knowledge: forbidden lore adjustment, or increase of the Knowledge: forbidden lore skill

- adjustment of the knowledge: forbidden lore skill, based on an increase of the knowledge: forbidden lore adjustment.

Any assitance would be greatly appreciated
 
I did get it to work, it is in one of the old Modern dataset, I can get it for you and posted it, but it might be later on today.
 
Tracker Tab

Final Phase Priority 10000

~ We get Wisdom score multiplied by 5, so calculate
~ that number.
var sp as number
sp = hero.child[aWIS].field[aFinalVal].value * 5
sp = round(sp, 0, -1)

~ Add to our total charges.
field[trkMax].value -= #skillbonus[skshForLor]
field[trkMax].value -= #skillranks[skshForLor]
field[trkMax].value += sp

It is in the Supernautral Heroes in the old Modern Pathfinder dataset under the tracker tab. This one is just based off the Wisdom score. The one that is based off Int, Wis, or Cha is in the older dataset, you can look through some of the old modern threads and it'sone of them.
 

Attachments

Last edited:
Back
Top