• 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 : Get a class that does not get same prerequesite that another class

peterphonic

Active member
Hello,

I started to create my custom feats yesterday. pre-req bootstraps are really easy to use for basic prerequesites. But I have a case a little bit more complicated. I guess I should use pre-req eval script, but I don`t know how :(

So:

Feat : Ironbark
Prerequesite : constitution 15, DR/Slashing
Special : Hunter with natural weapon proficiency and monk does not need these prerequisites.

Is it something possible? Is there an example somewhere?

Thx
 
You're going to have to create a prereq script instead of using an Expr-req. You'll have to create 2.

Code:
validif (#attrvalue[aCON] >= 15)
validif (#levelcount[Monk] >= 1)
if (#levelcount[Hunter] >= 1) then
  if (check for natural weapon proficieny) then
    @valid = 1
     endif
   endif

I couldn't find anyting called natural weapon proficiency so I couldn't do it exactly, you'll have to do the check for that.
 
Thx for the answer. I am playing aroud this since an hour, and I don't totally understand what I am doing. I have following questions;

  1. The way pre-reqs work, is it that the first true statement found returned true for the whole thing? It goes over all validif and stop to the first one that returns true?
  2. How to do an operational & between two validif? I want to do something like this :
    Code:
    validif ((#attrvalue[aCON] >= 15) & (#hasability[xDamRdS] <> 0) &(#hasrace[rKaiyigiss] <> 0))
    validif (#levelcount[Monk] >= 1)
    (kaiyigiss is a custom race that i've created...)

Thx for your time!
 
Thx for the answer. I am playing aroud this since an hour, and I don't totally understand what I am doing. I have following questions;

  1. The way pre-reqs work, is it that the first true statement found returned true for the whole thing? It goes over all validif and stop to the first one that returns true?
  2. How to do an operational & between two validif? I want to do something like this :
    Code:
    validif ((#attrvalue[aCON] >= 15) & (#hasability[xDamRdS] <> 0) &(#hasrace[rKaiyigiss] <> 0))
    validif (#levelcount[Monk] >= 1)
    (kaiyigiss is a custom race that i've created...)

Thx for your time!
& and Or logic is not really in the scripting logic directly.

For a "OR" logic of if any of the things make it valid you can combine somethings together. Mostly tests that return 1 or 0.
Code:
validif (#hasability[xDamRdS]  + #hasrace[rKaiyigiss] <> 0)
Would be if you have Damage Reduction Silver or race rKaiygiss. Though all characters have Damage Reduction pick so you really need to test for a value greater than 0.

So in this case its an example of "or" logic:
Code:
validif (#attrvalue[aCON] >= 15)
validif (#value[xDamRdS] <> 0) 
validif (#hasrace[rKaiyigiss] <> 0)

If you wanted to a do an "and" condition you would have to go this way:
Code:
~ assume not valid unless we meet all three conditions
@valid = 0

~ Test all three conditions are valid
if (#attrvalue[aCON] >= 15) then
  if (#value[xDamRdS] <> 0)  then
    if (#hasrace[rKaiyigiss] <> 0) then
       @valid = 1
    endif
  endif
endif

Fields with "@" symbol are system variables. In this case @valid sets if the pre-req is valid or not (1 = TRUE; 0 = FALSE)
 
I believe you could to an AND check mathematically as follows, avoiding the nested if's:
Code:
validif ((#attrvalue[aCON] >= 15) + (#hasability[xDamRdS] <> 0) (#hasrace[rKaiyigiss] <> 0) == 3)
 
I believe you could to an AND check mathematically as follows, avoiding the nested if's:
Code:
validif ((#attrvalue[aCON] >= 15) + (#hasability[xDamRdS] <> 0) (#hasrace[rKaiyigiss] <> 0) == 3)
Unfortunately great idea but it won't work. :(

The above would work in many "high level" languages but not in HL script. The above assumes that HL has a way to deal with real boolean value so that (#attrvalue[aCON] >= 15) would return TRUE (1) or FALSE (0). Which it won't do.

So the reason that this works:
Code:
#hasability[xDamRdS] + #hasrace[rKaiyigiss] <> 0
is that all HL is doing is simple math. The #has macros happen to be returning 1 or 0 as a real number not a boolean. So really HL is just doing the basic math of 1 + 0 <> 0 logic which it can do.

Because #attrvalue[] can return a value from 0 to 99 it forces us to use the multiple "validif" statements.
 
Also, if your looking for a group of tags in the same context, you can use tagexpr. So for example:

#hasability[xDamRdS]

is really

hero.tagis[HasAbility.xDamRdS]

and

#hasrace[rKaiyigiss]

is

hero.tagis[Race.rKaiyigiss]

So since they are both looking in the hero context you could do this instead of adding them together:

validif (hero.tagexpr[HasAbility.xDamRdS | Race.rKaiyigiss] <> 0)
 
Yes totally that is a great example of using tag expression. Its a bit more advanced so I left it out of the discussion. But once you know exactly all the tags and not macros tag expression is really cool.
 
tagexpr looks interesting. Where can I get more information?

Finally, I endup with the following script :

Code:
~ assume not valid unless we meet all three conditions
@valid = 0

validif (#levelcount[Monk] >= 1)
~ Test all three conditions are valid
if (#attrvalue[aCON] >= 15) then
  if (#value[xDamRdS] <> 0)  then
       @valid = 1
  endif
endif

Finally, after speaking with my GM, I realized that kaiyigiss race is always required. So, this part is still in Expr-reqs.

And I did not use tagexpr as Aaron showed me. I did not know how to do with aCON.

I found HasAbility.xDamRdS in tag expression (by right clicking on the special ability), but I did not find anything for constitution.

Anyway, thank you all for the help!
 
Last edited:
Back
Top