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:
Attribute section follows, same file.
<!--note ...I cut out the rest of the code from this post for brevity). -->
Yet, how is this so? I don't see anything explicitly defining the component id "Attribute" as inheriting anything from the component id "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">
<!--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>