• 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

Pick up a mix of picks on the hero and on the current item

Duggan

Well-known member
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
 
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.
 
Back
Top