Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226

Old December 4th, 2017, 12:12 PM
I’m writing an eval script that grants a 5’ bonus to base speed. This ability scales with level. The first 5’ bonus is granted at 1st level, and then again at every 4 class levels (i.e. 4th, 8th, 12th, etc.)
The script I first came up with was:

field[abValue].value += round(field[xTotalLev].value / 4, 0, -1) + 5

It worked for 1st level (changed 30’ speed to 35’ speed), but at 4th level the speed became 36’. So I changed the script to:

field[abValue].value += round(field[xTotalLev].value / 4, 0, -1) * 5

This worked at all levels except 1st.

Then I thought “What if I round up instead of down?”:
field[abValue].value += round(field[xTotalLev].value / 4, 0, 1) + 5

This resulted in a +6’ movement speed at 1st level.

field[abValue].value += round(field[xTotalLev].value / 4, 0, 1) * 5

This resulted in a 5’ increase at 1st level, but no increase at 4th.

What is the magic formula to make this work?
Thanks^7
Bob G is offline   #1 Reply With Quote
 

Thread Tools
Display Modes

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:45 PM.


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