Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 12th, 2013, 01:48 AM
I have a class special that requires a specific Diety and certain Domains as a pre-req. The #hasdeity[XXXXX]<>0 macro works spiffingly well however It would appear that Domain pre-requisites are an anomaly.

I tried #hasdomain[cdEvil] <> 0 but received a right side expression parsing error, presumably there isn't a has domain macro?

and then this script

Code:
~ Start out invalid
    @valid = 0

    ~ Check for Evil or Law Domain

    if (hero.childfound[HasDomain.cdEvil] <> 0) then

      ~ If so, we're valid.
      @valid = 1
      else
     
    if (hero.childfound[HasDomain.cdLaw] <> 0) then

      ~ If so, we're valid.
      @valid = 1
      endif
     endif
Error message below

HTML Code:
Syntax error in 'pre-requisite rule' script for Thing 'arWoWUnBar' on line 6
  -> Non-existent thing 'HasDomain' used by script
I referred to the hero fields and noticed that adding and removing domains altered the fields to HasAbility.cdEvil cdLaw respectively so I tried

if (hero.childfound[HasAbility.cdEvil] <> 0) which also didn't compile.

Exactly how can this be done??

Looking through the existing data I'm seeing a text placeholder stating script required (Ultimate Magic - Warrior Priest) or a huge search expression chooser that cycles through anything that grants a Domain ability (Domain Strike - Ultimate Combat) and allows the user to select a domain ability to apply effects to.

Edit: #hasability[cdLaw] <> 0 does work.

Dormio Forte Somnio


Community Created Resources :
Data Package Repositories :
d20pfsrd
Custom Character Sheets
Community Server Setup (Packs)

Hero Lab Help- Video Tutorials and Pathfinder FAQ

Created by the community for the community

Last edited by bodrin; July 12th, 2013 at 01:54 AM. Reason: the hasability macro does work!!
bodrin is offline   #1 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 12th, 2013, 02:01 AM
Nevermind this worked.

Code:
~ Check for Evil or Law domain
 @valid = 0

  if (#hasability[cdLaw] <> 0) then
   @valid = 1
    else

  if (#hasability[cdEvil] <> 0) then
   @valid = 1
    endif
   endif

Dormio Forte Somnio


Community Created Resources :
Data Package Repositories :
d20pfsrd
Custom Character Sheets
Community Server Setup (Packs)

Hero Lab Help- Video Tutorials and Pathfinder FAQ

Created by the community for the community
bodrin is offline   #2 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old July 12th, 2013, 09:51 AM
Quote:
Originally Posted by bodrin View Post
Nevermind this worked.

Code:
~ Check for Evil or Law domain
 @valid = 0

  if (#hasability[cdLaw] <> 0) then
   @valid = 1
    else

  if (#hasability[cdEvil] <> 0) then
   @valid = 1
    endif
   endif
Just an FYI you could make this all one line of code:
Code:
~ We are valid if we have the Law or Evil Domain
validif (#hasability[cdLaw] + #hasability[cdEvil] <> 0)
Also you could then put this on the Pre-Req section:
Code:
#hasability[cdLaw] + #hasability[cdEvil] <> 0

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   #3 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old July 12th, 2013, 09:56 AM
Quote:
Originally Posted by ShadowChemosh View Post
Just an FYI you could make this all one line of code:
Code:
~ We are valid if we have the Law or Evil Domain
validif (#hasability[cdLaw] + #hasability[cdEvil] <> 0)
Also you could then put this on the Pre-Req section:
Code:
#hasability[cdLaw] + #hasability[cdEvil] <> 0
It was a very quick eureka moment when I spotted a domain ability could be tested with the #hasability macro a quick copy / paste duplicate was all I could spare before heading off to RL work.

Code tidying usually falls by the wayside once something is working as it should, but thanks for the pointer.

Dormio Forte Somnio


Community Created Resources :
Data Package Repositories :
d20pfsrd
Custom Character Sheets
Community Server Setup (Packs)

Hero Lab Help- Video Tutorials and Pathfinder FAQ

Created by the community for the community
bodrin is offline   #4 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old July 12th, 2013, 10:06 AM
Quote:
Originally Posted by bodrin View Post
It was a very quick eureka moment when I spotted a domain ability could be tested with the #hasability macro a quick copy / paste duplicate was all I could spare before heading off to RL work.

Code tidying usually falls by the wayside once something is working as it should, but thanks for the pointer.
Yea no problem. I also wanted it for future readers. What you find is that about 90% of stuff can be tested with #hasability[] macro. Class Abilities, Racial Abilities, and I am pretty sure Custom Abilities also. Actually really nice as its a one stop macro instead of needing a specific one for each class or race.

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   #5 Reply With Quote
Reply

Thread Tools
Display Modes

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 01:07 AM.


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