Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Pick up a mix of picks on the hero and on the current item (http://forums.wolflair.com/showthread.php?t=60296)

Duggan March 3rd, 2018 07:28 PM

Pick up a mix of picks on the hero and on the current item
 
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 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.

Mathias March 11th, 2018 01:52 PM

I've never had any sucess with tagmatch. I always use intersect[] for this type of testing.

Duggan March 11th, 2018 04:16 PM

Thank you.


All times are GMT -8. The time now is 07:13 PM.

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