Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old May 29th, 2012, 01:28 PM
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)
Frodie is offline   #1 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old May 29th, 2012, 01:45 PM
var bonus as number
bonus += maximum(#attrmod[aSTR], 0)

if (bonus > 0) then
bonus = minimum(bonus, 2)
endif

field[wAttBonus].value += bonus
Aaron is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 29th, 2012, 01:50 PM
Here's a version with even less typing:

Code:
 
field[wAttBonus].value += minimum(#attrbonus[aSTR],2)
(#attrbonus[] is #attrmod[] with maximum(,0) built in). (There's also #attrbonus1[])
Mathias is offline   #3 Reply With Quote
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old May 29th, 2012, 01:53 PM
Cool, Thank yall!
Frodie is offline   #4 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 29th, 2012, 02:47 PM
Quote:
Originally Posted by Mathias View Post
(There's also #attrbonus1[])
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.
ShadowChemosh is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 29th, 2012, 02:50 PM
Code:
#attrbonus1[aSTR]
is translated by the compiler into:

Code:
 
maximum(hero.child[aSTR].field[aModBonus].value,1)
(See the v2.4 FAQ entry for the announcement of this one)
Mathias is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 29th, 2012, 02:53 PM
You may want to search the FAQ for "macro"
Mathias is offline   #7 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 29th, 2012, 02:59 PM
Sweet!

Thanks, useful macros for putting in my tool belt...

Quote:
Originally Posted by Mathias View Post
You may want to search the FAQ for "macro"
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.
ShadowChemosh is offline   #8 Reply With Quote
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old May 29th, 2012, 04:14 PM
Added Kick and one or two handed mods to firearms to the Modern Path
Frodie is offline   #9 Reply With Quote
Reply

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 03:09 AM.


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