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)
-   -   How can I change the source and destination of an Edit dynamic table? (http://forums.wolflair.com/showthread.php?t=60420)

Duggan March 23rd, 2018 10:51 AM

How can I change the source and destination of an Edit dynamic table?
 
As I have covered before, I have a situation where Skills in my system (Planet Mercenary) can have Specialties added to them under certain circumstances (namely, specialties are particular to a given skill, most specialties are unique and can only be added once, and you can't have more specialties than you have ranks in the skill). At the time, it seemed the easiest way to do it was by borrowing some code from the Doctor Who implementation and setting up a Gizmo on the skills so that I could set up field that limited the Specialty choices to those that match up to the skill.

Code:

<portal
  id="prtSpec"
  style="tblNormal">
  <table_dynamic
    component="Specialty"
    showtemplate="SpecPick"
    choosetemplate="SpecPick2"
    scrollable="yes"
    alwaysupdate="yes"
    candidatepick="SpecHelp"
    candidatefield="SpecExpr"
    addpick="SpecHelp">
   
    <titlebar><![CDATA[
      @text = "Add a Specialty"
      ]]></titlebar>
    <!--headertitle><![CDATA[
      @text = "Specialty"
      ]]></headertitle-->
    <additem><![CDATA[
      @text = "Add Specialty"
      ]]>
      </additem>
    </table_dynamic>     
  </portal>

and set here:
Code:

<procedure id="SetSpcExpr" context="pick"><![CDATA[
  ~make sure there's a gizmo to travel to
  doneif (isgizmo = 0)
 
  ~set up our tag expression for selecting appropriate specialty
  var expr as string
  var myId as string

  expr = "component.Specialty & " & myId

  debug "expr: " & expr
  gizmo.childfound[SpecHelp].field[SpecExpr].text = expr
  ]]></procedure>

This results in the situation where the Specialty is added to the skill itself (or, I suppose to its Gizmo), and then shadowed onto the main Hero. The thing is, while this is the primary way for a user to add the Specialty, there are two other ways for it to happen. One, some backgrounds/command packages/sophont types give a bonus Specialty. Two, one of the options for Advancement is adding a Specialty. The second is not really a factor right now, but the former sort of is, in that any Specialty added via a background trait of some sort also shows up as a valid choice on the table, since it doesn't exist on the Skill in question.

TL;DR: Is there any way to set the "target" of the table to be the Hero instead of the Skill? Since skills are never deleted, there should never be a situation where it matters where the Specialty resides.

I can also provide more code. I'm trying to only quote the relevant bits.

Mathias March 23rd, 2018 10:58 AM

This is why, for Shadowrun, we didn't use gizmos for its skill specialties - all the specialties are in the hero container, and use tags and careful control of the visual elements to set things up so that the user only ever sees them attached to the correct skill.

You can shadow things down to a lower-level container, but there's no way to reverse-shadow, and get them to appear up a container level.

Duggan March 23rd, 2018 12:09 PM

{nods} So I might have to change where the items are stored... is there any way to at least keep the link so that the user selects Specialties for a given skill rather than from a grand list?

Mathias March 23rd, 2018 12:32 PM

Never mind - I was totally mis-remembering things.

It's that the normal specialties for a skill are added as child picks in the skill's gizmo, but then for specialties added from outside, those live in the hero pick. They use a script to add their name to a text field on the skill, and for the final display of that skill's name, with the specialties included, that list of external specialties is combined with the list of specialties inside the gizmo, in a way that makes it look to the user like everything is together.

When you look at the customization form for a skill, since in Shadowrun, external specialties can only be added in advancement mode, not in creation mode, in advancement mode, the table for adding specialties is not shown - instead, a text portal displays the combined list of specialties.


All times are GMT -8. The time now is 04:45 AM.

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