• 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

Checking feats

AndrewD2

Well-known member
I'm working on a feat that has a requirement of (roughly) "1 feat from this category that causes damage".

Do I need to go through at do a #hasfeat check for all the feats that meet that requirement, or can I do something like assign a tag to all those feats and then check for that tag in the prereq?

Thanks,

Andrew
 
You could do it either way. The custom tag option seems more elegant to me.

If you decide to go with a custom "Causes Damage" tag on the feats, you'll either have to have the feat forward that tag to the hero, and have the pre-req check there. OR the pre-req will have to foreach through all the feats on the hero of this category, looking for one with the tag.
 
Ok, I think I'll go with the foreach route. I think that'll save a lot of scripting on all the other feats. But I'm honestly not sure of the syntax for the foreach loops. If I named it Custom.KiDamage it would be something like:

foreach pick in hero from feat where "Custom.KiDamage"
@valid = 1
nexteach
 
Capitalization's important.

Code:
foreach pick in hero from Base[B]F[/B]eat where "Custom.KiDamage"
  @valid = 1
  nexteach
 
Foreach loops have several parts to them

foreach PICK/THING/BOOTSTRAP in HERO/CONTAINER/GIZMO from SOMECOMPONENT where "TAG EXPRESSION" sortas SOMESORTSET

Only the first 2 parts are strictly necessary, but the more specific you can be, the less computational power you'll waste. I'd say always at least limit it to a particular component.

To see what components are on a particular type of pick, Enable Data File Debugging, add something of that type, and right click "Show Debug Tags for..." There are usually several "component" tags lumped together, and by looking at those you can see that all feats have the BaseFeat component, while the Feat component doesn't exist.
 
Back
Top