Member
Join Date: Jun 2018
Posts: 83
|
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?
|
#1 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
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! |
#2 |
Member
Join Date: Jun 2018
Posts: 83
|
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.
|
#3 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
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. |
#4 |
Member
Join Date: Jun 2018
Posts: 83
|
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 Code:
SkillSt > 0 |
#5 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
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! |
#6 |
Member
Join Date: Jun 2018
Posts: 83
|
All of that won't fit in Expr-req though...?
|
#7 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
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! |
#8 |
Member
Join Date: Jun 2018
Posts: 83
|
In eval rules, the error is "Invalid use of reserved word 'if' in script."
|
#9 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
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! |
#10 |
|
|