Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
12hourhalfday
Junior Member
 
Join Date: Jun 2011
Location: Hemet, Ca
Posts: 21
Send a message via AIM to 12hourhalfday

Old June 20th, 2011, 07:19 PM
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.
12hourhalfday is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,701

Old June 20th, 2011, 10:15 PM
Code:
doneif (tagis[Helper.ShowSpec] = 0)
You want something like this as I expect you only want to apply the 2/- when the armor is equipped not when it is just on the character. So to find the correct field add a suit of armor to a character and then Right click on the "?" to get a list of choices. Take the one called something like "Show Debug Fields...".

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
xCount only exists on Classes so you want replace the whole field[xCount].value with the amount of DR to provide. By setting the field[abValue].value variable instead of hard-coding just a 2 it leaves you room for outside Things (ie a feat) to affect the amount of DR this armor provides without a script change.

Code:
      field[CustDesc].text = "Damage Reduction (" & field[abValue].value & ") against weapons and natural attacks."
This is just custom text and you won't have need of this.

Code:
      hero.child[xDamRd].field[abValue].value = maximum(hero.child[xDamRd].field[abValue].value, field[abValue].value)
This is very important part here. This says to give a value to the Thing xDamRd (Damage Reduction /-). After the equal it says take either the value of DR that already exists or the value this armor is providing and make our DR that. As normally DR does not stack. So if a character already has 1/- DR and the armor provides 3/- DR you will get a maximum of 3/- not 4/-.

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.
ShadowChemosh is offline   #2 Reply With Quote
12hourhalfday
Junior Member
 
Join Date: Jun 2011
Location: Hemet, Ca
Posts: 21
Send a message via AIM to 12hourhalfday

Old June 20th, 2011, 11:40 PM
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)
12hourhalfday is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,701

Old June 21st, 2011, 02: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
12hourhalfday
Junior Member
 
Join Date: Jun 2011
Location: Hemet, Ca
Posts: 21
Send a message via AIM to 12hourhalfday

Old June 21st, 2011, 03:38 PM
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!
12hourhalfday is offline   #5 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 11:37 AM.


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