• 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

False positive for "thing" in pick-req?

Paragon

Well-known member
Okay, in my slow work on cleaning up the 4e file, one of the items I hit was a "armor" proficiency for an item called a Barbed Shield. Its pre-req was supposed to be proficiency in Heavy Shield. The feat was listed incorrectly as an armor, rather than shield proficiency, but that was just a nomenclature error and easily fixed.

However, when I entered the proper id in the pick-req, (and it was a proper one, since the Editor accepted it), it still doesn't prevent the feat from being picked; I double checked to make sure that the character involved didn't have that proficiency, and they don't.

Can anyone else see why this wouldn't be working as intended? I've used pick-reqs a million times, and while I've had them not be accepted for any number of reasons, this is the first time I've seen one be accepted but not work.

Code:
thing id="ftShieBa" name="Shield Proficiency: Barbed Shield" description="{b}Benefit{/b}: You gain proficiency with barbed shields." compset="Feat" uniqueness="useronce">
    <fieldval field="reqText" value="Proficiency with heavy shields"/>
    <usesource source="MordensEmp" parent="Supplement" name="Mordenkainen&apos;s Magnificent Emporium"/>
    <tag group="Hide" tag="Special" name="Special" abbrev="Special"/>
    <tag group="Tier" tag="Heroic" name="Heroic Tier" abbrev="Heroic Tier"/>
    <eval phase="Setup" priority="5000">perform hero.assign[ArmorProf.apShieldBr]
      <before name="Armor type proficiencies"/>
      </eval>
    <pickreq thing="apShieldHv"/>
    <prereq message="Already proficient with this armor.">
      <validate><![CDATA[
        validif (@ispick <> 0)
        @valid = !hero.tagis[ArmorProf.apShieldBr]]]></validate>
      </prereq>
    </thing>
 
Code:
        validif (@ispick <> 0)
        @valid = !hero.tagis[ArmorProf.apShieldBr]
So this is saying we only "check" if we are Thing and not been selected/added to a character. Once added the validif (@ispick <> 0) statement will become true always and it will exit the script.

Then next line of code is very strange as I didn't even know HL could deal with "not" logic. So "@valid = !hero.tagis[ArmorProf.apShieldBr]" is actually saying if we do NOT find the tag ArmorProf.apShieldBr on the Hero then we are valid.

Do you maybe mean to say you are valid when that tag is found? I am not 100% following what the validation is suppose to be from your post. :(
 
validif (hero.tagis[ArmorProf.apShieldBr] = 0)

is my recommendation, if you're looking for a prereq of "we don't have this tag"
 
That part is just supposed to yield a negative if the character already has the proficiency I'd guess (it was already in the code when I got it). It was the pickreq that doesn't seem to be working and I couldn't figure out why. Is the piece you guys are talking about likely to be breaking that (because they seem to have used it as a component in almost all the armor and shield proficiencies)?
 
Paragon - just for your information, in my own code, I have not used a pickreq in the last 4 years or so. I just do not find them useful for any real coding.

Take a look at the hero tags that get added when that particular pick is present and active on the character. I'd recommend using an exprreq based on those tags, not a pickreq based on the pick itself.
 
Well, to describe what I do as "real coding" is probably a vast overstatement; to be honest, my understanding of how to construct a proper exprreq is, charitably, somewhat limited. I'm occasionally able to kitbash together other people's code chunks usefully, but that's about it.
 
On the other hand, I just realized this particular kind of exprreq I'd actually used before, so I went back over it and, sure enough, that worked fine. Odd.
 
Back
Top