• 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

Feat Prerequisite

blzbob

Well-known member
Is there an easy way to require at least 3 martial weapons as a feat prerequisite? I can add every martial weapon individually I'm sure but I was hoping that there would be an easier way.
 
I would look at two feats. First, if the character has the Martial Weapon Proficiency - All (fWepMart) then that would fulfill the requirement. The other is the Martial Weapon Proficiency for individual weapons (fMartial). A check to see if this feat exists at least 3 times should suffice.

Off the top of my head, I think that would look like this:

Code:
#hasfeat[fDodge] >= 3
 
So I tried:

#hasfeat[fMartial] >=3

which is still saying that I need to be proficient in 3 martial weapons even when I have chosen 4.

I also tried

#hasfeat[fWepMart] <> 0 + #hasfeat[fMartial] >=3

But the left side wouldn't compile. I copied that side directly from Taldan Knight.
 
Sorry. I forgot that #hasfeat doesn't count the number of times its taken, only whether it is or not. In the pre-reqs, try this:

Code:
validif (hero.tagcount[HasFeat.fMartial] >= 3)
validif (#hasfeat[fWepMart] <> 0)

This will validate the feat to be taken if either of the validif statements reads as true. You'll notice the hero.tagcount is used to count the number of times a feat is taken.
 
Now I'm getting:

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'pre-requisite rule' script for Thing 'fSpiritArs' on line 1
-> Reference to undeclared variable: 'validif'
Syntax error in 'pre-requisite rule' script for Thing 'fSpiritArs' on line 1
-> Reference to undeclared variable: 'validif'
 
I've moved it to Pre-Reqs and now I'm getting:

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'pre-requisite rule' script for Thing 'fSpiritArs' on line 1
-> Invalid syntax for tag template

This is what I'm using:

validif (hero.tagcount[#HasFeat.fMartial] >= 3)
validif (#hasfeat[fWepMart] <> 0)
 
Remove the # sign from the first line. As you can see with the code I pasted above its not necessary.
 
Thanks! I think I've typed that # so many times I must have done it unconsciously.

That solved almost everything. The only issues now are that it doesn't account for a cleric's proficiency or a race's proficiency. How would I account for them? An elf that worships Grundinnar starts with longsword, longbow, and warhammer and should automatically qualify but does not.
 
It's not an easy way, but you could pull the WepProf tags from the race and deity. However, note that this is likely to change when we next release, as I'm making some changes where I will be moving proficiencies for the core races from tags on the race to tags on the weapon familiarity racial special. This is to facilitate Alternate Racial Traits for the upcoming Advanced Race Guide which replace the racial weapon proficiencies and whatnot.

All that said, you could then use those pulled tags to generate a string to use for a tag expression, and then use a "foreach thing" to cycle through matching weapons. If that particular weapon is martial, then add +1 to your number of martial weapons known variable.

Does that make sense or would I need to go into a bit more detail?
 
All that said, you could then use those pulled tags to generate a string to use for a tag expression, and then use a "foreach thing" to cycle through matching weapons.
Just a question as I am still a little confused on picks and things. But I think you mean to say "foreach pick" not thing as from what I seen I thoughts picks can be accessed without being on the hero right? This way you can test to see if the weapon is martial even without it being a Thing on the hero.

Than again could be totally wrong. :p
 
A "thing" is any object defined in the program. Once a "thing" has been added to the hero, it becomes a "pick".

In this case, the deity and race are both on the hero, so they are picks from which the user pulls the weapon proficiency tags. These weapon proficiency tags however, don't carry the info that the user needs (namely whether that weapon is martial or not). For that we need to check on the weapons themselves, but we can't rely on the user having added every one of those (making them picks) to his character. That's why we do a "foreach thing", to cycle through what is defined in the program but may not be on the hero.

At least, I think that'd work. I haven't tested it out myself, so I may be completely wrong.
 
foreach pick can only find those items that are picks - that are on the character.

foreach thing can find all potential items of that type, but its results are read-only.

I'm pretty sure Aaron did mean foreach thing, because if you used foreach pick, you'd need to have purchased three different martial weapons you are proficient in in order to fulfill the requirements of the ability. foreach thing can check ALL the weapons you're proficient in in order to count the number that are martial.
 
foreach pick can only find those items that are picks - that are on the character.

foreach thing can find all potential items of that type, but its results are read-only.

I'm pretty sure Aaron did mean foreach thing, because if you used foreach pick, you'd need to have purchased three different martial weapons you are proficient in in order to fulfill the requirements of the ability. foreach thing can check ALL the weapons you're proficient in in order to count the number that are martial.
Cool thanks. I think I had it backwards in my head still. I always have to look at a pair of scripts to remember which is which. I knew one only finds what is on the Hero and one finds stuff even if not on the hero.

Going to add that to my notes also as its a nice clear answer... :)
 
I'm not really sure how I would go about doing that but to make sure I understand, it's not currently feasible to just have it check the races and classes to see if there are martial weapon proficiencies. If I had it check the characters for weapons they have in their inventory, they would lose access to the feat if they lost or sold an item, correct?

I think I may just make a notation that the user should take Martial Weapon Proficiency for the appropriate weapons and just use the Adjustments tab to add the appropriate number of extra feats.

If I'm wrong, which is entirely possible, can someone show me how to write that script? That is beyond my skill level.
 
Last edited:
So ran into the same issue for some SGG feats. So the next SGG community release will have two new procedures designed to be called from "Pre-reqs". These will be stored in "PFRPG_SGG_Procedures.user" so remember without this file in your data folder the below won't work.

Relating to this thread is one that will count the number of martial weapons proficiencies that the hero has. Thanks Aaron for the info on how to build this. Though converting to a Procedure was allot harder than I thought it was going to be. :(

The second procedure is made to check to see if a character has the ability to cast a specific spell. Well it checks to see if the spell is on the characters spell list actually.

To use the Count Martial Weapon procedure do the following in a "Pre-Reqs" script.
Code:
~ If we have all martial weapons then valid
validif (#hasfeat[fWepMart] <> 0)

var CntMartWea as number
Call CntMartWea
~ If we have 3 martial weapons than valid else not valid
if (CntMartWea >= 3) then
   @valid = 1
else
   @valid = 0
endif

To use "Have Spell" to see if a character has Spiritual Weapon do the following:
Code:
~ We need to test for both the 2nd level and 3rd level versions of the spell
~ set parms for Call
var HaveSpell as number
var SpellID as string
~ Set the Spell ID(s) we are to test for
SpellID = "spSpirWea2|spSpirWea3"
Call HaveSpell
~ set if we found the spell(s) or not
@valid = HaveSpell
If you wanted to test for Fireball:
Code:
~ set parms for Call
var HaveSpell as number
var SpellID as string
~ Set the Spell ID we are to test for
SpellID = "spFirebal3"
Call HaveSpell
~ Set the Pre-Req valid flag
@valid = HaveSpell
 
Thanks Shadow! So when do you think I'll be able to download the PFRPG_SGG_Procedures.user file? I've gone and bought a few more things from SSG.
 
Thanks Shadow! So when do you think I'll be able to download the PFRPG_SGG_Procedures.user file? I've gone and bought a few more things from SSG.
The next release is weeks away. Any editor that has access to dropbox can grab it now out of "Pathfinder\SGG\v1.3\ShadowChemosh" folder.

Hmm looks like your not in their blzbob so I can send you the current copy of it so you can make use of it now for building SGG stuff.
 
Back
Top