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,207

Old October 3rd, 2017, 08:01 AM
Another one of those things I just can't seem to wrap my head around despite looking at the examples. A given Race or Command Package can give the player a free skill Specialty. When I had skill Specialties be something that was on the hero itself, rather than a pick on the child entity attached to the Skill, so this was as simple as a bootstrap entry on the Race or Command Package, and an it_bootcustom in the editor entry. Well, that no longer works and I can't quite figure out how to make it work.

A given Specialty has a tag to indicate which skill it's matched up to, e.g.
Code:
<!-- Thermal Skill Specialty -->
<thing
  id="spPercThrm"
  name="Thermal"
  compset="Specialty"
  isunique="yes"
  description="Apply this specialty when using an organ or apparatus that senses temperature. If you can “see” in infrared, then your Sight specialty applies instead, and you should lord that up over lesser creatures by talking about how lovely everything looks.">
  <tag group="Skill" tag="skPercept"/>
</thing>
The specialty is attached via an entity (in traits.str)
Code:
<entity
  id="entSpec"
  form="frmSpec">
  <bootstrap thing="SpecHelp"/>
</entity>
SpecHelp and Specialty are, of course, defined earlier in the file:
Code:
<component
  id="Specialty"
  name="Specialization"
  autocompset="no"
  panellink="skills">
  
  <!-- Display Name for use on Specialties Tab -->
  <field
    id="spcTabName"
    name="Display Name (Tab)"
    type="static"
    maxlength="50"
    maxfinal="50">
    <finalize><![CDATA[
      ~Displays name
      @text = field[name].text & " (" & this.tagnames[Skill.?," "]  & ")"
      ]]></finalize>
    </field> 
  
  <identity group="Specialty"/>
  
  <tag group="SpecialTab" tag="Specialty"/>

  <!-- Track the ability on the actor -->
  <eval index="1" phase="Setup" priority="5000"><![CDATA[
    perform forward[Specialty.?]
    perform parent.assign[User.HasSpec]
    ]]></eval>
    
  <!-- Each specialty that is allocated by the user costs 2 CP -->
  <eval index="2" phase="Traits" priority="10000">
    <before name="Calc resLeft"/>
    <after name="Bound trtUser"/><![CDATA[
    ~if this speciality wasn't added by the user (as with a Background trait), skip it entirely
    doneif (isuser = 0)

    ~adjust the resource appropriately
    hero.child[resCP].field[resSpent].value += 2
  ]]></eval>
</component>    

<!-- Specialty Helper component
      Each Specialty Gizmo derives from this component
-->

<component
  id="SpecHelp"
  name="Specialty Helper">

  <!-- Selection Tag Expressions -->
  <field
    id="SpecExpr"
    name="Specialization Tag Expression"
    type="derived"
    maxlength="500">
    </field>

  </component>
It all works well enough from the UI, with users able to add and remove specialties, but I'm uncertain as to how to a) bootstrap it from the Thing that is the Command Package or the Race and b) how to add it to the editor so that a user can create a Command Package and pick what Specialties get automatically added.
Duggan is online now   #1 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,207

Old October 5th, 2017, 06:55 AM
Looks like it's here that explains how to do this, but I can't check until I get home.
Duggan is online now   #2 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,207

Old October 5th, 2017, 07:17 PM
Hmm... and no, no luck with that. However, I am 90% of the way there. I am currently instead adding a tag to the BGTrait and using the following script to find the relevant Skill and modify it. But I am still figuring out how to actually bootstrap the pick:

Code:
<eval index="2" phase="Setup" priority="3001" name="Add BG Specializations">
  <![CDATA[
  var myId as string
  myId = tagids[Specialty.?," & "]
  debug "myID: " & myId
  
  foreach thing in Specialty where myId
    var indID as string
    indID = eachthing.idstring
    var skillIDs as string
    debug "indID: " & indID
    
    skillIDs = eachthing.tagids[Skill.?, " & "]
    debug "skillIDs: " & skillIDs
    foreach thing in Skill where skillIDs
      debug "Add " & indID & " to skill " & eachthing.idstring
      ~Add a pick for the Specialization to the Skill.
      nexteach
    nexteach
    ]]></eval>
Duggan is online now   #3 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,207

Old October 11th, 2017, 07:38 PM
And... somewhere between posting that and now, I managed to lose it such that the bootstrap is no longer showing up in the BGTrait. Still plugging away at ways of getting at this.
Duggan is online now   #4 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,207

Old October 28th, 2017, 06:17 AM
Coming back to this, I'm all the way up to adding the pick to the Gizmo via the script... and I don't know how to go about it. Here are the Gizmo picks for a skill that has a Specialty:


The SpecHelper is something that lets me constrain the choices of which Specialties can be picked for that skill and then there's the Beam specialty. How can I add a new one from a script? Or is that something that is possible?
Attached Images
File Type: png Gizmo Picks.png (94.1 KB, 42 views)
Duggan is online now   #5 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,207

Old November 3rd, 2017, 05:27 PM
Following the current pattern, I'd think something like "addChild" to parallel "findChild" but no luck there. If all else fails, I guess I could start by bootstrapping everything and then instead deciding whether to enable it? But, then again, I don't know how that will interact with adding things by tables, plus it seems like that would require adding everything explicitly.
Duggan is online now   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,367

Old November 3rd, 2017, 10:50 PM
Wait, bootstrapping by script? I'm sorry I didn't notice that earlier to keep you from spending time on that. You cannot use a script to create something that needs to run its own scripts, because HL sets up a list of scripts and the order to run them in before running any of them, so it can't add new scripts to that list later on, so it can't have a pick added by a script.

Last edited by Mathias; November 3rd, 2017 at 10:52 PM.
Mathias is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,367

Old November 3rd, 2017, 10:52 PM
Forms don't have to show picks within the gizmo - you can press a button on one pick that opens up a list of picks on the hero - like all the specialties. That's how Shadowrun handles it. And then just build a text list of the specialties for that skill for display on that skill.

That way, the advancements for specialties add them to the hero, like everything else, and then the skills figure out what specialties they've got.
Mathias is offline   #8 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,207

Old November 4th, 2017, 06:22 AM
OK. So no script.

Am I handling it the wrong way above, by making it an entity? That seemed like the only way I could set it up so that the form accessible off of the Skill entry restricted the Specialties to those associated with the skill.
Duggan is online now   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,367

Old November 4th, 2017, 08:34 AM
If you make it an entity, you cannot use an advancement to add picks within that gizmo, because the displacement used by advancements can only be to the hero, not to a different container.
Mathias is offline   #10 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 04:51 AM.


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