• 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

Questions regarding new system

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.

When a boolean state is being used (e.g. show/hide, enable/disable), a value of zero always means "no" and non-zero value means "yes". Therefore, setting the visibility to zero means to *not* show it. If you want to force something to be always visible, you need to use a non-zero value (generally one). In the case of portals, they are always visible unless you specify otherwise, so you can simply comment out the entire if/then block to ensure the portal is always visible. As it stands, you are explicitly hiding the portal all the time. :-(
 
Also:
Code:
      field[reaFinal].value = field[reaBonus].value + field[reaInPlay].value
Code:
      total = hero.child[reStamina].field[reaBonus].value
      total += 2
      hero.child[reStamina].field[reaBonus].value = total

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?

In the first script, you are calculating the "reaFinal" field. In the second script, you are adding the "reaBonus" field - not the "reaFinal" field. Could that be the problem?
 
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.

Oh, ok.. that does explain it. I was going by the example in the walkthrough and it ad the thingid. thing.. thought that was necessary.. my bad. :)
 
In the first script, you are calculating the "reaFinal" field. In the second script, you are adding the "reaBonus" field - not the "reaFinal" field. Could that be the problem?

Yep, that did it.

It's a racial bonus, and I thought that should be adding to the Bonus field instead of the Final value. It works, and displays properly, but I'm not sure how it'll impact things down the road..

Thanks. :) I really appreciate the help. P)
 
Arrrrgh!!!

I'm getting frustrated. :(

Everything I see says that the below code should show the menu on the Adaptable Edge. It doesn't however and I don't know what I'm missing...

Code:
<thing
      id="reQuick"
      name="Quickness"
      compset="Reaction"
      isunique="yes"
      description="Description goes here">
      <fieldval field="reaAbbrev" value="Qui"/>
      <tag group="explicit" tag="1"/>
      <tag group="DashTacCon" tag="Combat"/>
      <tag group="RAbil" tag="Adaptable"/>
      <eval index="1" phase="Traits" priority="6000">
        <![CDATA[
        ~Quickness uses the better of the character's Perception or Agility

        var mod1 as number
        var mod2 as number

        mod1 = hero.child[attrPer].field[trtMod].value
        mod2 = hero.child[attrAgi].field[trtMod].value

        field[reaBonus].value = maximum(mod1,mod2)

        ~field[reaBonus].value = maximum(#traitbonus[attrPer],#traitbonus[attrAgi])
        ]]></eval>
      </thing>

<thing
  id="abAdapt"
  name="Adaptable"
  compset="RaceAbil"
  isunique="yes"
  description="Description goes here">
  <fieldval field="usrCandid1" value="RAbil.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 = 1
      ~  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>

Help????? LOL :)
 
Everything I see says that the below code should show the menu on the Adaptable Edge. It doesn't however and I don't know what I'm missing...

The menu is probably appearing but it's extremely narrow and ends up essentially not being visible.

In your Position script, the following two lines control the positioning of the menu:
Code:
      perform portal[menu1].alignrel[rtol,info,10]
      portal[menu1].width = (portal[info].left - portal[menu1].left - 20) / 2

Since you don't initialize the menu portal's width before using "alignrel", this will result in the default width, which I think is 30 pixels. Then you set the width such that it will end up being about 15-20 pixels wide, based on the position set first. This isn't wide enough for the drop list arrow to be visible, let alone actual contents to choose from. So the menu portal may actually be getting automatically hidden due to being too small - I'd have to check with Colen on that detail.

Take things in *small* steps. First, get everything showing in crude fashion in your tables. Then start tweaking the sizing and positioning of individual portals. It will take a little bit longer this way, but you'll get the hang of things quickly and it will avoid frustrations like this situation. Once you start getting proficient, you can then begin cutting corners, but you'll be able to spot issues like this more readily when they occur, so it won't be frustrating. :-)
 
Thanks Rob! :)

You know... that helped.. and also me realizing that I had ~two~ templates in the tab and was using the wrong one...:rolleyes:

That'll teach me.

On the plus side, I can now select the Reaction used by the ability and have it properly bonused. :)

I'm going to be entering the list of edges and flaws, but probably not going for any mechanics with them just yet. My biggest hurdle ahead is the skill selection process.

I'll get as far as I can before then though...

I really do appreciate all the help with this so far. :)
 
I've made some progress, but ran into a glitch. I'm trying to change all the resAbility references to resEdge to account for the trait.

When I think I've got them all found and the code compiles and reloads, this pops up:
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_'
- - -
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_'
- - -
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_'
- - -
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_'
- - -
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_'

The Abilities tab shows ???? on the selection area for Edges.

What am I missing?

Thanks!
 
Well, it helps to use the right pick resource... :) had resAbility (which I'd deleted) instead of resEdge...

on another note, I'm trying to do a chooser to pull all skills with a value >= 2 into the list.

I tried: <fieldval field="usrCandid1" value="component.Skill & fieldval:trtFinal >= 2"/>

but I get the following error.

Any suggestions?
 

Attachments

  • hl_tag_error2.jpg
    hl_tag_error2.jpg
    41.1 KB · Views: 4
The '&' character has special meaning within XML, just like it does in HTML. When you use a "CDATA" block for a script, it tells XML to treat everything as raw text. However, within an attribute value, the character always has special meaning. That's why the error says that the character '&' is a problem.

You need to use the special code for the '&' character, which is "&". The '&' is followed by the letters "amp" and then finished with a semi-colon. All five characters are required. This results in the following XML element:
Code:
<fieldval 
    field="usrCandid1" 
    value="component.Skill & fieldval:trtFinal >= 2"/>

You can find more details about this within the documentation. Go to the page below and see the section entitled Reserved XML Characters.
http://hlkitwiki.wolflair.com/index.php5/XML_Files
 
2 Questions:

1) I have an ability thing called Skilled which has two usrChosen selections with ChooseSrc1 and ChooseSrc2.
Code:
<thing
  id="abSkilled"
  name="Skilled"
  compset="RaceAbil"
  isunique="yes"
  description="Description goes here">
  <fieldval field="usrCandid1" value="component.Skill"/>
  <fieldval field="usrCandid2" value="component.Skill"/>
  <tag group="Hide" tag="Ability"/>
  <tag group="Hide" tag="RaceAbil"/>
  <tag group="ChooseSrc1" tag="Hero"/>
  <tag group="ChooseSrc2" tag="Hero"/>
      <eval value="1" phase="Final" priority="4000">
      <![CDATA[
      
      if (field[usrChosen1].ischosen <> 0) then

        field[usrChosen1].chosen.field[trtFinal].value += 1
        
        endif

      if (field[usrChosen2].ischosen <> 0) then
        
        field[usrChosen2].chosen.field[trtFinal].value += 1

        endif
      ]]></eval>
  </thing>
This ability on the summary page shows up as

Skilled: ChooseSrc1, ChooseSrc2

If the same choice is made for both, then it displays

Skilled: MyChoice, MyChoice

Is there a way to get that to display just

Skilled: MyChoice (+2) ? :)

2) I want to let a Skill have an indicator that displays if there is a specialty selected for a skill. The skill should have a way to select additional specialties, the number of which are limited only by points remaining to spend on skills. Or possibly adds a new line under the skill with a chooser of appropriate specialties.

How do I set something like that up?
 
Last edited:
Go to the components.core file, to the UserSelect component, and look at eval script #1. That's the script that appends the names of choices 1 & 2 to the name.

So, you have a couple of options; if this ability is unique, and there's nothing else that works like this, copy that script onto your skilled thing, and change the timing to Render/501 (just after the regular version), then re-write the script to suit the way you want to display things. It will run, and replace what the previous script wrote.

If this is something that pops up in many things in the same component, you can put the copied script on that component, and set everything up so that the script only runs if some tag is present, or just run it only if chosen1 and chosen2 are the same thing (field[usrChosen1].chosen.uniqindex = field[usrChosen2].chosen.uniqindex)
 
Last edited:
Back
Top