Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 25th, 2016, 11:06 AM
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>
That all works fine, except that since the eval script is wrapped in a comment, it doesn't do anything.

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>
And I got the following error message when trying to load the game system:
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>
And it all worked. This tells me (I think) that the timing is working fine between the attributes and the preTraits. But adding the "usesource" line messes things up. I'd like to keep that in there.

Help?
EightBitz is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old January 25th, 2016, 11:27 AM
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>
Mathias is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old January 25th, 2016, 11:28 AM
"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.
Mathias is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old January 25th, 2016, 11:32 AM
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>
On the wiki the DTD for a "Thing" is defined HERE. The order matters.

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.
ShadowChemosh is offline   #4 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 25th, 2016, 01:49 PM
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.
EightBitz is offline   #5 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 25th, 2016, 01:50 PM
It's gonna be messy, though, because I'm sick of trying to remove unnecessary bits and getting a domino effect of error messages.
EightBitz is offline   #6 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 11:12 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.