View Single Post
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old November 30th, 2015, 07:17 PM
Quote:
Originally Posted by stuartwaring View Post
I was using a foreach loop, but that didnt work either, hence my attempt to change it to this. I could try and reinstate the foreach loop, but would I be searching in BaseWep for the Foe-Biting tag?
Yep. All weapons are part of the Component BaseWep. Foe-Biting sets an ability tag on the weapon as "HasAbility.laFoeBite" which can be searched for. I found this tag by adding a Foe-Biter weapon to a character and right clicking on the "?" and selecting "Show Debug Tags". Then in the search section I simply typed in "Foe-Biter" to see what I saw.

So taking the foreach loop from VS feat.
Code:
      ~ Loop through all weapons on the hero except Touch Attacks
      ~ and any Ammunition.
      foreach pick in hero from BaseWep where "!(thingid.wRay|wCategory.Ammunition|thingid.wTouch|wCategory.AmmoCart)"
      nexteach
We can see or read the comments that its going to find every weapon on the hero except touch attacks or ammunition.

We need to add logic so that we only find weapons that have the Foe-Biter ability:
Code:
      ~ Loop through all weapons that have Foe-Biter ability
      foreach pick in hero from BaseWep where "HasAbility.laFoeBite"
      nexteach
Then you can change your logic to not use hero.child[iMagWeapon] and instead use "eachpick". Eachpick represent the current weapon that the foreach loop is processing.

This should cause your logic to now run on any Foe-Biter weapon on your character.

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   #11 Reply With Quote