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
Location: NW Arkansas
Posts: 1,321

Old August 5th, 2009, 03:06 PM
Quote:
Originally Posted by rob View Post
You are always assigning the Hide.Attribute tag to the thing, which is why it is never showing up. I think what you should be doing is two-fold. First, assign the Hide.Attribute tag via a "tag" element instead of the Eval script. This will have it never appear under normal circumstances. You can do that by adding:

Code:
        <tag group="Hide" tag="Attribute"/>
Second, use the Eval script to determine whether to make the attribute appear. If it is supposed to appear, then you can delete the tag from the pick. You'd probably base this on the presence of a tag somewhere on the hero. The script would look like:

Code:
    <eval index="1" phase="Setup" priority="1000"><![CDATA[
      if (hero.tagis[Hero.Psionics] <> 0) then
        perform delete[Hide.Attribute]
        endif
        ]]></eval>
Note that I just used a tag I concocted here, so you should use whatever you decide instead. Also, you'll probably need the timing to be much different from Setup/1000, since this is very early and you'll likely want to schedule it after the Psionics tag has been added somewhere.
Rob,

Thanks for the help!

The problem I was having is that even though it had the !Hide.Attribute <live> tag on the pick template, that wasn't having any effect. It wasn't never showing up, it was always visible no matter what.... I'll try changing some timings around and see what happens.

HL rocks and even though it's a tough learning curve, the flexibility it offers is bar-none.
TCArknight is offline   #11 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old August 7th, 2009, 05:09 PM
Quote:
Originally Posted by TCArknight View Post
The problem I was having is that even though it had the !Hide.Attribute <live> tag on the pick template, that wasn't having any effect. It wasn't never showing up, it was always visible no matter what.... I'll try changing some timings around and see what happens.
Oops. I'm too rushed right now with all the prep for GenCon. So I missed that detail.

By putting the Live tagexpr on the *template*, you are not going to get the behavior you want at all. The Live tagexpr on the template performs the test against the tags on the *hero*. It also only applies to templates that are *not* used within tables. If a template is used for table, the live state of the table *portal* dictates whether the table appears or not.

If I understand correctly, you want all attributes to appear in the table, except for the Psionics attribute. That one attribute should be controlled via the presence of a tag. To accomplish this, you need to control what appears *within* the table - not the visibility of the table itself. You control the contents of a table via the Live tagexpr within the table *portal* - not the template.

Using the standard table portal used within the Skeleton files as a starting point, the revised table portal would look like below with the added restriction of only showing attributes that are lacking the tag.

Code:
  <portal
    id="baAttrib"
    style="tblInvis">
    <table_fixed
      component="Attribute"
      showtemplate="baAttrPick"
      showsortset="explicit"
      scrollable="no">
      <live>!Hide.Attribute</live>
      <headertitle><![CDATA[
        @text = "Attributes"
        ]]></headertitle>
      </table_fixed>
    </portal>
rob is offline   #12 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old August 7th, 2009, 07:12 PM
Rob,

Thanks, but no luck.

When I have it the exact way you do, I get "Encountered Unknown element tag 'live' "
Code:
<portal
    id="baAttrib"
    style="tblInvis">
    <table_fixed
      component="Attribute"
      showtemplate="baAttrPick"
      showsortset="explicit"
      scrollable="no">
     <live>!Hide.Attribute</live>
      <headertitle><![CDATA[
        @text = "Attributes"
        ]]></headertitle>
     </table_fixed>
    </portal>
Attached Images
File Type: jpg hl_tag_error.jpg (39.6 KB, 5 views)
TCArknight is offline   #13 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old August 7th, 2009, 07:17 PM
Doh! That should be "list" instead of "live". Sorry, I'm just too frazzled and sleep-deprived with the big crunch leading into GenCon in a few days. My brain knew it was "list", but my fingers just typed "live" because that's what I had been looking at in your post. Sorry!
rob is offline   #14 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old August 7th, 2009, 07:33 PM
LOL 's ok.

I just wish I was able to get to GenCOn, meet you all and attend some seminars.

I completely understand how rough it must be. Just enjoy the Con and keep cranking out the good stuff! LOL

Edit: Oh, one other related thing.

I'm trying to use: perform assign[Edge.IsPsionic] when the Psionic edge is added. I get an error that Edge.IsPsionic not defined.

I've got this in tags.1st:
<group
id="Edge"
dynamic="yes">
<value id="Edge"/>
</group>

What am I missing?

Last edited by TCArknight; August 7th, 2009 at 07:38 PM. Reason: added question...
TCArknight is offline   #15 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old August 7th, 2009, 07:46 PM
Even if your tag group is dynamic, you should add any tags you intend to use before using them in a script.

Currently, your only Edge tag is Edge.Edge

Also, for testing purposes, don't you want to use:
perform hero.assign[Edge.IsPsionic], so that the tag is on the hero, and not wherever your script is?
Mathias is offline   #16 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old August 7th, 2009, 08:34 PM
Thanks!

That did it!

Making much greater progress now!
TCArknight is offline   #17 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old August 8th, 2009, 12:36 PM
Howdy!

Ran into another snag...

I'm trying to allow the choice of one of the 4 reactionsto gain a bonus. From looking at the walkthrough, I should probably use the following portal:
Code:
    <portal
      id="menu1"
      style="menuSmall">
      <menu_things
        field="usrChosen1"
        component="none"
        maxvisible="10"
        usepicksfield="usrSource1"
        candidatefield="usrCandid1">
        </menu_things>
      </portal>
I've added this tag to all selectable reactions: <tag group="RAbil" tag="Adaptable"/>

However, although I get Adaptable: -choose- in red for the racial ability the menu to choose never shows up.

My template and the Racial ability:
Code:
<thing
  id="abAdapt"
  name="Adaptable"
  compset="RaceAbil"
  isunique="yes"
  description="Description goes here">
  <fieldval field="usrCandid1" value="thingid.Adaptable"/>
  <tag group="Hide" tag="Ability"/>
  <tag group="Hide" tag="RaceAbil"/>
  <tag group="ChooseSrc1" tag="Hero"/>

    <!-- Bootstrap Choose either Sta, Qui, Wil for a +2 bonus -->
  </thing>

  <template
    id="raPick"
    name="Racial Ability Pick"
    compset="RaceAbil"
    marginhorz="3"
    marginvert="2">

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

    <portal
      id="menu1"
      style="menuSmall">
      <menu_things
        field="usrChosen1"
        component="none"
        maxvisible="10"
        usepicksfield="usrSource1"
        candidatefield="usrCandid1">
        </menu_things>
      </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[info].height

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

      ~determine whether our menus are visible
      ~Note: Remember that a non-empty tagexpr field indicates menu selection is used.
      ~if (field[usrCandid1].isempty <> 0) then
        portal[menu1].visible = 0
      ~  endif

      ~position our tallest portal at the top
      portal[info].top = 0

      ~center the other portals vertically
      perform portal[name].centervert
      perform portal[delete].centervert
      perform portal[menu1].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,10]

      ~position the menus to the left of the info in the available space
      perform portal[menu1].alignrel[rtol,info,10]
      portal[menu1].width = (portal[info].left - portal[menu1].left - 20) / 2

      ~position the name on the left and use availble space, with a gap for menus
      portal[name].left = 0
      ~portal[name].width = minimum(portal[name].width,portal[menu1].left - portal[name].left)
      portal[name].width = 50

      ~if the ability is auto-added, change its font to indicate that fact
      if (candelete = 0) then
        perform portal[name].setstyle[lblAuto]
        endif
      ]]></position>

    </template>
What am I missing? Is my sizing and positioning off? I set the visibility always to 0, so I thought it would always show up even if there wasn't anything in the usrCandid1 field.

Suggestion?

Thanks!
Thomas
TCArknight is offline   #18 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old August 8th, 2009, 12:58 PM
Also:
Code:
  <component
    id="DeReac"
    name="Derived Reaction"
    autocompset="no">

    <!-- Derived traits are based on other traits. The "calculate" script on the
        "trtFinal" field value will work great for most traits, but NOT for derived
        traits. Consequently, derived traits need to re-calculate the field value AFTER
        the traits derived from are properly calculated. So the individual calculation
        scripts for each derived trait must occur AFTER the initial "trtFinal"
        calculation and BEFORE this derived calculation. We can also omit any "user"
        value from the calculation since derived traits have no user-defined facet.
        -->
    <eval index="1" phase="Traits" priority="6000" name="Derived reaFinal"><![CDATA[
      field[reaFinal].value = field[reaBonus].value + field[reaInPlay].value
      ]]></eval>

    </component>

<thing
  id="abBraklul"
  name="Brak'lul"
  compset="RaceAbil"
  isunique="yes"
  description="Description goes here">
  <tag group="Hide" tag="Ability"/>
  <tag group="Hide" tag="RaceAbil"/> 
    
    <eval value="1" phase="Traits" priority="10000">
      <![CDATA[
      var total as number 
      total = hero.child[reStamina].field[reaBonus].value

      total += 2

      hero.child[reStamina].field[reaBonus].value = total

      ]]></eval>
    </thing>
Doesn't seem to be working. It's the last Eval in the Traits phase and after the Stamina is calculated initially. What am I missing?
TCArknight is offline   #19 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old August 8th, 2009, 01:30 PM
Quote:
Originally Posted by TCArknight View Post
I've added this tag to all selectable reactions: <tag group="RAbil" tag="Adaptable"/>

Code:
  <fieldval field="usrCandid1" value="thingid.Adaptable"/>
The first issue is that you'll never have anything show up in the menu to select from with this tagexpr. You have assigned the tag "RAbil.Adaptable", but you will only be showing picks that possess the "thingid.Adaptable" tag. You need to change the tagexpr to match the tag you've assigned.
rob is offline   #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 07:28 AM.


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