View Single Post
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old June 21st, 2011, 01:20 PM
Quote:
Originally Posted by 12hourhalfday View Post
We actually want armor rating to stack with damage reduction. Does that mean we can just remove the last line?
Code:
    hero.child[xDamRd].field[abValue].value = maximum(hero.child[xDamRd].field[abValue].value, field[abValue].value)
Not exactly. If you want to stack or ADD then instead of a doing a equal you want to say ADD to what ever DR already exists. So change it to be:
Code:
hero.child[xDamRd].field[abValue].value += field[abValue].value
~ Above is a short hand way of doing the following:
hero.child[xDamRd].field[abValue].value = hero.child[xDamRd].field[abValue].value + field[abValue].valuefield[abValue].value
~ Both the lines above do the exact same thing one is just shorter to write.
~ P.S. anything with a squiggly line in front is a comment in HL.
So now we are saying take the existing Value of Thing.xDamRd and add in the field[abValue].value Value which in this case is 2.

You may need to change the timing of this script to be just before when xDamRd does its calculations as all other DR scripts are set to not stack.

So to find the timing of xDamRd you will need to go to the Ability tab in the editor and do a New (Copy). Then find xDamRd in the list and double click on it. Then click on the Eval Script on the top right corner and see when its Phase/Timing is and go just before it.

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   #4 Reply With Quote