• 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

When is a text field not a text field?

barrelv

Well-known member
I'm getting this error message:

Portal 'caSkills' - Candidate field 'acCrSkills' must be text field.

Here's the code for that field

Code:
    <field
      id="acCrSkills"
      name="Career Skills"
      type="derived"
      defvalue="Skill.skForgery">
      </field>

Do I need to do something special to designate a field as text? I'm not seeing that anywhere in the wiki page for Field Elements.
 
Read the description for the "maxlength" attribute. That tells you how to change between a value field and a text field.

Based on the defvalue you're setting, why store this information as a field? Why not store it as a tag?
 
I was on the way to delete this post since I just found that part about non-zero length :(

I'm trying to build a chooser that only has a small number of skills on it. This is back to my whole 'trying to let careers pick their starting skills' thing.
 
If I were building a chooser that only offered a small number of skills to choose from, I'd create an identity tag group on the skill component to use for this, and then place those identity tags on the career things.

Then, use a script on the Career component to fill in a text field, rather than making whomever's building the careers remember the Ids and write them out manually.
 
Last edited:
If I were building a chooser that only offered a small number of skills to choose from, I'd create and identity tag group on the skill component to use for this, and then place those identity tags on the career things.

Then, use a script on the Career component to fill in a text field, rather than making whomever's building the careers remember the Ids and write them out manually.

This is probably a better idea...
 
I'm having a bit of problem here. I can get my identity tag on the Career container, but I can't get the NEEDTAG part to reference it. It's saying nothing's found, but I can right-click and have it show the tags and see there are tags for CareerSkl1.

From the Career
Code:
  <!-- Tag all the skills that this career can choose from--> 
  <tag group="CareerSkl1" tag="skPistol"/>
  <tag group="CareerSkl1" tag="skHandW"/>

On the tab
Code:
  <portal
    id="crSkPick1"
    style="chsNormal">
    <chooser_table
      component="Skill"
      choosetemplate="LargeItem">
      <needtag container="Career" thing="CareerSkl1"></needtag>
      <chosen><![CDATA[
        if (@ispick = 0) then
          @text = "{text clrwarning}Select Skill"
        else
          @text = field[name].text
          endif
        ]]></chosen>
      <titlebar><![CDATA[
        @text = "Choose the Skill for your career"
        ]]></titlebar>
      </chooser_table>
    </portal>
 
This portal's container is the hero, not the career, so you'll need to copy the tags from the career to the hero before needtag can be used.
 
hmmm. then I might have an issue. There are multiple careers, each with their own selections. The chooser_table would need to be unique to that career. Or at least have its options unique to that career.
 
Last edited:
In that case, needtag isn't going to be an option in this case. You'll need candidate expressions.
 
Going in circles :(

so this is where I started today, but I ran into errors. Those errors eventually led me to Needtag. Are there any examples of using Candidates?
 
Yeah, this filters nothing. I'm doing something wrong.

Code:
  <portal
    id="crSkPick1"
    style="chsNormal">
    <chooser_table
      component="Skill"
      choosetemplate="LargeItem">
      <candidate
        inheritlist="yes">CareerSkl1.?</candidate>
      <chosen><![CDATA[
        if (@ispick = 0) then
          @text = "{text clrwarning}Select Skill"
        else
          @text = field[name].text
          endif
        ]]></chosen>
      <titlebar><![CDATA[
        @text = "Choose the Skill for your career"
        ]]></titlebar>
      </chooser_table>
    </portal>
 
tried that, with no luck either. Here's the code

Code:
  <portal
    id="crSkPick1"
    style="chsNormal">
    <chooser_table
      component="Skill"
      choosetemplate="LargeItem"
      candidatepick ="Career"
      candidatefield="crSkills">
      <chosen><![CDATA[
        if (@ispick = 0) then
          @text = "{text clrwarning}Select Skill"
        else
          @text = field[name].text
          endif
        ]]></chosen>
      <titlebar><![CDATA[
        @text = "Choose the Skill for your career"
        ]]></titlebar>
      </chooser_table>
    </portal>

crSkills has a value of: skPistol

when I click the Chooser though, I see the entire list of skills, not just pistol.
 
Is "Career" the id of the specific Career you've added to this test character, or is that the Id of the Career component? You need to target a particular pick with that candidatepick expression.

Try putting this field on the actor for now, in order to get it set up correctly, because then you can have a defined and permanent candidatepick.
 
Also, crSkills will need to be a full tag expression - group.tag, so CareerSkl1.skPistol, not just skPistol.
 
Is "Career" the id of the specific Career you've added to this test character, or is that the Id of the Career component? You need to target a particular pick with that candidatepick expression.

Try putting this field on the actor for now, in order to get it set up correctly, because then you can have a defined and permanent candidatepick.

is there a particular command I can use to have it figure out the career that called it into being?. Here's the full template:

Code:
  <template
    id="caPick"
    name="Career Pick"
    compset="Career"
    marginhorz="3"
    marginvert="2">

    <portal
      id="name"
      style="lblNormal"
      showinvalid="yes">
      <label
        field="name">
        </label>
      </portal>
	  
    <portal
      id="lblmenuar1"
      style="lblSecond">
      <label
        field="usrLblAr1">
        </label>
      </portal>
      
  <portal
    id="crSkPick1"
    style="chsNormal">
    <chooser_table
      component="Skill"
      choosetemplate="LargeItem"
      candidatepick ="Career"
      candidatefield="crSkills">
      <chosen><![CDATA[
        if (@ispick = 0) then
          @text = "{text clrwarning}Select Skill"
        else
          @text = field[name].text
          endif
        ]]></chosen>
      <titlebar><![CDATA[
        @text = "Choose the Skill for your career"
        ]]></titlebar>
      </chooser_table>
    </portal>
    
  <portal
    id="crSkPick2"
    style="chsNormal">
    <chooser_table
      component="Skill"
      choosetemplate="LargeItem">
      <needtag container="CareerSkl2" thing="CareerSkl2" usehero="yes"></needtag>
      <chosen><![CDATA[
        if (@ispick = 0) then
          @text = "{text clrwarning}Select Skill"
        else
          @text = field[name].text
          endif
        ]]></chosen>
      <titlebar><![CDATA[
        @text = "Choose the Skill for your class"
        ]]></titlebar>
      </chooser_table>
    </portal>
    
    <portal
      id="lblmenuar2"
      style="lblSecond">
      <label
        field="usrLblAr2">
        </label>
      </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)

      ~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[lblmenuar1].centervert
      perform portal[lblmenuar2].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 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)
	  
      ~positioning the optional menus
      if (compare(field[usrLblAr1].text,"") = 0) then
        portal[lblmenuar1].visible = 0
        portal[crSkPick1].visible = 0
      endif

       if (compare(field[usrLblAr2].text,"") = 0) then
        portal[crSkPick2].visible = 0
        portal[lblmenuar2].visible = 0
       endif

      ~position the menus
	  portal[lblmenuar1].left = portal[name].right + 10
	  portal[crSkPick1].left = portal[lblmenuar1].right + 5
	  portal[lblmenuar2].left = portal[crSkPick1].right + 10
	  portal[crSkPick2].left = portal[lblmenuar2].right + 5
      ]]></position>

    </template>
 
Can you work on a different part of your project for a while? I think I'm going to have to teach you how to rebuild this system, because this approach isn't going to work, and I don't have time this week to write out the instructions on how to do that.

If you want to study up on it, search this forum for threads about "agent tabs". "Agent" is probably the keyword to use.
 
Sure thing. I have a lot of data-entry to do for weapons, spells, etc and really haven't started on any sort of character sheet solution. I have plenty of other things to do.

I'll read up on the agent piece. Thanks Mathias for everything.
 
Back
Top