Member
Join Date: Aug 2014
Posts: 87
|
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> |
#1 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
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] |
#2 |
Member
Join Date: Aug 2014
Posts: 87
|
There is a tag on the hero for all careers (Career.crAristocr, etc) But I'm not sure what you mean by "tagexpress"
|
#3 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
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
|
#4 |
Member
Join Date: Aug 2014
Posts: 87
|
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> |
#5 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
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] |
#6 |
Member
Join Date: Aug 2014
Posts: 87
|
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> |
#7 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
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
|
#8 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
Quote:
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. RavenX Pronouns: She/Her Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. |
|
#9 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
I usually assume people already know how to make macros as its covered really early in the walk-thru.
|
#10 |
Thread Tools | |
Display Modes | |
|
|