Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   weapons in off hand (not) setting gIsEquip field (http://forums.wolflair.com/showthread.php?t=55085)

CNYGamer February 20th, 2016 10:01 AM

weapons in off hand (not) setting gIsEquip field
 
Hi all.

I haven't been following these forums as closely as I probably should be, so I apologize if this has been asked and answered.

Is it a known bug (or is it even a bug at all) that weapons equipped in the off hand don't set a value to the gIsEquip field?

If it so happens that this is intended behavior and not, in fact, a bug, what is the normal way to get at an indicator that a weapon is equipped in the off hand?

Colen February 20th, 2016 10:07 AM

For weapons in the off-hand, you should be able to look at the wIs2nd field - gIsEquip only gets set if the weapon uses your *main* hand (i.e. if it's a one-hand weapon in your main hand, or a two-handed weapon).

CNYGamer February 21st, 2016 05:48 AM

Colen, thank you for the response.

I am trying to make the dual wielder feat that was posted here work a little bit better.

If I may, I have a few questions.

(1).
Is there a way to get at what's in a hero's hands directly rather than iterating through the entire list of weapons in the character's inventory? I see that if a weapon is equipped in a hero's main hand, it has the tag Hero.MainHand, and the same for the off hand with Hero.OffHand.

I was trying to find a syntax where I could basically say:

Quote:

if (the weapon currently in the hero's main hand is !wProperty.TwoHanded and wCategory.Melee)
(2).
Can you combine expressions with logical operators for if-blocks with this scripting language? I altered the dual wielder feat as follows:

Quote:

~exit if disabled
doneif (tagis[Helper.Disable] <> 0)

~exit if fewer than two weapons are equipped
~keeps feat from triggering if a one-handed weapon
~is equipped in both hands
doneif (hero.tagcount[Hero.EquipWep] < 2)

~counter variable
field[abValue].value = 0

~add up total number of weapons in character's inventory
~that are equipped in the main hand and the off hand
foreach pick in hero from BaseWep where "(wCategory.Melee)"
if (eachpick.field[gIsEquip].value = 1) then
field[abValue].value += 1
endif
if (eachpick.field[wIs2nd].value = 1)then
field[abValue].value += 1
endif
nexteach

~exit if there isn't a weapon in both the main hand
~and the off hand
doneif (field[abValue].value < 2)

~add 1 to armor class
hero.childfound[ArmorClass].field[Bonus].value += 1
But the presence of two if-blocks feels awkward to me. I wanted to combine the conditions with something like this:

Quote:

if (eachpick.field[gIsEquip].value = 1 or eachpick.field[wIs2nd].value = 1)
I tried nesting each condition in its own parentheses. I tried 'or' and '||'. Is there a syntax to make this happen?

(3).
The way I have the feat listed above, putting a non-light weapon in each hand will trigger a validation error. The OP of the dual wielder feat solved this by manually attaching the wProperty.Light tag to the weapon, but admitted it was an inelegant solution. In addition to being an inelegant solution, it also has the potential to cause issues outside of the feat that are intended to trigger on weapons based on the presence or absence of the wProperty.Light tag. Is there a more "proper" way to solve this problem?

Thank you very much for any help.

Jamie (CNYGamer)

Aaron February 21st, 2016 08:04 AM

1 - Not well. You could use a findchild to find one weapon which met the criteria of "in the off hand" if that Hero tag was present, but that runs the risk of not altering other off hand weapons in the case that the race has many arms. I think a foreach is still your best bet here.

2 - Instead of two different conditional statements, you could combine them into one statement with two branches, like so:

Code:

  if (eachpick.field[gIsEquip].value <> 0) then
    field[abValue].value += 1
  elseif (eachpick.field[wIs2nd].value <> 0)then
    field[abValue].value += 1
    endif

But, how I would prefer to handle it would be to add the field checks to the tag expression for the foreach, like so:

Code:

  foreach pick in hero from BaseWep where "(wCategory.Melee) & (fieldval:gIsEquip <> 0 | fieldval:wIs2nd <> 0)"
    field[abValue].value += 1
    nexteach

3 - What's the validation error?

CNYGamer February 21st, 2016 08:51 AM

Quote:

Originally Posted by Aaron (Post 224584)
3 - What's the validation error?

Per the 5e rules, you can't equip a non-light weapon in your off-hand for two-weapon fighting. So if you do so in Hero Lab, you get the red diamond in the upper right corner with the exclamation point to indicate your character is not built according to the rules.

The way the script I linked to addresses the problem is to manually assign the wProperty.Light tag to a weapon that is not actually a light weapon.

ShadowChemosh February 21st, 2016 09:04 AM

Quote:

Originally Posted by Aaron (Post 224584)
3 - What's the validation error?

"Only light weapons can be equipped in the off-hand".

5e has the tag "Hero.OffLight" that is assigned to the hero container when two weapons are equipped. Sense this tag does not exist in Pathfinder I assumed it was added to cause the check for the "Light Off-hand" weapons. But removing the tag does not seem to be making a difference is preventing/suppressing the error message.

Should the component validation script be only firing when this "Hero.OffLight" tag is present? I can't tell if this is a bug or I am assuming incorrectly what this tag does. Any insight would be appreciated. :)

Aaron February 21st, 2016 09:18 AM

Have your script assign Helper.TwoWpLight instead of wProperty.Light. Won't work now, but I have altered the scripts for that validation error so that it should work after the next release.


All times are GMT -8. The time now is 01:45 PM.

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