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

Old January 26th, 2016, 08:37 PM
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.
EightBitz is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old January 27th, 2016, 12:26 AM
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.
Mathias is offline   #2 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 27th, 2016, 07:53 AM
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.
EightBitz is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old January 27th, 2016, 07:58 AM
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.
Mathias is offline   #4 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 27th, 2016, 09:11 AM
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.
EightBitz is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old January 27th, 2016, 09:19 AM
1) please show me your code

2) Bookmark this wiki page: http://hlkitwiki.wolflair.com/index....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.
Mathias is offline   #6 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 27th, 2016, 09:50 AM
Quote:
Originally Posted by Mathias View Post
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.
Attached Images
File Type: png Before.png (46.1 KB, 3 views)
File Type: png During.png (45.7 KB, 2 views)
File Type: png After.png (45.8 KB, 2 views)
EightBitz is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old January 27th, 2016, 09:58 AM
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
Mathias is offline   #8 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 27th, 2016, 10:07 AM
Quote:
Originally Posted by Mathias View Post
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.
EightBitz is offline   #9 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old January 27th, 2016, 10:45 AM
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>
EightBitz is offline   #10 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 04:43 AM.


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