Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD

Notices

Reply
 
Thread Tools Display Modes
CNYGamer
Member
 
Join Date: Aug 2009
Location: Finger Lakes Region, New York
Posts: 59

Old February 20th, 2016, 11:01 AM
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?
CNYGamer is offline   #1 Reply With Quote
Colen
Senior Member
Lone Wolf Staff
 
Join Date: Dec 2008
Posts: 4,690

Old February 20th, 2016, 11: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).
Colen is offline   #2 Reply With Quote
CNYGamer
Member
 
Join Date: Aug 2009
Location: Finger Lakes Region, New York
Posts: 59

Old February 21st, 2016, 06: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)
CNYGamer is offline   #3 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old February 21st, 2016, 09: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?
Aaron is offline   #4 Reply With Quote
CNYGamer
Member
 
Join Date: Aug 2009
Location: Finger Lakes Region, New York
Posts: 59

Old February 21st, 2016, 09:51 AM
Quote:
Originally Posted by Aaron View Post
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.
CNYGamer is offline   #5 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old February 21st, 2016, 10:04 AM
Quote:
Originally Posted by Aaron View Post
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.

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   #6 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old February 21st, 2016, 10: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.
Aaron is offline   #7 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:42 AM.


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