Senior Member
Volunteer Data File Contributor
Join Date: May 2010
Location: Mountlake Terrace, Washington
Posts: 408
|
I have a few feats that set the minimum values at 1. Here they are:
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
In Example: The bonus is equal to +1 per 2 channeling dice (minimum +1) Code:
field[abValue].value += maximum( round( #value2[xChannel]/2 ,0,-1) ,1 ) 1) "#value2[xChannel]/2" abValue2 from xChannel divided by 2. 2) "round( step1 ,0,-1)" take the result and round it. The ,0 tells us to round to whole numbers and the ,-1 tells us to round down. So that .5 will become 0 and 1.5 would become 1. 3) "maximum( step2 ,1 )" take the value from the result in step 2 or the value of one ,1. Example 1: So lets say we have 1 channel dice in xChannel abValue2: 1) 1/2 = .5 2) round .5 down into a whole number so we get 0 3) is 0 or 1 the "bigger" number? Of course its 1 so we get a result of 1. Final answer placed into field[abValue].value is 1. Example 2: So lets say we have 4 channel dice in xChannel abValue2: 1) 4/2 = 2 2) round 2 down into a whole number so we get 2 3) is 2 or 1 the "bigger" number? Of course its 2 so we get a result of 2. Final answer placed into field[abValue].value is 2. hope that helps. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. Last edited by ShadowChemosh; March 2nd, 2014 at 10:13 AM. |
|
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: May 2010
Location: Mountlake Terrace, Washington
Posts: 408
|
Here's what I'm doing:
doneif (hero.tagis[Hero.Channel] = 0) field[abValue].value += minimum(round(hero.child[xChannel].field[abValue2].value/2,0,-1),1) field[livename].text = field[name].text &" -/" & signed(field[abValue].value) It's capping the value at 1 rather than setting the minimum. |
#3 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
You need to use maximum, not minimum, like Shadow said
|
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: May 2010
Location: Mountlake Terrace, Washington
Posts: 408
|
I thought he was giving me an example of how a function works and I was supposed to use "minimum." Thanks.
|
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: May 2010
Location: Mountlake Terrace, Washington
Posts: 408
|
Using the exact script Shadow gave is setting the value at 1 no matter what.
|
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Um I actually tested the script and it was working fine. Do you have anything else in your script? You do know you will have to be level 7 Cleric before you will see a 2 right? Level 7 gives a 4d6 so half will finally give 2. Otherwise from level 1 to 6 the value should correctly be 1.
Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#7 |
Senior Member
Volunteer Data File Contributor
Join Date: May 2010
Location: Mountlake Terrace, Washington
Posts: 408
|
Now I feel like an idiot. Everything is fine. It's me that's not so fine. I don't know what I was thinking.
|
#8 |
|
|