Thread: Two questions
View Single Post
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 27th, 2016, 11:48 AM
OK, three things. With the trackers I'm working with, the maximum value is based on the value of related attributes. So there's a "Might" attribute and a "Might" tracker. The value of the Might attribute is supposed to be the maximum value for the Might pool.

The Might attribute starts at 0 until someone picks a Type (analogous to a class or a profession or a template).

So, Might is 0. Pick a template, then Might gets a proper value.

The max for Might Pool is derived from Might.

Now, if I use literal values in both the creation script and the Might Pool thing, it all works. When I go to the In-Play tab, I see "5/20". Which perfectly met my expectations.
Code:
------ components.core excerpt------
.
.
.
      <creation><![CDATA[
        if (tagis[Helper.ResetMax] <> 0) then
          ~field[trkUser].value = field[trkMax].value
          field[trkUser].value = 5
          endif
      ]]></creation>
    </component>
------ end components.core ------

--------- thing_miscellaneous.dat excerpt ---------
  <thing
    id="trkMight"
    name="Might Pool"
    compset="Tracker">

    <!-- Automatically add the tracker to every actor -->
    <tag group="Helper" tag="Bootstrap"/>

    <!-- Resetting the tracker sets the value to the maximum -->
    <tag group="Helper" tag="ResetMax"/>

    <!-- Use the starting power points as our initial maximum -->
    <eval index="1" phase="Final" priority="1000"><![CDATA[
      field[trkMin].value = 0
      ~field[trkMax].value = #trait[attrMight]
      field[trkMax].value = 20
      ]]></eval>
      
    </thing>
--------- end excerpt ---------
If I then leave the literal value in the Pool, but change the creation script to abide by the Max value, then when I go to the In-Play tab, I will see 0/20.

Code:
------ components.core excerpt------
.
.
.
      <creation><![CDATA[
        if (tagis[Helper.ResetMax] <> 0) then
          field[trkUser].value = field[trkMax].value
          ~field[trkUser].value = 5
          endif
      ]]></creation>
    </component>
------ end components.core ------

--------- thing_miscellaneous.dat excerpt ---------
  <thing
    id="trkMight"
    name="Might Pool"
    compset="Tracker">

    <!-- Automatically add the tracker to every actor -->
    <tag group="Helper" tag="Bootstrap"/>

    <!-- Resetting the tracker sets the value to the maximum -->
    <tag group="Helper" tag="ResetMax"/>

    <!-- Use the starting power points as our initial maximum -->
    <eval index="1" phase="Final" priority="1000"><![CDATA[
      field[trkMin].value = 0
      ~field[trkMax].value = #trait[attrMight]
      field[trkMax].value = 20
      ]]></eval>
      
    </thing>
--------- end excerpt ---------
This part confuses me. At first, I thought, "Maybe it's not working because the max value is 0 at creation, and it can't surpass that." But this seems to falsify that hypothesis, because the max value is still a literal value of 20.

So, something is happening that I don't understand.
EightBitz is offline   #11 Reply With Quote