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,281

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
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,275

Old January 27th, 2016, 11:52 AM
trkMax is something you're setting in a <fieldval> on the item, right?

You're not setting it in a script?

Because <creation> scripts are run only one time, when that pick is first added to the character, and then never run again, if you're setting the trkMax in a script, then it's too late - the creation script has already run.

If you are setting the trkMax in a script, then your creation script would need to look like this:
Code:
<creation><![CDATA[
  ~if we'll be resetting to our maximum, then set our starting value to a very big number, which will later be corrected to be the maximum by the field's <bound> script
  if (tagis[Helper.ResetMax] <> 0) then
     field[trkUser].value = 9999999999
     endif
   ]]></creation>
Mathias is online now   #12 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,275

Old January 27th, 2016, 11:53 AM
Ah, I see that you are setting the maximum in a script, so you will need to go with the large value route.
Mathias is online now   #13 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,281

Old January 27th, 2016, 12:17 PM
Quote:
Originally Posted by Mathias View Post
Ah, I see that you are setting the maximum in a script, so you will need to go with the large value route.
I was actually experimenting with that while waiting for your reply. It only works if I set a literal value for the tracker max.
Code:
  <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 = 100
      ]]></eval>
So I ended up doing this:
Code:
  <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
      if (#trait[attrMight] = 0) then 
        field[trkMax].value = 100
      else
        field[trkMax].value = #trait[attrMight]
      endif
      ]]></eval>
      
    </thing>
It's a bit awkward in that if someone goes to the In-Play tab before selecting a Type, they'll see 100/100. Other than that, it works. So it's functional, but has a temporarily cosmetic drawback.

Thanks for your help.
EightBitz is offline   #14 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,275

Old January 27th, 2016, 12:25 PM
In that case, instead of setting a default value that's not useful, how about using tags to hide the tracker until it can show a useful value?
Mathias is online now   #15 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,281

Old January 27th, 2016, 12:33 PM
Which is a great idea, except it's still not working right. If I switch between Types with different values for the attributes, the value for the trkUser field will get stuck on the lowest value. So if switch to a Glaive that has a Might of 12, I'll see the tracker at 12/12. Then I switch to a Nano with a Might of 7, and I'll see the tracker at 7/7. If I switch back to a Glaive, the Might attribute gets reset to 12, but I'll see the tracker at 7/12 instead of 12/12.

EDIT: Likewise, there are attribute points that can be spent to increase the attributes. So if I select a Glaive, the Might attribute is set to 12, and the tracker is 12/12. Then I spend two points on Might to increase it to 14, but the tracker says 12/14 instead of 14/14.

Basically, what I want is that when I'm done with character creation, and when an attribute is increased through an Advance, all the trackers with the ResetMax tag are maxed out. And if I have to do that manually, so be it. But there's that trigger script on the in-play tab that maxes everything out when you hit the reset button. That's the functionality I'm looking for.

Last edited by EightBitz; January 27th, 2016 at 12:42 PM.
EightBitz is offline   #16 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,275

Old January 27th, 2016, 12:43 PM
Re-examine this tracker - do you really need the "reset to maximum"? Why can't 0/12 mean nothing spent - why does 12/12 have to represent that?

If you really do want to display things as 12/12 meaning "nothing spent", then re-examine how you're displaying things - currently, it displays field[trkUser].value & "/" & field[trkMax].value (I'm referring to the finalize script on the trkUser field, BTW). Maybe change that to display field[trkLeft].value & "/" & field[trkMax].value. That way, changing the maximum doesn't mean that the amount spent has to change.
Mathias is online now   #17 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,281

Old January 27th, 2016, 12:55 PM
Quote:
Originally Posted by Mathias View Post
Re-examine this tracker - do you really need the "reset to maximum"? Why can't 0/12 mean nothing spent - why does 12/12 have to represent that?

If you really do want to display things as 12/12 meaning "nothing spent", then re-examine how you're displaying things - currently, it displays field[trkUser].value & "/" & field[trkMax].value (I'm referring to the finalize script on the trkUser field, BTW). Maybe change that to display field[trkLeft].value & "/" & field[trkMax].value. That way, changing the maximum doesn't mean that the amount spent has to change.
The way Numenera plays, the numbers you have left are more meaningful than the numbers you've spent. It's just a quicker visual reference. It's like when you take damage in Pathfinder. The fact that you have 50 hit points left is a more directly meaningful than the fact that you've lost 10 points out of 60.

I did try changing trkUser to trkLeft, but I got an error. I must have done it in the wrong place. I'll take another look.
EightBitz is offline   #18 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,281

Old January 27th, 2016, 01:07 PM
Aaaand, I give up. I'll move on to other things for now. Maybe if I get enough things functional, someone else might be interested enough to help optimize.
EightBitz is offline   #19 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,182

Old February 24th, 2018, 09:16 PM
Ran into this thread while researching a different problem. Out of curiousity, did you ever figure it out?
Duggan is offline   #20 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 12:13 PM.


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