• 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

Something like exprreq

barrelv

Well-known member
Thanks again to everyone who has helped me with this project. Took a long break while actually running an Iron Kingdoms game instead of playing it it. Now getting back to my character generator.

I have a situation where character can only take a particular career (Iron Fang) if he already has another career from a specified list (Aristocrat, Military Officer, Soldier, or Warcaster)

Typically, it's a single requirement (Must be Human, etc), but this is the first time I've had to deal with several potentials.

Here's how I've done it for single choices:

Code:
  <!-- Must have certain starting careers -->
  <exprreq iserror="yes" message="Must be Human"><![CDATA[
      compare(hero.findchild[Career].field[name].text, "Aristocrat")= 0 
  ]]></exprreq>
    </thing>

what do I do for multiples though? I don't see any way to extend exprreq to do this.
 
I would have careers forward a HasCareer.? identity tag to the hero and then just check with a tagexpression

@valid = tagexpress[HasCareer.Aristocrat|HasCareer.Military|etc]
 
There is a tag on the hero for all careers (Career.crAristocr, etc) But I'm not sure what you mean by "tagexpress"
 
actually its tagexpr sorry, it's on the wiki, its like tagis but checks for a whole tag expression, alternately you can check for a tagis of each
 
still should be inside an exprreq element? because the below code is returning true even if one of those two tags aren't present on the hero.

Code:
  <!-- Must have certain starting careers -->
  <exprreq iserror="yes" message="Must have certain career"><![CDATA[
      @valid = tagexpr[Career.crAristocr|Career.crInvestig]
  ]]></exprreq>
 
actually in an exprreq it probably should be something like

tagexpr[Career.crAristocr|Career.crInvestig] <> 0

also might have to have it be hero.tagexpr[Career.crAristocr|Career.crInvestig]
 
This did it. Thanks!

Code:
  <!-- Must have certain starting careers -->
  <exprreq iserror="yes" message="Must have certain career"><![CDATA[
      tagexpr[Career.crAristocr|Career.crInvestig] <> 0
  ]]></exprreq>
 
No prob, I'm used to using prereqs when I'm working with XML and only use Expr-Reqs when I'm in the editor
 
This did it. Thanks!

Code:
  <!-- Must have certain starting careers -->
  <exprreq iserror="yes" message="Must have certain career"><![CDATA[
      tagexpr[Career.crAristocr|Career.crInvestig] <> 0
  ]]></exprreq>

Open Definition.dat

Create a macro called hascareer that checks for the career you want.
It could be something like hero.childlives[#career] for the code. Then you can just use #hascareer[] <> 0 in your expr-reqs.
 
Covered early but unless you've done it a few times you might not remember it. You shouldn't need to forward the tags with hero.childlives[] in a macro. That line of code looks up the career in question to see if its on the actor. Unless you need bootstrap conditions based on the tags, forwarding a tag shouldn't be needed.
 
I recommend tag-based exprreqs, as opposed to hero.childfound[] based exprreqs.

First, when you get into dealing with packages, where not every book may be loaded on all characters, it's easier to define the tag you need in tags.1st, in order to remove the error than it is to copy that item into a shared file.

Second, if another ability counts as this one for the purpose of prereqs, you can simply assign the same tag and the prereq will work, instead of having to rewrite the prereq to look for the other thing.
 
I recommend tag-based exprreqs, as opposed to hero.childfound[] based exprreqs.

First, when you get into dealing with packages, where not every book may be loaded on all characters, it's easier to define the tag you need in tags.1st, in order to remove the error than it is to copy that item into a shared file.

Second, if another ability counts as this one for the purpose of prereqs, you can simply assign the same tag and the prereq will work, instead of having to rewrite the prereq to look for the other thing.

I had not considered the counts as... Tags before. I haven't had to worry about that with the files I created yet.
 
I generally work with forwarding a tag to the hero and checking that pre-reqs. The only time I've ever done a childfound check for a pre-req in PF is checking for a classes custom abilities or a specific selection in an array.
 
Back
Top