• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

A weapon has an AC penalty when equipped 1-handed

Mathias

Moderator
Staff member
This is a response to a question posted in the Hero Lab Discussion forum - moved here since it's Pathfinder specific.

ok, let's start with something that i think will be simple.

i have a weapon that i want create, and the only problem i'm having is that when you wield the weapon 1 handed you take a -1 penalty to AC.

how do i implement this in the editor so it applies the penalty?

thanks for the help.

Okay, you've entered the basics of the weapon in the editor - so it has a damage, weapon type, etc. Go ahead and buy a copy of the weapon on a blank character (maybe add a level of fighter if you don't want to see the non-proficiency marker).

In the develop menu at the top of the program, make sure that the first item "Enable Data File Debugging" is checked, then right-click on the weapon, and select "Show debug tags for XXX" and right click again, selecting "Show debug fields for XXX".

Expand those windows to see as much as possible, and then try equipping your weapon in the main hand, in the off hand, in both hands, in no hands - watch how the tags and fields change as that happens.

You'll find that if the weapon is equipped in the main hand, the field wIsEquip = 1, and wIs2nd = 1 if it's equipped in the off hand. There are some other fields that change, and some tags that change, but we'll go with these.

So, since each of those fields will equal 1 if that hand is used, and 0 if it isn't, you want to know if exactly one hand is being used to hold the weapon. So, add the two fields together:

Code:
if (field[wIsEquip].value + field[wIs2nd].value = 1) then

Now, going on to AC. In the editor, select the help menu at the top, and then scroll down to "Reference Information", and find Armor Class in there.

hero.child[ArmorClass].field[Penalty].value is a generic penalty. If this item inflicts a circumstance penalty or some other specific penalty, you'll find the instructions for using those in the same "Reference Information" page.

Timing: Post-Attributes phase, any priority should work
Code:
if (field[wIsEquip].value + field[wIs2nd].value = 1) then
  hero.child[ArmorClass].field[Penalty].value -= 1
  endif

Put that into a script on the weapon, then press "Test Now!" at the top right of the editor, and go back to your character. Now try out various ways of equipping the weapon, watching the character's AC, and make sure it works as expected.
 
Ok, i'm starting to get this i think thanks for the help.

it didn't work at first but then i noticed that wIsEquip wasn't the one effected by the main hand it was gIsEquip. the only thing i could think of as a reason why was that it's an exotic weapon which i probably should have mentioned.

i'm gonna try my hand at some more stuff, but i'm fairly sure i'll be back with more questions.
 
Whoops - my mistake. I didn't look closely enough at the names as I was writing them down.

gIsEquip starts with a "g" since it applies to gear - on a magic item or armor, since it can only be worn one way, it's whether that item is equipped or not. Since weapons can be equipped in the main hand, off hand, or both, they also have the wIs2nd field for the off-hand.
 
Back
Top