Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Skeleton Files: Traits.str How does "Attribute" incoperate "Trait"? (http://forums.wolflair.com/showthread.php?t=57754)

Mettius February 19th, 2017 11:12 AM

Skeleton Files: Traits.str How does "Attribute" incoperate "Trait"?
 
In regards to the skeleton sample game system files:

The code comments (and wiki) imply that "Attributes" (below) as well as "Skills" would inherit the elements of the "Trait" component. What is the mechanism for this inheritance?

In traits.str:
Code:

<!-- Trait component
        All traits derive from this component and share these mechanisms in common
  -->
  <component
    id="Trait"
    name="Trait"
    autocompset="no"
    hasshortname="yes"
    ispublic="no">

Attribute section follows, same file.
<!--note ...I cut out the rest of the code from this post for brevity). -->
Code:

<component
    id="Attribute"
    name="Attribute"
    autocompset="no">

    <eval index="1" phase="Initialize" priority="3000"><![CDATA[
      field[trtMinimum].value = 0
      field[trtMaximum].value = 12
      ]]></eval>

    <!-- Each attribute point above one that is allocated by the user costs 7 CP -->
    <eval index="2" phase="Traits" priority="10000">
      <before name="Calc resLeft"/>
      <after name="Bound trtUser"/><![CDATA[
      hero.child[resCP].field[resSpent].value += (field[trtUser].value - 1) * 7
      ]]></eval>

    </component>

Yet, how is this so? I don't see anything explicitly defining the component id "Attribute" as inheriting anything from the component id "Trait"

Mettius February 19th, 2017 11:19 AM

I can stare at things for hours and only after asking someone for help do I seem to finally (and almost instantly) see the answer hiding in plain sight...

So, it would appear that the answer to my question is the following bit of code: I guess what I was missing is that the "attributes" which end up on the character sheet is not the component "Attribute" but rather the Component Set (compset) "Attribute".

Code:

<!-- Attribute - all attributes derive from this compset -->
  <compset
    id="Attribute"
    forceunique="yes">
    <compref component="Attribute"/>
    <compref component="Trait"/>
    <compref component="CanAdvance"/>
    </compset>



All times are GMT -8. The time now is 03:17 AM.

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