Senior Member
Join Date: May 2013
Posts: 1,458
|
Disclaimer: I am still very much a novice with the authoring kit.
I created a skeleton gaming file, and edited the attributes to be attrMight, attrSpeed and attrIntel. I have not changed any timing. I copied thing_races.dat to thing_types.dat, and I have the following code: Code:
<!-- Glaive --> <thing id="TypGlaive" name="Glaive" compset="Type" isunique="yes" description="Description goes here"> <!-- If the race confers any special abilities, bootstrap them here <bootstrap thing="abSample"/> --> <!-- Define any script needed to apply changes to traits or other mechanisms <eval value="1" phase="PreTraits" priority="5000"> <before name="Calc trtFinal"/><![CDATA[ ~apply whatever adjustment(s) are needed here #traitbonus[attrMight] += 10 #traitbonus[attrSpeed] += 9 #traitbonus[attrIntel] += 6 ~hero.child[resAbility].field[resMax].value += 1 ~#traitbonus[attrSam] += 1 ]]></eval> --> <usesource source="srcNumCore"/> </thing> So I then I uncommented the eval script: Code:
<!-- Glaive --> <thing id="TypGlaive" name="Glaive" compset="Type" isunique="yes" description="Description goes here"> <!-- If the race confers any special abilities, bootstrap them here <bootstrap thing="abSample"/> --> <!-- Define any script needed to apply changes to traits or other mechanisms --> <eval value="1" phase="PreTraits" priority="5000"> <before name="Calc trtFinal"/><![CDATA[ ~apply whatever adjustment(s) are needed here #traitbonus[attrMight] += 10 #traitbonus[attrSpeed] += 9 #traitbonus[attrIntel] += 6 ~hero.child[resAbility].field[resMax].value += 1 ~#traitbonus[attrSam] += 1 ]]></eval> <usesource source="srcNumCore"/> </thing> The data files could not be loaded due to the following errors: File: thing_types.dat (line37 - Encountered unknown element tag 'usesource' One or more timing errors were identified. Please review the timing report and correct the errors. You can access the report under the 'Develop' menu or by clicking this link. So then I figured I'd leave out the usesource tag: Code:
<!-- Glaive --> <thing id="TypGlaive" name="Glaive" compset="Type" isunique="yes" description="Description goes here"> <!-- If the race confers any special abilities, bootstrap them here <bootstrap thing="abSample"/> --> <!-- Define any script needed to apply changes to traits or other mechanisms --> <eval value="1" phase="PreTraits" priority="5000"> <before name="Calc trtFinal"/><![CDATA[ ~apply whatever adjustment(s) are needed here #traitbonus[attrMight] += 10 #traitbonus[attrSpeed] += 9 #traitbonus[attrIntel] += 6 ~hero.child[resAbility].field[resMax].value += 1 ~#traitbonus[attrSam] += 1 ]]></eval> </thing> Help? |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Order matters when listing the elements of an XML item. Here's the relevant wiki page:
http://hlkitwiki.wolflair.com/index....ent_%28Data%29 You'll see there that <usesource> needs to come before <bootstrap>, which needs to come before <eval> |
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
"Unknown Element" means "OK, I found an <eval>, which means that the next things after that could be evalrule, pickreq, exprreq, etc." <usesource> isn't on the list of elements that can come after <eval>, so the error report it returns is that the element is unknown.
|
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
So its not really that its "unknown" but that its in the "wrong" area. Usesource element must come before the scripts and tags but After values. I think that is right. Let me go check a pathfinder .user file. Yep that is correct.
In this case its worth looking at how the editor for other game systems lays out the XML. You need to match that same layout as the XML Schema gets touchy about which elements come first. This is where getting familiar with other systems in XML makes the transition to the Authoring kit easier. This should work: Code:
<!-- Glaive --> <thing id="TypGlaive" name="Glaive" compset="Type" isunique="yes" description="Description goes here"> <usesource source="srcNumCore"/> <!-- If the race confers any special abilities, bootstrap them here <bootstrap thing="abSample"/> --> <!-- Define any script needed to apply changes to traits or other mechanisms --> <eval value="1" phase="PreTraits" priority="5000"> <before name="Calc trtFinal"/><![CDATA[ ~apply whatever adjustment(s) are needed here #traitbonus[attrMight] += 10 #traitbonus[attrSpeed] += 9 #traitbonus[attrIntel] += 6 ~hero.child[resAbility].field[resMax].value += 1 ~#traitbonus[attrSam] += 1 ]]></eval> </thing> Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#4 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
Thanks. :-)
I do things backwards. If I planned all this out, I'd be too intimidated to ever make any progress. If I do it a bit at a time, then I'm like, "Hey! I got THAT bit done! ... Oooh, look! Now THAT'S done, too!" I have no idea how I'm going to do most of this stuff. So ... I'm plugging away, bit by bit. |
#5 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
It's gonna be messy, though, because I'm sick of trying to remove unnecessary bits and getting a domino effect of error messages.
|
#6 |
|
|