Junior Member
|
I am trying to create custom armors that apply half armor bonus and half damage reduction. For example, the first one I am creating is a chain shirt that applies an armor bonus of 2 and a damage reduction of 2.
In the editor I have already copied the chain shirt and labeled it AR- Chain shirt, where AR stands for armor rating (what we are calling damage reduction applied by armor) and have applied it's own unique ID. I have also reduced the armor bonus of the armor to 2. Where I hit a snag is where I am applying the damage reduction to the armor, I have copied the eval script from the barbarian damage reduction ability to the eval script of my armor but what I am not sure about is which phase to apply it in (currently I have it applied in post-levels, like the barbarian class has) and which value to change to make it a static damage reduction of 2. Below is the script I am working with. What do I need to remove and/or change to make it a bare minimum to apply a damage reduction of 2/- to the wearer and display the damage reduction in the special tab and in the correct place in the stat block. doneif (tagis[Helper.ShowSpec] = 0) field[abValue].value += field[xCount].value field[CustDesc].text = "Damage Reduction (" & field[abValue].value & ") against weapons and natural attacks." hero.child[xDamRd].field[abValue].value = maximum(hero.child[xDamRd].field[abValue].value, field[abValue].value) I know this can be done since the guys at Paizocon showed me this in action but I know I am missing something, Any help would be greatly appreciated. |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Code:
doneif (tagis[Helper.ShowSpec] = 0) If you don't see that you have to go to the develop menu, make sure the first option, "Enable Data File Debugging" is checked. This way you can start seeing the name of the fields on Things and their values. Really helpful. Plus this lets you do a Ctrl-R which does a quick reload of the data set. Also very helpful when making changes. Once you have done that you can equip/un-equip the armor to figure out the field you want to check. Code:
field[abValue].value += field[xCount].value Code:
field[CustDesc].text = "Damage Reduction (" & field[abValue].value & ") against weapons and natural attacks." Code:
hero.child[xDamRd].field[abValue].value = maximum(hero.child[xDamRd].field[abValue].value, field[abValue].value) For timing you should be good First 10,000 or later. 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. |
#2 |
Junior Member
|
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) |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
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. 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. |
|
#4 |
Junior Member
|
Gosh, that is an amazing amount of help!
I will give it a shot and let you know what I come up with. The hard part for me is figruing out how to populate the field. I will keep playing with it and thanks again! |
#5 |
|
|