Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
TCArknight
Senior Member
 
Join Date: Jan 2007
Posts: 812

Old April 3rd, 2013, 05: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 is online now   #11 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Posts: 812

Old April 3rd, 2013, 07: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'

Last edited by TCArknight; April 3rd, 2013 at 09:20 PM.
TCArknight is online now   #12 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 11,984

Old April 4th, 2013, 08: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.
Mathias is offline   #13 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Posts: 812

Old April 4th, 2013, 07: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>
TCArknight is online now   #14 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 11,984

Old April 4th, 2013, 07: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.
Mathias is offline   #15 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Posts: 812

Old April 5th, 2013, 06: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 is online now   #16 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Posts: 812

Old April 9th, 2013, 07: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 is online now   #17 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Posts: 812

Old April 9th, 2013, 07:20 AM
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?
Attached Files
File Type: zip doctorwho.zip (433.8 KB, 2 views)
TCArknight is online now   #18 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 11,984

Old April 9th, 2013, 08: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.
Mathias is offline   #19 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Posts: 812

Old April 9th, 2013, 07: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
TCArknight is online now   #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 01:32 PM.


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