Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   Skill Pre-requisite (http://forums.wolflair.com/showthread.php?t=66494)

DeathSheep November 3rd, 2021 09:17 AM

Skill Pre-requisite
 
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?

Fenris447 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.

DeathSheep 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.

Fenris447 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.

DeathSheep 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
?

Fenris447 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.

DeathSheep November 5th, 2021 01:33 PM

All of that won't fit in Expr-req though...?

Fenris447 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

DeathSheep November 5th, 2021 03:56 PM

In eval rules, the error is "Invalid use of reserved word 'if' in script."

Fenris447 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>



All times are GMT -8. The time now is 04:23 AM.

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