• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Skill Pre-requisite

DeathSheep

Well-known member
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?
 
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.
 
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.
 
  • 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.
 
Last edited:
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

?
 
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
 
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>
 
I copy-pasted that directly into the rule, and got the same error: "Invalid use of reserved word 'if' in script."
 
That's....weird. It's a modified version of code from an eval rule already working perfectly fine in the pack. There's a fair amount of eval-rules in the TCOE content, which is what I pulled it from.
 
Back
Top