Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
I need help with Firearm kick.
Basically I need to make the str bonuses to be no more that +2. I can add the str bonus but can't cap it at 2 field[wAttBonus].value += maximum(#attrmod[aSTR], 0) |
#1 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
var bonus as number
bonus += maximum(#attrmod[aSTR], 0) if (bonus > 0) then bonus = minimum(bonus, 2) endif field[wAttBonus].value += bonus |
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Here's a version with even less typing:
Code:
field[wAttBonus].value += minimum(#attrbonus[aSTR],2) |
#3 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
Cool, Thank yall!
|
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
So is this saying maximum(,1) then? So that 1 is the smallest value returned?
Runs off to add the other new macros to his list of COOL hidden HL features. 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. |
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Code:
#attrbonus1[aSTR] Code:
maximum(hero.child[aSTR].field[aModBonus].value,1) |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
You may want to search the FAQ for "macro"
|
#7 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Sweet!
Thanks, useful macros for putting in my tool belt... Yea I should and compile them all together actually. Hmm a wiki would work really well for all this.... So use to having online manuals for my programming languages that I miss it for HL. 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. |
#8 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
Added Kick and one or two handed mods to firearms to the Modern Path
|
#9 |
|
|