• 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

Eval Script Format

dentaa

Well-known member
Hello All.
I have a question about eval format.
I have a custom movement rate (Str+Dex)/2 gives a base move number.
I want to substitute that number for Speed using the Replaces Thing Id.

But I am fuzzy on the script part...

Here is what I have and its saying invalid script term.

~ Add Str+Dex and divide by 2 to calculate Movement
hero.child[abTIMmove].value = (hero.child[aSTR].value + hero.child[aDex].value)/2

(abTIMmove = my unique value id for movement.)

Thanks if anyone can give me a clue. :)
 
Your problem lies in the use of:

Code:
hero.child[XXXX].value

"hero.child[XXXX]" gets you to to the pick with the id of XXXX (provided that pick actually exists on the hero), but that pick does not itself have a "value" that you can reference. Instead, what you need to do is figure out which of that pick's fields you need, and get/set the value of that field.

For example:

Code:
hero.child[abTIMmove].field[abValue].value += (hero.child[aSTR].field[aFinalMod].value + hero.child[aDex]field[aFinalMod].value)/2

Those field names may not be the correct ones for what you're trying to accomplish (I don't know whether you're looking to use the actual ability scores or the ability bonuses, so I took a guess), but the code should at least compile.

For a more in-depth explanation, go here and check out the second link "Location, Location, Location".

On a related issue, note that I've changed your = operator to a +=. This is generally the preferred practice, because straight-up assigning a value can cause headaches if/when other things try to modify the value on that ability (for instance, a feat that adds +10 to that movement speed).
 
Last edited:
Back
Top