Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD

Notices

Reply
 
Thread Tools Display Modes
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 3rd, 2021, 09:17 AM
This should be easier than I'm making it. I'm trying to create a special ability that requires proficiency (or expertise) in a skill (in this case, Stealth). What do I put in the pre-requisites script to check for that?
DeathSheep is offline   #1 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old November 3rd, 2021, 09:07 PM
You're looking for hero.tagis[ProfSkill.skStealth] <> 0. You may have to also look for hero.tagis[ProfDouble.skStealth] <> 0. I feel like I've seen it before where the Hero only has one of those, so test for both. It's been a minute since I did a pre-req so I don't know off the top of my head how to plug that in. But if you can find something with a pre-existing pre-req, it'll give you some direction.

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!
Fenris447 is offline   #2 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 4th, 2021, 07:11 AM
Thanks! That put me on the right path. It needed to go in Expr-reqs, not Pre-reqs. I'm not sure how to OR hero.tagis[ProfDouble.skStealth] <> 0, but at least this is forward progress.
DeathSheep is offline   #3 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old November 5th, 2021, 12:49 PM
  • Set a variable.
  • If tag 1 is present, add 1 to the variable.
  • If tag 2 is present, add 1 to the variable.
  • If the variable > 0, the overall test is valid.

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!

Last edited by Fenris447; November 5th, 2021 at 01:01 PM.
Fenris447 is offline   #4 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 5th, 2021, 01:16 PM
So I put something like this in the eval script:

Code:
var SkillSt as number

if (hero.tagis[ProfSkill.skStealth] <> 0)
     then SkillSt += 1
endif

if (hero.tagis[ProfDouble.skStealth] <> 0)
     then SkillSt += 1
endif
And this in the Expr-reqs:

Code:
SkillSt > 0
?
DeathSheep is offline   #5 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old November 5th, 2021, 01:30 PM
No you can do all that in the Expr-req script. Variables don't carry from one script to another.

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!
Fenris447 is offline   #6 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 5th, 2021, 01:33 PM
All of that won't fit in Expr-req though...?
DeathSheep is offline   #7 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old November 5th, 2021, 01:37 PM
Correction: Do it in eval rules. Treat it like a regular script, but at the end, you're targeting "@valid = 1"

So:

if (SkillSt > 0) then
@valid = 1
endif

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!
Fenris447 is offline   #8 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 5th, 2021, 03:56 PM
In eval rules, the error is "Invalid use of reserved word 'if' in script."
DeathSheep is offline   #9 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old November 5th, 2021, 06:41 PM
The full thing in the eval rule should be something like this:

Code:
    <evalrule phase="Final" priority="100000" message="You must be proficient in Stealth."><![CDATA[
 var SkillSt as number

SkillSt = 0

if (hero.tagis[ProfSkill.skStealth] <> 0)
     then SkillSt += 1
endif

if (hero.tagis[ProfDouble.skStealth] <> 0)
     then SkillSt += 1
endif

   if (SkillSt > 0) then
   @valid = 1
 
if (@valid = 0) then
         @message = "You must be proficient in Stealth."
       endif
]]></evalrule>

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!
Fenris447 is offline   #10 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 12:24 AM.


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