• 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

Gizmo confusion

TCArknight

Well-known member
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?
 

Attachments

  • frmAoE.jpg
    frmAoE.jpg
    65.9 KB · Views: 15
  • SkillTab.jpg
    SkillTab.jpg
    66.2 KB · Views: 12
Last edited:
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')
 
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.
 
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 :(
 
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.
 
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.
 
Mathias,

Thanks for the help. :)

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

SkillTab_zps785fd1c8.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.
frmAoE_zps01b01ea6.jpg


If I go ahead and click on the ????? to add an item, I get this chooser:
Choose_zps37b0f1c9.jpg


But, once I make a selection, I get this but it adds it to the form.
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
 
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.
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?
 
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?
Empty candidate tagexpr specified for field 'aoeAoEExpr' on pick 'AoEHelp'
 
Last edited:
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.
 
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:
<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>
 
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.
 
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. :)
 
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>
 
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?
 

Attachments

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.
 
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
 
Back
Top