• 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

Weapon Class Question

I've been searching through these forums looking for a way to make the adjustment for a custom feat I have been working on for PF1 in HeroLab Classic. I've found a few ideas, but nothing quite seems to work out.

For the feat, when it is activated in the "In Play" tab, I want to add a +1 to hit with light or one-handed melee weapons.

The functionality of checking if the ability is activated on the In Play tab is working

if (field[abilActive].value <> 0) then

end if

The following code inserted in the above If-Then statement adds a bonus to all melee weapon attack rolls, including two-handed weapons:

hero.child[Attack].field[atmBonus].value += field[abValue].value

Then I tried using

if (container.tagis[wClass.Light] <> 0) then
foreach pick in hero from BaseWep
eachpick.field[wAttMelee].value += field[abValue].value
nexteach
endif

But that doesn't seem to be cutting it. I'm sure it's something simple that I'm missing.

Any suggestions?

Thank you.
 
Try this:

Code:
if (field[abilActive].value <> 0) then
	foreach pick in hero from BaseWep where "wClass.Light"
		eachpick.field[wAttMelee].value += field[abValue].value
	nexteach
end if

You can feed the foreach itself a tag expression this way and it will only do its thing on picks that match.
 
Back
Top