Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
Mathias,
I've started working on some 2e core mechanic files. I am using the 2.5 update (or the most recent re-released core rulebooks) for this data. I need to set up a validation report for attribute scores where the compiler checks the Unmodified ability score against the racial minimums / maximums required for each race. (I am not setting up bounding options intentionally in case a DM allows a member of a race that has an ability score outside the normal boundries the books require, but I'd like a validation error to show up saying the race doesn't meet the ability score requirements.) I created a field called trtNatural to store the unmodified version of the ability score for validation purposes. Each race has a set of Min/Max fields to store the minimal and maximal values of the ability scores for that race. I set each field to have a default value of 3 or 18 respectively. For some reason my code is only registering the default values instead of the ones stored on the race when I go to debug output, how can I get the compiler to test against the actual value stored on the race? Code:
<!-- Validate facets of the race --> <thing id="valRace" name="Race" compset="Race" isunique="yes"> <tag group="Helper" tag="Bootstrap"/> <!-- Make sure that we have a race selected --> <evalrule index="1" phase="Validate" priority="8000" message="Must be selected"><![CDATA[ ~if we have a race selected, we're good validif (hero.tagis[Race.?] <> 0) ]]></evalrule> <!-- Make sure that our ability scores meet the requirements --> <evalrule index="2" phase="Validate" priority="10000" message="Ability Score requirements not met"><![CDATA[ ~if our ability score is equal to or greater than the minimum requirement, we're good var foo as number var fii as number foo = hero.child[attrStr].field[trtNatural].value fii = field[minStr].value debug "Nat Str = " & foo & " Tested against min str " & fii if (hero.child[attrStr].field[trtNatural].value >= field[minStr].value) then @valid = 1 else @valid = 0 endif ~mark associated tabs as invalid container.panelvalid[basics] = 0 ]]></evalrule> </thing> For those reading this thread: I am looking for volunteers willing to enter spells, psionic powers, skills, etc. once I have the core mechanics built for the datafiles. I am only planning to add enough spells, powers, and skills to test the actual data. I won't be adding the full range of data to these files as I simply don't have enough time to do so. 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. |
#1 |
|
|