Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
dentaa
Member
 
Join Date: Sep 2016
Posts: 55

Old December 7th, 2016, 05:08 AM
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.
dentaa is offline   #1 Reply With Quote
TheIronGolem
Senior Member
 
Join Date: Feb 2015
Posts: 676

Old December 7th, 2016, 07:50 AM
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 by TheIronGolem; December 7th, 2016 at 02:22 PM.
TheIronGolem is offline   #2 Reply With Quote
dentaa
Member
 
Join Date: Sep 2016
Posts: 55

Old December 7th, 2016, 04:56 PM
Thank you for the input!!!
dentaa is offline   #3 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 10:05 PM.


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