• 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 Pre-req by Ethnicity

djc664

Well-known member
So I'm trying to noodle out how to get HL to throw a character validation error if I choose a custom bonus feet without having a particular Ethnicity.

I made a Racial Cust Special of Thassilonian (rcThassilo).

I then made the custom feat, marked it as a bonus feat for 6th level monks and added the following Expr-Reqs line:

#hasability[rcThassilo] <> 0

I've also tried the following in the pre-reqs code section:

@valid = 0
~ Check to see if we're the right Ethnicity
validif (#hasability[rcThassilo] <> 0)

And I've tried having both and each separately... no difference.

Am I missing something?
 
What I would do is check the Tags that are at the HERO level to see what gets added when you have a race with and without your new racial special.

As #hasability macro I am pretty sure is looking for the wrong tag for a Racial Special as its made to look for a class special. So once you have found the correct tag on the hero you can simply check for that specific tag using hero.tagis[] logic.
 
Both of those should work. Is there anything else going on that could be masking things somehow?

Double-check your spelling. I know I've made errors like making the Id of the ethnicity rcThassllo, and then spelling it correctly on the prereqs.
 
What I would do is check the Tags that are at the HERO level to see what gets added when you have a race with and without your new racial special.

As #hasability macro I am pretty sure is looking for the wrong tag for a Racial Special as its made to look for a class special. So once you have found the correct tag on the hero you can simply check for that specific tag using hero.tagis[] logic.

Actually, everything with the Ability component will work with the #hasability[] mechanism - all the types of class specials, all the types of racial specials, feats, traits, favored class options, etc.
 
Both of those should work. Is there anything else going on that could be masking things somehow?

Double-check your spelling. I know I've made errors like making the Id of the ethnicity rcThassllo, and then spelling it correctly on the prereqs.

There could be, to be honest. I'm not 100% on reading into what happens when and what might interfere. Do you mean looking at the timing report or something...?


I hear you loud and clear on the spelling. Since I don't have a lot of variables or names I'm making, I keep all of them in a text file for copy-clipping. Ironically, my first problem was when I used HasAbility instead of hasability... the system bucked when I used Camel Case.
 
There could be, to be honest. I'm not 100% on reading into what happens when and what might interfere. Do you mean looking at the timing report or something...?


Do you have any other prereqs on the thing you're working with? Are they failing, making the ability greyed out - but it's one of them, rather than the #hasability[] you're trying to get working that's actually causing the problem?

Have you tried different ways to create the Thassilonian ethnicity, and deleted ones that didn't work out? After deleting them from the file, did you reload the Pathfinder files (ctrl-r)? If not, it's possible that the copy of Thassilonian you're running your tests with isn't the copy you intended to use.

I hear you loud and clear on the spelling. Since I don't have a lot of variables or names I'm making, I keep all of them in a text file for copy-clipping. Ironically, my first problem was when I used HasAbility instead of hasability... the system bucked when I used Camel Case.

Have you tried the Find Thing option that's available in scripts and pre-reqs/expr-reqs? That's designed to help you track down the Ids of things.
 
Do you have any other prereqs on the thing you're working with? Are they failing, making the ability greyed out - but it's one of them, rather than the #hasability[] you're trying to get working that's actually causing the problem?.

No, that's the only pre-req I had. As you are eluding to, when I am troubleshooting, I try and isolate the variables in any system. There are no competing pre-reqs from my content.

Have you tried different ways to create the Thassilonian ethnicity, and deleted ones that didn't work out? After deleting them from the file, did you reload the Pathfinder files (ctrl-r)? If not, it's possible that the copy of Thassilonian you're running your tests with isn't the copy you intended to use..

I reload after every test, especially deletion and scripts... that also helps me know if I got coding wrong. :)

Have you tried the Find Thing option that's available in scripts and pre-reqs/expr-reqs? That's designed to help you track down the Ids of things.

Yes, I found my thing using that option and the Data file debugging "copy unique ID to clipboard" when I right click on the Ethnicity.

Upon further review, the problem seems to be related to the fact that it was being added as a Bonus Feat on the monk tab and not the regular feat tab. When I add it as a regular feat, it throws the correct errors.

I guess Bonus feats ignore pre-reqs? I wasn't aware that was the case, if it is.
 
Well, then that solves the mystery. Chalk another win up for knowing the rules.

I'm just glad it wasn't my coding... that was the first pre-req I've ever tried to code. Thank you both for walking me through the trouble-shooting steps. That helped a lot for figuring out some other parts of the module converts I have to do.

While we're here... Mathias mentioned that both pre-req codes would work, which leads me to wonder if that is the case... which one is best or preferred?Is there room for improvement for the code I came up with?
 
If only one line is needed in order to write a prereq, I prefer to put it in an exprreq, since there, you don't need to type "validif (" - so it's just a touch faster to type as an exprreq).

(the design goal of Expr-Reqs was to simplify the addition of those prereqs that are only asking one question)

For your pre-req, the @valid = 0 line is unneeded - actually, Hero Lab will add that line to the beginning of all pre-reqs for you when the files are compiled.
 
Back
Top