Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Gizmo confusion (http://forums.wolflair.com/showthread.php?t=43348)

TCArknight April 1st, 2013 05:18 PM

Gizmo confusion
 
2 Attachment(s)
Ok, I'm trying to work with gizmos for the skills in the Doctor Who system.

I've got the form to pop up but it's very odd. :( (frmAoE)
The Skills tab is as I expect it,with clicking on the edit buttonopening the frmAoE. On the form, I'm not sure why the '????' instead of the "Add Specialty"

(I've attached the system code on the next post)

Any thoughts?

TCArknight April 1st, 2013 05:19 PM

1 Attachment(s)
Instead of posting the code, I attached the latest files so you can see what's going on. :(

Mathias April 2nd, 2013 07:23 AM

The data files could not be loaded due to the following errors:
File: tab_traits.dat (line 49) - Portal - Duplicate record encountered ('abGood')
File: tab_traits.dat (line 84) - Portal - Duplicate record encountered ('abBad')
File: tab_traits.dat (line 118) - Template - Duplicate record encountered ('abSelect')
File: tab_traits.dat (line 192) - Template - Duplicate record encountered ('abPick')
File: tab_traits.dat (line 313) - Layout - Duplicate record encountered ('abilities')
File: tab_traits.dat (line 344) - Tab Panel - Duplicate record encountered ('abilities')

Mathias April 2nd, 2013 07:26 AM

Sorry, cancel that error message - I needed to delete your last posting of the doctor who files before adding in the new set. I'm guessing you renamed one of your tab files, so when simply adding one set to the other, I end up with both the old and new copies of that tab's file, so I get duplicates.

TCArknight April 2nd, 2013 07:28 AM

Arrrrrgh! I swear it didn't do that to me when I reloaded it right before I zipped it up :(

I'll have to redo it tonight after work :(

Mathias April 2nd, 2013 07:28 AM

Please take another look at the files you've posted. On the skills tab, every item there is named "testing", which doesn't match your screenshot, and none of them have edit buttons.

Mathias April 2nd, 2013 07:57 AM

Note how all my gizmo examples had a helper pick?

That's because of a change that needs to be made to tables within a gizmo.

normally, you can leave the addpick="" part of a table_dynamic blank, because it defaults to addpick="actor". But in a gizmo, there is no default available, so you must have an addpick="". So, I always add a helper pick, and set the addpick="" to that helper pick.

Without an addpick, the additem text will always be ??????

The helper pick doesn't need to be complex - you can use the Simple compset that's defined in miscellaneous.str for that pick, because it doesn't need to have any behaviors of its own - it just needs to be present.

TCArknight April 2nd, 2013 05:32 PM

Mathias,

Thanks for the help. :)

I looked into the 4e files and saw what you mean about the helper.

http://i15.photobucket.com/albums/a3...ps785fd1c8.jpg
I've got this Skill Tab working to this point. The edit button is visible, and the mouseover text reads "Add Expertise" as I expect.

When I click on the edit button, I get this as frmAoE.
http://i15.photobucket.com/albums/a3...ps01b01ea6.jpg

If I go ahead and click on the ????? to add an item, I get this chooser:
http://i15.photobucket.com/albums/a3...ps37b0f1c9.jpg

But, once I make a selection, I get this but it adds it to the form.
Quote:

Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Empty candidate tagexpr specified for field 'aoeAoEExpr' on pick 'AoEHelp'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
Here's the definitions:
Code:

  <entity
    id="entAoE"
    form="frmAoE">
    <bootstrap thing="AoEHelp"/>
    </entity>

  <!-- AoE Helper component
        Each AoE Gizmo derives from this component
  -->
 
  <component
    id="AoEHelp"
    name="Area of Expertise Helper">

    <!-- Selection Tag Expressions -->
    <field
      id="aoeAoEExpr"
      name="Equipment Tag Expression"
      type="derived"
      maxlength="500">
      </field>

    </component>

<document signature="Hero Lab Data">

  <portal
    id="prtAoE"
    style="tblNormal">
    <table_dynamic
      component="SkillAoE"
      showtemplate="tmpAoE"
      choosetemplate="tmpAoE"
      scrollable="yes"
      alwaysupdate="yes"
      candidatepick="AoEHelp"
      candidatefield="aoeAoEExpr">
      <additem><![CDATA[
        @text = "Add Expertise"
        ]]>
        </additem>
      </table_dynamic>     
    </portal>

  <template
    id="tmpAoE"
    name="Area of Expertise Pick"
    compset="SkillAoE"
    marginhorz="3"
    marginvert="1">

    <portal
      id="name"
      style="lblSmall">
      <label>
        <labeltext><![CDATA[
          @text = field[name].text
          ]]></labeltext>
        </label>
      </portal>
   
    <portal
      id="delete"
      style="actDelete"
      tiptext="Click to delete this item">
      <action
        action="delete">
        </action>
      </portal>

    <position><![CDATA[
   
      ~set up our height based on our tallest portal
      height = portal[name].height

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      ~position our tallest portal at the top
      portal[name].top = 0
      portal[name].left = 0
     
      ~center the other portals vertically
      perform portal[delete].centervert

      ~position the delete portal on the far right
      perform portal[delete].alignedge[right,0]
      portal[name].width = width - portal[delete].width

      ]]></position>
    </template>

  <layout
    id="layAoE"
    marginvert="4">
    <portalref portal="prtAoE" taborder="20"/>
    <position><![CDATA[

      ~position and size the table to span the full layout
      portal[prtAoE].left = 0
      portal[prtAoE].width = width
     
      ]]></position>
    </layout>

  <form
        id="frmAoE"
        name="Area of Expertise"
        marginhorz="10"
        marginvert="5">
        <layoutref layout="layAoE"/>
        <position><![CDATA[
          layout[layAoE].width = 250
          perform layout[layAoE].render
          width = layout[layAoE].width
          height = 200
          ]]></position>
        </form>

  </document>

I still seem to be missing something. Is it something with the choosetemplate or candidatepick?

Also, how to I forward the SkillGen.xxxx tag into the aoeAoEExpr field for use as the candidate expression?

TC

Mathias April 3rd, 2013 08:39 AM

prtAoE needs an addpick="", set to your helper item.

Kairos April 3rd, 2013 08:49 AM

For what it's worth, I find this thread immensely helpful.:)

TCArknight April 3rd, 2013 04:47 PM

Thanks Mathias! That got the Add Expertise message instead of ????? displaying.

Some progress made, but a new issue.

I've added the following eval script to the Skill component.
Code:

<!-- set the appropriate candidate expression -->
    <eval index="4" phase="Final" priority="1000" name="aoeHelp Expr">
      <![CDATA[
      var myId as string
      myId = tagids[SkillGen.sk?," & "]
     
      call SetAoEExpr
      ]]></eval>

I've also created the following prodecure.
Code:

<!-- Script used to set up AoE selection
  -->
  <procedure id="SetAoEExpr" context="pick"><![CDATA[
   
    ~set up our tag expression for selecting appropriate specialty
    var expr as string
    var myId as string

    expr = "component.SkillAoE & "

    expr &= myId

    gizmo.childfound[AoEHelp].field[aoeAoEExpr].text = expr
    ]]></procedure>

and that results in this error message for each Skill on the hero.
Quote:

Attempt to access non-existent containing entity from script
Location: Procedure 'SetAoEExpr' near line 11
When the chooser is selected, all Areas of Expertise are available instead of limiting by the expression.

Thoughts?

TCArknight April 3rd, 2013 06:30 PM

Hmm... Ok, I think I need the procedure to have "container.childxxxx" instead of gizmo, right?

I tried that and get no series of error messages, but after a specialty is chosen I get an error message about the aoeAoEExpr being empty. Should I default it to "component.SkillAoE" and then string the "& SkillGen.xxx" from the skill component?
Quote:

Empty candidate tagexpr specified for field 'aoeAoEExpr' on pick 'AoEHelp'

Mathias April 4th, 2013 07:14 AM

The skill component is the thing that has the gizmo, right? So you're looking to travel from the pick, to the gizmo that it contains, to the helper pick there.

If the skills themselves are on the hero, then container.child[] is the same as hero.child[]. That's not what you want, if the skills are what's on the hero.

Does absolutely every skill have the <child> element added to it yet? Or are you only testing it on one or two skills for now?

If you are testing it on only one or two skills for now, I'll bet it's not every skill that's reporting the error - it's every skill but those.

doneif (isgizmo = 0)

will let you make sure there's a gizmo to travel to, before you try to travel to it.

TCArknight April 4th, 2013 06:26 PM

Thanks! That worked. :)

Now, one thing I can't figure out is how to do a "--Custom--" AoE to choose from for any skill that will allow the user to specify their own AoE.

Can I do one that uses the SkillGen.zLast tag instead of the normal skills?

This is the typical AoE:
Quote:

<thing
id="aoeClimb"
name="Climbing"
compset="SkillAoE"
isunique="yes"
description="Description goes here">
<fieldval field="trtAbbrev" value="Run"/>
<tag group="Hide" tag="SkillAoE"/>
<tag group="SkillGen" tag="skAthletic"/>
<link linkage="skill" thing="skAthletic"/>
</thing>

Mathias April 4th, 2013 06:34 PM

Where did you pick up that zLast thing? That's very specific to the way Cortex handles its skills - you're handling them in an entirely different way.

Customization is simply a matter of adding a user-entered text field, and then adding a script that replaces the name with that. You can use a tag to designate which skill(s) are your custom skills, and have your pick template handle them differently than non-custom ones.

TCArknight April 5th, 2013 05:42 AM

I had gotten that from your Cortex walkthrough when I thought the skill tab was going to have to be set up that way.

I took your advice and by adding a couple of User tags and putting a script in the Domain component have the custom entry working. I greatly appreciate the help!

My next big step is the Gadget gizmo. I think I have what I need down, but I may have a few more questions. :)

TCArknight April 9th, 2013 06:17 AM

Ok, I'm running into issues for the Gadget gizmos. :(

in the Game system, a gadget is an item the character has. This gadget has a Story point Value, and can contain several traits.

I have the gadgets entity and components
Code:

  <!-- An entity for the Gadget -->
  <entity
    id="entGadget"
    form="frmGadget">
    <bootstrap thing="GadgetHelp"/>
    </entity>

  <!-- Gadget component
        Each Gadget derives from this component
  -->
  <component
    id="Gadget"
    name="Gadget"
    autocompset="no">
   
    <!-- Each skill needs its own identity tag so existing skills can be identified during advancement -->
    <identity group="HasGadget"/>
   
    <!-- Every skill begins at a level 3 for gaining availability of an Area of Expertise -->
    <tag group="Equipment" tag="IsGadget"/>
   
    <!-- set the appropriate candidate expression -->
    <eval index="1" phase="Final" priority="1000" name="aoeHelp Expr">
      <![CDATA[
     
      var myId as string
      myId = tagids[Gadget.?," & "]
     
      call SetGadExpr
      ]]></eval>
   
    <!-- Each gadge that is added by the user costs story points -->
    <eval index="2" phase="Setup" priority="5000"><![CDATA[
      ~we must ignore bootstrapped abilities from races and abilities added via advances
      if (isuser + origin.ishero >= 2) then
        var stCost as number
       
        if (tagis[StoryCost.?] <> 0) then
          stCost = tagvalue[StoryCost.?]
         
          hero.child[resStP].field[resSpent].value += stCost
          endif
         
        endif
      ]]></eval>
     
    <!-- Track the skill on the actor -->
    <eval index="3" phase="Setup" priority="5000"><![CDATA[
      perform forward[HasGadget.?]
     
      ]]></eval>

     
    </component>
   
  <!-- Gadget Helper component
        Each Gadget Gizmo derives from this component
  -->
 
  <component
    id="GadgetHelp"
    name="Gadget Helper">

    <!-- Selection Tag Expressions -->
    <field
      id="GadgetExpr"
      name="Gadget Tag Expression"
      type="derived"
      maxlength="500">
      </field>

    </component>

Gadgets tab:
Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- This file contains the definition of the "Gadget" tab panel. This tab is where
      the user selects general Gadget (non-weapons) for the character.

      All public visual elements used with this tab panel start with the prefix "gr"
      to associate them with the tab.
-->

<document signature="Hero Lab Data">


  <!-- grGadget portal
        Presents a dynamic table where the user can add Gadget for the character.

        We use separate templates for selecting Gadget and showing the Gadget that has
        been chosen. Each of these appears further below.

        We use an "additem" script to simply prompt the user to add Gadget.

        The "buytemplate" and "selltemplate" attributes hook in the logic for
        properly buying and selling Gadget for cash.

        We use a "headertitle" script to place a suitable title above the table.

        The "list" tag expression restricts everything to only equipment (e.g. no
        weapons). The "candidate" tag expression is omitted, resulting in the same
        contents as the "list" tag expression.
  -->
  <portal
    id="grGadget"
    style="tblNormal">
    <table_dynamic
      component="Gadget"
      showtemplate="grGtPick"
      choosetemplate="grGtThing">
      <list>component.Gadget</list>
      <titlebar><![CDATA[
        @text = "Select Gadget"
        ]]></titlebar>
      <headertitle><![CDATA[
        @text = "Gadgets"
        ]]></headertitle>
      <additem><![CDATA[
        @text = "Add New Gadget"
        ]]></additem>
      </table_dynamic>
    </portal>


  <!-- grGtThing template
        Derived from the SimpleItem template, this includes the purchase cost and
        the lotsize of the item to be purchased.
  -->
  <template
    id="grGtThing"
    name="Gadget Thing"
    compset="Equipment"
    marginhorz="3"
    marginvert="2">

    <portal
      id="name"
      style="lblNormal">
      <label>
        <labeltext><![CDATA[
          @text = field[name].text
          ]]></labeltext>
        </label>
      </portal>

    <portal
      id="cost"
      style="lblNormal">
      <label>
        <labeltext><![CDATA[
          @text = tagvalue[StoryCost.?]
          ]]></labeltext>
        </label>
      </portal>

    <position><![CDATA[
      ~set up our dimensions, with a width that we dictate
      height = portal[name].height
      width = 250

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      ~position the cost portal on the far right
      perform portal[cost].alignedge[right,0]

      ~position the name on the left and let it use all available space
      portal[name].left = 0
      portal[name].width = minimum(portal[name].width,portal[cost].left - 10)
      ]]></position>

    </template>


  <!-- grGtPick template
        Derived from the SimpleItem template, this includes the Gadget button to move
        equipment between various containers.
  -->
  <template
    id="grGtPick"
    name="Gadget Pick"
    compset="Equipment"
    marginhorz="3"
    marginvert="3">

    <portal
      id="name"
      style="lblLeft"
      showinvalid="yes">
      <label
        field="name">
        </label>
      </portal>

    <portal
      id="username"
      style="editNormal">
      <edit
        field="UserName"
        maxlength="100">
        </edit>
      </portal>
   
    <portal
      id="edit"
      style="actEdit"
      tiptext="Edit Gadget">
      <action
        action="edit"
        buttontext="">
        </action>
      </portal>
     
    <portal
      id="info"
      style="actInfo">
      <action
        action="info">
        </action>
      <mouseinfo/>
      </portal>

    <portal
      id="delete"
      style="actDelete"
      tiptext="Click to delete this equipment">
      <action
        action="delete">
        </action>
      </portal>

    <position><![CDATA[
      ~set up our height based on our tallest portal
      height = portal[info].height

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      ~center the portals vertically
      perform portal[name].centervert
      perform portal[username].centervert
      perform portal[edit].centervert
      perform portal[info].centervert
      perform portal[delete].centervert

      ~position the delete portal on the far right
      perform portal[delete].alignedge[right,0]

      ~position the info portal to the left of the delete button
      perform portal[info].alignrel[rtol,delete,-8]

      ~position the info portal to the left of the delete button
      perform portal[edit].alignrel[rtol,info,-8]
     
      ~position the name on the left and let it use all available space
      var limit as number
      limit = portal[edit].left - 8
      portal[name].left = 0
      portal[name].width = minimum(portal[name].width,limit)

      ~if this is a "custom" Gadget pick, show an edit portal instead of the name
      var nextleft as number
      if (tagis[Helper.CustomItem] <> 0) then
        portal[name].visible = 0
        portal[username].left = portal[name].left
        portal[username].width = minimum(200,limit)
        nextleft = portal[username].right
      else
        portal[username].visible = 0
        nextleft = portal[name].right
        endif
      nextleft += 5

      ~if the Gadget can't be deleted (i.e. it's been auto-added instead of user-added,
      ~set the style to indicate that behavior to the user
      if (candelete = 0) then
        perform portal[name].setstyle[lblAuto]
        endif
      ]]></position>

    </template>


  <!-- Gadget layout
        This layout orchestrates the display of the visual elements that comprise
        the Gadget tab. This amounts to a title and a table that allow the user to
        add Gadget to the character.

        The logic for this layout is similar to preceeding tabs, so please refer
        to those tabs for more details.
  -->
  <layout
    id="gadget">
    <portalref portal="grGadget" taborder="10"/>

    <!-- This script sizes and positions the layout and its child visual elements. -->
    <position><![CDATA[
      ~position and size the table to span the full layout
      perform portal[grGadget].autoplace
      ]]></position>

    </layout>


  <!-- Gadget panel
        This is the "Gadget" panel shown within Hero Lab. Since we want this panel to
        appear second within the second grouping (equipment), we assign it an
        "order" of 220.

        The logic for this panel is similar to the logic for the preceeding panels,
        so please refer to those panels for more details.
    <live>!HideTab.gadget</live>
  -->
  <panel
    id="gadget"
    name="Gadget"
    marginhorz="5"
    marginvert="5"
    order="220">
    <layoutref layout="gadget"/>
    <position><![CDATA[
      ]]></position>
    </panel>

  </document>

Gadget thing:
Code:

  <thing
    id="gad51stBla"
    name="51st Century Blaster"
    compset="Gadget"
    isunique="yes"
    description="Handy gun (damage 4/L/L) that deletes and restores walls and other items digitally, as used by River Song.">
    <tag group="Gadget" tag="Major"/>
    <tag group="StoryCost" tag="2"/>
    <child entity="entGadget">
      <bootstrap thing="abDelete"/>
      <bootstrap thing="abDelete"/>
      <bootstrap thing="abRestrict"/>
      <bootstrap thing="abRestrict"/>
      </child>
    </thing>

<continued next post>

TCArknight April 9th, 2013 06:20 AM

1 Attachment(s)
When I click the Add Gadget, it opens up the form to choose Gadgets like I would expect. However, when it adds, it opens up another form with Add Gadget but nothing to choose from. :( And if I cancel that form, the gadget is not added to the hero.

Am I missing something more?

Mathias April 9th, 2013 07:27 AM

Can I see the code for frmGadget? That's the form you open up when you add a 51st Century Blaster.

You can probably look at this yourself before posting things.

By the abDelete and abRestrict items on your gadget, I'm guessing you want those to be ways that the user can modify the gadget - in this case, since they're always bootstrapped, they're always an option the user can fiddle with.

Check what component they have. Check the list expression on the table on frmGadget - make sure that table will display them.

TCArknight April 9th, 2013 06:28 PM

Thanks, that was it. :) I had the wrong component set.

Now, how can I get the title to show? :( Every time I try Titlebar or HeaderTitle, I get an error.

Form_gadget.dat
Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<document signature="Hero Lab Data">

  <portal
    id="prtGadget"
    style="tblInvis">
    <table_dynamic
      component="Ability"
      showtemplate="tmpShowGad"
      choosetemplate="tmpPickGad"
      scrollable="yes"
      alwaysupdate="yes"
      candidatepick="GadgetHelp"
      candidatefield="GadgetExpr"
      addpick="GadgetHelp">
      <additem><![CDATA[
        @text = "Add Trait"
        ]]>
        </additem>
      </table_dynamic>     
    </portal>

  <template
    id="tmpPickGad"
    name="Gadget Pick"
    compset="Ability"
    marginhorz="3"
    marginvert="1">

    <portal
      id="name"
      style="lblSmall">
      <label>
        <labeltext><![CDATA[
          @text = field[name].text
          ]]></labeltext>
        </label>
      </portal>
     
    <position><![CDATA[
   
      ~set up our height based on our tallest portal
      height = portal[name].height

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      ~position our tallest portal at the top
      portal[name].top = 0
     
      ~position the name on the left and let it use all available space
      portal[name].width = width
       
      ]]></position>
    </template>
   
  <template
    id="tmpShowGad"
    name="Gadget Show"
    compset="Ability"
    marginhorz="3"
    marginvert="1">

    <portal
      id="name"
      style="lblSmall">
      <label>
        <labeltext><![CDATA[
          @text = field[name].text
          ]]></labeltext>
        </label>
      </portal>
     
        <portal
          id="domain"
          style="editNormal">
          <edit
            field="domDomain">
            </edit>
          </portal>
         
    <portal
      id="info"
      style="actInfo">
      <action
        action="info">
        </action>
      <mouseinfo/>
      </portal>
     
    <portal
      id="delete"
      style="actDelete"
      tiptext="Click to delete this item">
      <action
        action="delete">
        </action>
      </portal>

    <position><![CDATA[
   
      ~set up our height based on our tallest portal
      height = portal[name].height

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      ~position our tallest portal at the top
      portal[name].top = 0
      portal[name].left = 0
     
      ~center the other portals vertically
      perform portal[domain].centervert
      perform portal[info].centervert
      perform portal[delete].centervert

      ~position the delete portal on the far right
      perform portal[delete].alignedge[right,0]
     
      ~position the info portal to the left of the delete button
      perform portal[info].alignrel[rtol,delete,-5]
     
      ~if we don't need a domain, hide the portals
          if (tagis[User.NeedDomain] = 0) then
            portal[domain].visible = 0
           
            ~position the name on the left and let it use all available space
        portal[name].left = 0
        portal[name].width = minimum(portal[name].width,portal[info].left - 5)
       
      else
        ~position the domain portal to the left of the delete
        perform portal[domain].alignrel[rtol,info,-5]
       
        var remWidth as number
        remWidth = portal[info].left - 5
        ~position the name on the left and let it use all available space
        portal[name].left = 0
        ~portal[name].width = maximum(portal[name].width,portal[domain].left - 5)
        portal[name].width = remWidth/2
       
        perform portal[domain].alignrel[ltor,name,5]
        portal[domain].width = remWidth/2
       
        ~portal[domain].width = minimum(150,portal[info].left - portal[domain].left - 5)
       
       
        endif
       
      ~if the ability is auto-added, change its font to indicate that fact
      if (candelete = 0) then
        perform portal[name].setstyle[lblAuto]
        endif
       
      ~shrink the name to fit the available space if it's too big, then re-center
      perform portal[name].sizetofit[6]
      perform portal[name].centervert
       
      ]]></position>
    </template>

  <layout
    id="layGadget"
    marginvert="4">
    <portalref portal="prtGadget" taborder="20"/>
    <position><![CDATA[

      ~position and size the table to span the full layout
      portal[prtGadget].left = 0
      portal[prtGadget].width = width
     
      ]]></position>
    </layout>

  <form
        id="frmGadget"
        name="Gadgets"
        marginhorz="10"
        marginvert="5">
        <layoutref layout="layGadget"/>
        <position><![CDATA[
          layout[layGadget].width = 450
          perform layout[layGadget].render
          width = layout[layGadget].width
          height = 200
          ]]></position>
        </form>

  </document>

For HeaderTitle, I get this: Attempt to use a 'headertitle' script within a table with no valid 'headerthing' for portal '_headerui' and '???????' on the Header.

For TitleBar, I don't get anything....

Thoughts?
TC

Mathias April 10th, 2013 08:23 AM

TCArknight, here's the wiki page about dynamic tables: http://hlkitwiki.wolflair.com/index....Element_(Data)

The answer you're looking for is in the section labeled "headerpick"

Kairos April 10th, 2013 09:06 AM

Just ran into this problem myself. Add this attribute:

headerpick="some_thing"

to the dynamic_table element.

[Sorry. Posted this before I refreshed the thread].

TCArknight April 11th, 2013 07:03 AM

I appreciate the help! That's now working.

I don't have the code in front of me as I'm at work, but I'm running into an issue for displaying the gadget output.

I have a foreach loop stepping through each gadget on the hero. I'm able to output the name field with no issue. However, when I try to use another foreach loop to step through the children on the gadget, I get an error message. Is there a trick to using nested foreach loops in this kind of case? Or would it be better to count the number of children and then do a simple for loop using gizmo.child to step through each on and get the name values of the children traits?

Mathias April 11th, 2013 07:37 AM

I'll need to see the code, and you'll need to right-click and copy the error message, so that you can paste it here. What you've described is too vague to figure out what's going on.

TCArknight April 11th, 2013 07:58 AM

Ok, thanks. :) I'll post it this evening when I get off work...

TCArknight April 11th, 2013 04:27 PM

I get this error:
Quote:

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 17
-> Script reference is invalid under the circumstances
The code in red is where I am trying to get to the bootstrapped children on the gadget.

Code:

<procedure id="sbgadgets" scripttype="synthesize"><![CDATA[

    var ismore as number
    var i as number
    var gadgetid as string
   
    append @boldon & "Gadgets: " & @boldoff & @newline
   
    ~output the details of all resources
    ismore = 0
    foreach pick in hero where "HasGadget.?"
      ismore = 1
      gadgetid = "thingid." & eachpick.idstring
     
      append @indent & eachpick.field[name].text
     
      foreach bootstrap in pick where "component.Ability"
        notify eachthing.idstring
        nexteach

       
      if (ismore = 0) then
        append @indent & "-none-" & @newline
        endif
       
      append @newline
      nexteach
   
    ~if we have no resources, output that fact
    if (ismore = 0) then
      append @indent & "-none-" & @newline
      endif
    ]]></procedure>


Mathias April 11th, 2013 04:40 PM

Code:


foreach bootstrap in eachpick.gizmo where "component.Ability"
  notify eachpick.idstring
  nexteach


TCArknight April 11th, 2013 04:51 PM

I still get an error:

Quote:

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 17
-> Use of 'eachpick.' transition is only valid within a 'foreach' context that iterates picks

Mathias April 12th, 2013 07:09 AM

I need to see line 17, please - that's the line it says this error is on.

TCArknight April 12th, 2013 05:18 PM

Ok, I cleaned the procedure up a bit, and this error is on a new line.
Quote:

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 19
-> Use of 'eachpick.' transition is only valid within a 'foreach' context that iterates picks
Highlighted is line 9.
Code:

<procedure id="sbgadgets" scripttype="synthesize"><![CDATA[

    var ismore as number
    var i as number
    var gadgetid as string
   
    append @boldon & "Gadgets: " & @boldoff & @newline
 
    ~output the details of all resources
    ismore = 0
   
    foreach pick in hero where "HasGadget.?"
      ismore = 1
      gadgetid = "thingid." & eachpick.idstring
     
      append @indent & eachpick.field[name].text & "(" & gadgetid & ")"
     
         
      foreach bootstrap in eachpick.gizmo where "component.Ability"
        notify eachpick.idstring
        nexteach
     
      if (ismore = 0) then
        append @indent & "-none-" & @newline
        endif
       
      append @newline
      nexteach
   
    ~if we have no resources, output that fact
    if (ismore = 0) then
      append @indent & "-none-" & @newline
      endif
    ]]></procedure>

Looking at the wiki, it looks like 'foreach bootstrap' uses eachthing. IfI try this:
Code:

notify eachthing.idstring
I get this:
Quote:

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 19
-> Use of 'eachpick.' transition is only valid within a 'foreach' context that iterates picks

Mathias April 12th, 2013 06:42 PM

Oh right - this is the statblock, so there's no need to look at the bootstraps as things - they're picks by now, so find them as picks.

foreach pick in eachpick.gizmo where "component.Ability"

TCArknight April 12th, 2013 07:53 PM

That did it, thanks. :)

How would I go about creating an option in the Configure Hero to use to toggle display of the gizmos?

Kairos April 13th, 2013 03:55 AM

Quote:

Originally Posted by TCArknight (Post 153423)
That did it, thanks. :)

How would I go about creating an option in the Configure Hero to use to toggle display of the gizmos?

I've gotten to that point in my project too. I set up source elements in control.1st. I made a "sourcebooks" parent with the "selectable" element set to "no":

Code:

  <source
    id="Sourcebks"
    name="Sourcebooks"
    selectable="no"
    description="Collection of rules from Qin supplements that can be turned on and off">
    </source>

Then I added a source element for each sourcebook for the game, such as:

Code:

  <source
    id="qinLegends"
    name="Qin Legends"
    abbrev="Legends"
    parent="Sourcebks"
    default="no"
    reportable="no"
    sortorder="1"
    description="Controls whether material from Qin Legends is available">
    </source>

Finally, I'm creating a new thing_xxxxx.dat file for the source, adding a "usesource" element to the things in it:

Code:

<usesource source="qinLegends"/>
I think you can get more granular than that by making the individual sourcebooks not selectable, then adding sources to represent individual rules options.

Hope that helps.

Duggan September 7th, 2017 05:13 AM

TCArknight, I've been trying to crib your work on skill specialties as per this post, but I'm hitting a brick wall. I don't suppose you have any hardwon wisdom you could share?


All times are GMT -8. The time now is 08:08 AM.

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