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)
-   -   Duplicate skills showing up in debug selection (http://forums.wolflair.com/showthread.php?t=60847)

risner June 28th, 2018 01:27 PM

Duplicate skills showing up in debug selection
 
3 Attachment(s)
I'm creating a skill that is similar to Pathfinder's Craft skills. I've intentionally used many of the same Helper and identity tags as Pathfinder. Everything visually works (viewing skills, adding skills) but looping on pick in hero show duplicate records.

Code:

      foreach pick in hero from Skill where "Helper.ExtraSkill"
      debug "Extra: " & eachpick.idstring
      nexteach

This shows:
Extra: skJobacco
Extra: skJobacco
Extra: skJobacco
Extra: skJobatt
Extra: skJobatt
Extra: skJobsmu
Extra: skJobsmu

Why?

Sample skill:
Code:

  <thing
    id="skJobacc"
    name="Job (accountant)"
    compset="Skill"
    isunique="yes"
    uniqueness="useronce"
    description="Description goes here">
    <tag group="DashTacCon" tag="NonCombat"/>
    <tag group="Helper" tag="TrainOnly"/>
    <tag group="Helper" tag="ExtraSkill"/>
    <link linkage="skillabil" thing="attrCha"/>
    </thing>

Compset and Component:
Code:

  <component
    id="Skill"
    name="Skill"
    autocompset="no">
    <linkage linkage="skillabil" optional="no"/>
    <identity group="Skill"/>
    <identity group="SkillAdded"/>
    <eval index="1" phase="Setup" priority="5000"><![CDATA[
      if (tagis[Helper.ExtraSkill] <> 0) then
        if (isuser = 0) then
          if (tagis[thing.useronce] <> 0) then
            perform forward[SkillAdded.?]
            endif
          endif
      else
        perform delete[SkillAdded.?]
        endif
      if (container.ishero <> 0) then
        perform linkage[skillabil].pullidentity[SkillAbil]
        endif
</componet>
  <compset
    id="Skill">
    <compref component="Skill"/>
    <compref component="Derived"/>
    <compref component="Trait"/>
    </compset>

portal code:
Code:

  <portal
    id="baSkills"
    style="tblInvis">
    <table_dynamic
      component="Skill"
      showtemplate="baSklPick"
      showsortset="explicit"
      choosetemplate="SkillThing"
      scrollable="yes">
      <list>thing.user_added | !Helper.ExtraSkill</list>
      <candidate>SkillAdded.?</candidate>
      <headertitle><![CDATA[
        @text = "Skills"
        ]]></headertitle>
      <additem><![CDATA[
        @text = "Add a Skill"
        ]]></additem>
      </table_dynamic>
    </portal>
  <template
    id="baSklPick"
    name="Skill Pick"
    compset="Skill">
...
    </template>
  <template
    id="SkillThing"
    name="Skill Thing"
    compset="Skill"
    marginhorz="3"
    marginvert="5">
...
    </template>


risner June 28th, 2018 04:07 PM

Adding:
Code:

  <compset
    id="Skill"
    forceunique="yes">

products the error Comonent set requires designation of thing as unique.

It doesn't appear to happen in Pathfinder, so I'm wondering what I'm doing differently.

Duggan June 28th, 2018 06:46 PM

Quote:

Originally Posted by risner (Post 267576)
Adding:
Code:

  <compset
    id="Skill"
    forceunique="yes">

products the error Comonent set requires designation of thing as unique.

It doesn't appear to happen in Pathfinder, so I'm wondering what I'm doing differently.

I can answer that one, I think. forceunique requires all items to be designated that way, which would mean any Skill not explicitly set as unique would cause that error.

Duggan June 28th, 2018 06:54 PM

Possibly relevant

Quote:

Uniqueness: Even if a shadowed or displaced pick is unique, it will not be merged with other picks in the shadow container, even other shadowed or displaced picks. Uniqueness is observed normally in the "owner" container.

risner June 28th, 2018 08:39 PM

Hmm. I threw a huge debug:
20x Extra: skJobacco|Shadow 0|Displace 0|Bootstrapped|Pick|Anon|Creation
19x Extra: skJobacco|Shadow 0|Displace 0|User|Pick|Anon|Creation
19x Extra: skJobatt|Shadow 0|Displace 0|Bootstrapped|Pick|Anon|Creation
19x Extra: skJobsmug|Shadow 0|Displace 0|Bootstrapped|Pick|Anon|Creation

It seems they are only different by bootstrap vs user picked.

Code added:
Code:

      var s as string
      foreach pick in hero from Skill where "Helper.ExtraSkill"
      s = "Extra: " & eachpick.idstring & "|Shadow " & eachpick.shadowed
      s &= "|Displace " & eachpick.displaced
      if (eachpick.isuser <> 0) then
        s &= "|User"
      else
        s &= "|Bootstrapped"
        endif
      if (eachpick.ispick <> 0) then
        s &= "|Pick"
      else
        s &= "|Thing"
        endif
      if (eachpick.isgizmo <> 0) then
        s &= "|Giz"
        endif
      if (eachpick.autonomous <> 0) then
        s &= "|Anon"
        endif
      if (eachpick.creation <> 0) then
        s &= "|Creation"
        endif
      if (eachpick.isminion <> 0) then
        s &= "|Minion"
        endif
      if (eachpick.ismaster <> 0) then
        s &= "|Master"
        endif
      debug s


risner July 15th, 2018 11:07 AM

Ultimately the problem was fixed by updating bootstrap to exclude auto bootstrapping the job types not always on characters.


All times are GMT -8. The time now is 03:33 AM.

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