Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
peterphonic
Member
 
Join Date: Aug 2014
Posts: 44

Old September 17th, 2014, 06:55 AM
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
peterphonic is offline   #1 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old September 17th, 2014, 07:06 AM
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.
AndrewD2 is offline   #2 Reply With Quote
peterphonic
Member
 
Join Date: Aug 2014
Posts: 44

Old September 17th, 2014, 05:23 PM
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!
peterphonic is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old September 17th, 2014, 06:12 PM
Quote:
Originally Posted by peterphonic View Post
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)

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #4 Reply With Quote
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old September 18th, 2014, 12:27 AM
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)
Fuzzy is offline   #5 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old September 18th, 2014, 12:44 PM
Quote:
Originally Posted by Fuzzy View Post
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.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #6 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old September 18th, 2014, 02:22 PM
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)
Aaron is offline   #7 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old September 18th, 2014, 03:19 PM
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.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #8 Reply With Quote
peterphonic
Member
 
Join Date: Aug 2014
Posts: 44

Old September 18th, 2014, 06:24 PM
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 by peterphonic; September 19th, 2014 at 04:32 AM.
peterphonic is offline   #9 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:02 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.