Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old March 3rd, 2018, 07:28 PM
Currently, for my Skill component, I have an eval statement like the following:
Code:
<!-- Display Name without values for use on Skills Tab -->
<field
  id="sklTabName"
  name="Display Name (Tab)"
  type="static"
  maxlength="50"
  maxfinal="50">
  <finalize><![CDATA[
    ~Displays name
    @text = field[name].text
    var numAoE as number
    var i as number
    
    var specText as string
    foreach pick in gizmo where "component.Specialty"
      i += 1
      if (i > 1) then
        specText &= ", "
        endif
      specText &= eachpick.field[name].text
      nexteach
          
    if (empty(specText) = 0) then
      @text &= " (" & specText &")"
      endif
    
    ]]></finalize>
  </field>
This is meant to display the skill name followed by a list of specializations on it. This works for specializations added via the button by the skill on that tab, but there are two other sources of specializations, one being the various backgrounds associated with the character (for example, being the Captain gets you the Military specialization for History) and another being gaining the Specialty through an Advance. All of the Specialties get Forwarded onto the Hero, but I'm at a loss to determine whether a given Specialty matches the skill that I'm evaluating.

I think that the solution will probably involve tagmatch, but I keep getting an "Invalid id specified for tag group" error with the following replacement, even though the "Skill" group exists as an Identity tag for the skills, and both the Specialty and the Skill have a corresponding tag:

Code:
foreach pick in hero where "component.Specialty"
  if (eachpick.tagmatch[Skill, Skill, initial] <> 0) then
    i += 1
    if (i > 1) then
      specText &= ", "
      endif
    specText &= eachpick.field[name].text
    endif
  nexteach
Duggan is offline   #1 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old March 3rd, 2018, 08:25 PM
Hm... I got it working with tagsearch, but only because I know there's only one tag present.

Code:
~ There should just be one
var skTag as string
skTag = tagids[Skill.?]
debug "Skill tag: " & skTag

var specText as string
foreach pick in hero where "component.Specialty"
  debug "Name: " & eachpick.field[name].text & " Tags: " & eachpick.tagids[Skill.?] & " tagsearch: " & eachpick.tagsearch[skTag]
  if (eachpick.tagsearch[skTag] <> 0) then
    i += 1
    if (i > 1) then
      specText &= ", "
      endif
    specText &= eachpick.field[name].text
    endif
Now, to try to find a way to make the button to add specialities to respect the values from those other sources... and the same for Advances.
Duggan is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old March 11th, 2018, 01:52 PM
I've never had any sucess with tagmatch. I always use intersect[] for this type of testing.
Mathias is offline   #3 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old March 11th, 2018, 04:16 PM
Thank you.
Duggan is offline   #4 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:19 AM.


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