• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Two questions

EightBitz

Well-known member
I've looked for answers to these questions, and can't find anything clear and straightforward. Again, please understand that I'm a novice, and I'm asking questions that I hope are simple ones to the more knowledgeable folk. If they're not quick-and-easy answers, then I'd still appreciate a nudge in the right direction.

1. Can you lock a chooser table when locking for character advancement?
Here's the table:
Code:
  <portal
    id="stDescript"
    style="chsNormal"
    width="150">
    <chooser_table
      component="Descriptor"
      choosetemplate="LargeItem">
      <chosen><![CDATA[
        if (@ispick = 0) then
          @text = "{text clrwarning}Select Descriptor"
        else
          @text = field[name].text
          endif
        ]]></chosen>
      <titlebar><![CDATA[
        @text = "Choose a descriptor."
        ]]></titlebar>
      </chooser_table>
    </portal>

I found this to try to adapt it, but my attempts have failed:
Code:
<mouseinfo><![CDATA[
        if (hero.tagis[mode.creation] = 0) then
          @text = "Attributes must be modified via the Advances tab once the character is locked for play."
        elseif (autonomous = 0) then
          @text = "This trait has been improved via the Advances tab and cannot be modified further from here."
        else
          @text = "Allocate points to this attribute by clicking on the arrows to increase/decrease the number of points assigned."
          endif
        ]]></mouseinfo>

QUESTION 2:
I have a tracker that, when it shows up on the TacCon or In-Play tabs, I want it to start with the maximum value instead of 0. There's a reset button that sets it to the maximum value, but I can't get it to start there.

This is the same type of tracker as Power Points from the skeleton system. I copied and pasted the code, and just renamed things.
 
1) In the tab_abilities.dat file of the skeleton files, look in the layout element's position script for an example of freezing a table in advancement mode.

2) You'll need to add a new tag for trackers that means "default to the maximum". Then, alter the creation script on trackers so that if that tag is present, it sets the default value to the maximum, and if not, leaves it at the minimum as usual.
 
1) This is a different type of table than the abilities table. This is like the Race chooser_table where you can only choose one option and have that be the only option. When I try to adapt the logic from the abilities table, the value either defaults to "-Please make a selection-" or it's just not locked.

2) There is already a tag called "ResetMax" which is applied, but whenever I try to set the default value (manipulate the trkUser field), I get an error message that derived traits can generally not be modified with scripts ... even though it is being modified with scripts in other places.
 
1) Try it anyway, even if this is a chooser, not a table.

2) Which script are you using? Re-read what I said - I mentioned a specific type of script that won't give you that error.
 
1) I did try it. I tried it exactly as used, with the exception of commenting out the @text assignment (I want the assignment that the user originally picked), and I tried it a couple of different ways with nested IF statements.

Using it the first way, it resets the selection to a default value of "-Please make a selection-". With the nested IF statements, it would either reset in a similar manner, or it wouldn't lock.

2) I've this line "field[trkUser].value = field[trkMax].value" in various places. I put it in the main tracker definition in components.core, and depending on in which script I placed it, I would either get a message that the value is read-only or that it's a derived trait that can't generally be modified with scripts. (I left out the tag check just for simplicity for now.)

I put it in things_miscellaneous.dat in the specific thing that I wanted to use it for, and again, I would get an error message that it's a derived trait.

If neither of these is the creation script you're talking about, then I'm in need of more guidance.

I understand and appreciate that answering these questions takes time out of your project work, and it's not my intention to unduly impose on that, so if it gets to that point, just drop me a kind note, please.

Thank you.
 
1) please show me your code

2) Bookmark this wiki page: http://hlkitwiki.wolflair.com/index.php5?title=Structural_File_Reference

That's where you'll find an outline of what can go into each of the types of things you can build into your structural files, like traits.str or components.core. From that page, follow the "component" link to go to the page about components, since you're altering the tracker component. Then, read through that page, and find the "creation" element, and read the connected pages.
 
1) please show me your code

This is in form_static
Code:
  <portal
    id="stDescript"
    style="chsNormal"
    width="150">
    <chooser_table
      component="Descriptor"
      choosetemplate="LargeItem">
      <chosen><![CDATA[
        ~if we're in advancement mode, we've been frozen, so display accordingly
        if (state.iscreate = 0) then
          ~@text = "{text clrgrey}Add Special Abilities Via Advances Tab"
          done
          endif
          
        if (@ispick = 0) then
          @text = "{text clrwarning}Select Descriptor"
        else
          @text = field[name].text
          endif
        ]]></chosen>
      <titlebar><![CDATA[
        @text = "Choose a descriptor."
        ]]></titlebar>
      </chooser_table>
    </portal>

Also attached are three screen shots. Before.png, During.png and After.png. Before is before any character creation is done. This is a completely new, unmodified hero. During is a validated but not-yet-locked hero. After is a locked hero.
 

Attachments

  • Before.png
    Before.png
    46.1 KB · Views: 4
  • During.png
    During.png
    45.7 KB · Views: 3
  • After.png
    After.png
    45.8 KB · Views: 3
Locking a portal is not handled on the portal's own definition - it's handled in the position script of the layout that places that portal on the tab.

This is what I was trying to direct you to earlier:
Code:
  <layout
    id="abilities">
    <portalref portal="abAbility" taborder="10"/>

    <!-- This script sizes and positions the layout and its child visual elements. -->
    <position><![CDATA[
      ~freeze our table in advancement mode to disable adding new choices
      ~Note: All freezing must be done *before* any positioning is performed.
      if (state.iscreate = 0) then
        portal[abAbility].freeze = 1
        endif
 
Locking a portal is not handled on the portal's own definition - it's handled in the position script of the layout that places that portal on the tab.

This is what I was trying to direct you to earlier:
Code:
  <layout
    id="abilities">
    <portalref portal="abAbility" taborder="10"/>

    <!-- This script sizes and positions the layout and its child visual elements. -->
    <position><![CDATA[
      ~freeze our table in advancement mode to disable adding new choices
      ~Note: All freezing must be done *before* any positioning is performed.
      if (state.iscreate = 0) then
        portal[abAbility].freeze = 1
        endif

Perfect! Thank you!

Still reading the wiki page you linked me to for the tracker.
 
Still can't get the tracker thing. I didn't realize you were talking about a literal <creation> script. I didn't see one defined for the Tracker component, so I added one.

I put it after the final field definition, right before the closing tag for the component. Anywhere else I tried to put it within that component would give me errors. Putting it at the end, I get no errors, but it also has no effect. The starting value is still 0. Code is below. I commented out the IF block to facilitate troubleshooting.
Code:
<creation><![CDATA[
   ~if (tagis[Helper.ResetMax] <> 0) then
   field[trkUser].value = field[trkMax].value
   ~endif
]]></creation>
 
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.
 
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>
 
Ah, I see that you are setting the maximum in a script, so you will need to go with the large value route.
 
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.
 
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?
 
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:
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.
 
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.
 
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.
 
Ran into this thread while researching a different problem. Out of curiousity, did you ever figure it out?
 
Back
Top