• 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

Adding areas of expertise to skills

AndrewD2

Well-known member
The system I'm working on has Areas of Expertise that you can add to a skill if you have 3 or more points in the skill. They add a +2 bonus to that specific bonus, and I was trying to think where I saw that before. Then I remembered Shadowrun does that with specialties.

I was wondering how they were handled? I'm guessing the action button brings up a form, but I'm not really sure how it's handled. I'm going to make the AoEs as things that are the expertise component which looks like when I glance at the editor for Shadowrun 5, but I'm just looking for an idea of how to handle these.
 
Looks like I need to do the skills as gizmos to copy the functionality from Shadowrun since each skill will need its own set of picks.
 
Well got a form setup (the example form in the wiki is using the panel element instead of form, so it was a little confusing). Now to figure out how to turn all the skills into gizmos.
 
Made it a step further, made all the skills Gizmos, "+" button I have accesses a form called "expertise" which lists all the areas of expertise in the game.

Couple interesting things happened, since I changed the button action from form to edit now my form comes up with just ????? for the names in it.

also when I had things I get this error

Code:
Attempt to use a 'headertitle' script within a table with no valid 'headerthing' for portal '_headerui'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use a 'headertitle' script within a table with no valid 'headerthing' for portal '_headerui'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'

I've been working my way through the Gizmo post that's stickied in the forums and it's helped some, but now I need to figure out how to get the form to only show the picks associated with that specific skill. I have the Expertise component pull the tag from the associated link Skill to it much like Skills in Savage Worlds pull the tag of the Attribute.
 
Bit of both really, I've just been trying to figure it out on my own, but I was hoping to find out how Shadowrun Specialties worked and reporting my progress towards figuring it out so I would hopefully be answering some of the questions that might be asked of me without having to wait for further questions.
 
New update, got rid of the ???? for the add item part, I noticed your comment at the end of the post about bootstrapping a simple thing.

The header still shows up as ?????? and gives me a warning about no valid headerthing but I can't find a reference anywhere to headerthing.

So where I'm at now is
1) need to figure out how to get a header for it
2) need to figure out how to limit the selections to options only available to the selected skill
3) change the name of the skill so it says SKILLNAME (+2 EXPERTISE, +2 EXPERTISE, ...)
 
Look on the wiki page describing the elements of a table_dynamic portal for headerpick and addpick.
 
<needtag> is what Shadowrun uses for #2

For #3, debug the fields on a skill in Shadowrun, and watch how those change as you add specialties.
 
Ok for #3 I see, it adds the name to a field and appends the field to the skill, shouldn't be too tough to figure out, but I'm still having trouble with #2. I've used the needtag and if I'm reading correctly I tell it to use the Skill.? tag on the skill and the SkillList.? tag on pick and it should only show the intersection of the two, but it still shows everything.

This is my form portal

Code:
<portal
    id="expExpert"
    style="tblNormal">
    <table_dynamic
      component="Expertise"
      showtemplate="expPick"
      choosetemplate="SimpleItem"
      headerpick="SkillHelp"
      addpick="SkillHelp"
      showfixedlast="yes">
      <candidate>!Hide.Expertise</candidate>
      <needtag
        container="Skill"
        thing="SkillList">
        </needtag>
      <titlebar><![CDATA[
        @text = "Add an Area of Expertise"
        ]]></titlebar>
         <description/>
      
      <headertitle><![CDATA[
        @text = "Areas of Expertise"
        ]]></headertitle>
        
      <additem><![CDATA[
        ~if we're in advancement mode, we've been frozen, so display accordingly
        if (state.iscreate = 0) then
          @text = "{text clrgrey}Add Areas of Expertise Via Advances Tab"
          done
          endif

        ~set the color based on whether the proper number of slots are allocated
         @text &= "Add New Area of Expertise"
        ]]></additem>
   
      </table_dynamic>
    </portal>

Am I missing something or am I looking at the logic in the wrong place?
 
Remember that container="" of the needtag refers to the gizmo - the container that's attached to each skill - not to the skill itself.

So, that container has no tags in it by default.

Here's how Shadowrun puts the appropriate tags there:

Code:
    <eval index="10" phase="Initialize" priority="10000"><![CDATA[
      ~copy our SkillList tags to the gizmo so they can be used for the needtag
      if (isgizmo <> 0) then
        perform gizmo.pushtags[SkillList.?]

        ~tags added to the gizmo are then automatically added to the parent of
        ~that gizmo - but that's where those tags were just pushed from, meaning
        ~that what happens is to duplicate them all.  So, delete the ones on
        ~ourself, then pull the tags from the gizmo.
        perform delete[SkillList.?]
        perform gizmo.pulltags[SkillList.?]
        endif
      ]]></eval>
 
Ah, I see, I thought the skill pick became the gizmo when you added the child entity to it, I'll try this out when I have free time (hopefully tonight) but right now, its Pathfinder work for Aaron.

Thanks for all your help,
I really do appreciate it.
 
I got it to work thank you for explaining that, is there a built in style the does the auto-resizing/carrying over to 2nd line like the Shadowrun skills do?
 
I think this is the most relevant part of the position script that sets up the multi-row

Code:
      ~otherwise, the name gets more space
      else
        portal[domain].visible = 0
        portal[menu1].visible = 0
        portal[name].width = minimum(portal[name].width,lastright - portal[name].left - 5)
        perform portal[name].sizetofit[30]
        portal[name].width = minimum(portal[name].width,lastright - portal[name].left - 5)
        endif

      ~a few skills, like exotic weapons, will end up needing two lines in
      ~order to fit when they're skillsofts.  The sizetofit[30] brings the font
      ~height small enough that it will fit, so here, we only use autoheight,
      ~not autosize or autowidth
      perform portal[name].autoheight
      perform portal[name].centervert
Oh, and on the portal itself, the ismultiline is required:
Code:
    <portal
      id="name"
      style="lblLeft"
      showinvalid="yes">
      <label
        ismultiline="yes">
        <labeltext><![CDATA[
          if (tagis[Reference1.?] <> 0) then
            @text = field[name].text
          elseif (hero.tagis[Hero.Minion] <> 0) then
            @text = field[baseuiname].text
          elseif (state.isadvance <> 0) then
            @text = field[name].text
          else
            @text = field[baseuiname].text
            endif
          ]]></labeltext>
        </label>
      <mouseinfo mousepos="middle+above"><![CDATA[
        if (tagis[Helper.Disable] <> 0) then
          @text = "{b}This ability is currently disabled and may not be used{/b}"
        else
          @text = ""
          endif
        ]]></mouseinfo>
      </portal>
 
Ok, back to here as I'm working on advanements now, I looked at how Shadowrun does specialties and it has a chooser for the skills on the character and then based on the skill chosen limits the list of specialties available (if nothing is selected it shows them all).

So getting the list of Areas of Expertise itself was easy as I just set the candidate field to component.Expertise, but I'm not sure about getting the chooser. I figured I'd use a menu_things as that seemed like the best way to get a dynamically available list of skills (the requirement being skills with 3 or more ranks in them which is identified by the field Helper.CanExpert).

So I added a field to the Advance component to contain the menu choice and I created a portal that I was going to set to show only if the tag Advance.NeedsSkill is on it. I was in the template for new additions and I created this portal:

Code:
  <portal
    id="advSkill"
    style="menuNormal"
    width="275">
    <menu_things
      field="advSkill"
      component="Skill"
      usepicks="hero">
      <candidate><![CDATA[
        component.Skill & Helper.CanExpert
        ]]></candidate>
      </menu_things>
      </portal>

and I get this error

Code:
Hero Lab was forced to stop compilation after the following errors were detected:

Portal 'advSkill' - Reference to incompatible field type/style/behavior based on portal type
One or more timing errors were identified. Please review the timing report and correct the errors. You can access the report under the 'Develop' menu or by clicking this link.

the field code is

Code:
    <field
      id="advSkill"
      name="Chosen Skill"
      type="derived"
      style="menu">
      </field>

It seems to match the requirements of the field element of value based and menu style so I'm not sure what the problem is. If I comment out the portal the error goes away so I know there error is somewhere involving that.
 
Also, I'm trying to figure out how to stop picks from Advances from subtracting from skill points, Traits use (isuser + origin.ishero >= 2) but that doesn't work because the origin is a gizmo and not a hero, which means by default its not even subtracting them, I removed the ishero check, but that didn't work, I tried origin.isgizmo, but that threw an error, so I'm not really sure what to do to get this to not happen.
 
Also, I'm trying to figure out how to stop picks from Advances from subtracting from skill points, Traits use (isuser + origin.ishero >= 2) but that doesn't work because the origin is a gizmo and not a hero, which means by default its not even subtracting them, I removed the ishero check, but that didn't work, I tried origin.isgizmo, but that threw an error, so I'm not really sure what to do to get this to not happen.

Please clarify this, I'm not sure how you've got an advancement that's inside a gizmo.
 
style="menu" must always be combined with type="user", not type="derived" or type="static", because the user has to be able to control the menu's selection.
 
Back
Top