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

Old December 19th, 2017, 04:39 AM
I'm trying to use the Savage Worlds tutorial to aid setting up the Planet Mercenary system, but this isn't working correctly for some reason. When I add a Specialty via an Advance, it adds simply enough, but I get charged the cost of adding it. I had thought that that was forestalled with the "doneif (isuser = 0)". Is it because of the displacement?

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"/>
  
  <!-- All advancements need to displace themselves to the hero -->
  <displace target="hero">TRUE</displace>

  <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>
Duggan is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,173

Old December 19th, 2017, 07:28 AM
The specialties were chosen by the user, on the add an advance form, right?

Here's another piece of code from the skeleton files:

Code:
    <!-- Each skill point 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 skill is not added directly to the hero (i.e. an advance), skip it entirely
      doneif (origin.ishero = 0)

      ~adjust the resource appropriately
      hero.child[resCP].field[resSpent].value += field[trtUser].value * 2
      ]]></eval>
Mathias is offline   #2 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,149

Old December 19th, 2017, 07:33 AM
I tried using the "origin.ishero" code, but if I do that, then they cost nothing both for advances and for buying them off of the skills page.

I think part of the problem is that, in both cases, it's not being added directly to the hero, but to a gizmo. They just happen to be two different entities, one of which should require points and the other of which should not.
Duggan is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,173

Old December 19th, 2017, 07:58 AM
Wait, during character creation, you're having them bought like advances? The process of adding an advance takes so many clicks to complete that I'd recommend avoiding making users go through that in character creation.

In that case, add an autotag to that table, and use that autotag to distinguish between the two sources of these picks.
Mathias is offline   #4 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,149

Old December 19th, 2017, 08:09 AM
Good point about the tagging. And no, they're separate ways of doing it. Advances are done via the Advances tab in the usual way, while the Skills tab has a button, which invokes a form, from which the user can add or remove Specialties. The Gizmo was the only way I could find to allow me to key the Specialties off of a particular skill, and works fairly well, other than a potential for duplication of entries, although so far that can only happen if you switch between Advancement and Creation. I suspect that I can probably fix that too, but it's in the "nice to have" column.

I'll let you know how the tagging goes.
Duggan is offline   #5 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,149

Old December 19th, 2017, 08:50 AM
Worked like a charm. I added a "doneif(tagis[Advance.Gizmo] <> 0)" and it doesn't charge items off of the Advancement.

Thank you, Mathias!

Could I ask if you have any insight on my question here about how I might add the gizmo in a bootstrapped Thing?
Duggan is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,173

Old December 19th, 2017, 09:12 AM
I am pretty lost as to what you're trying to do in that thread, and this is not a week that I can take the time to study that in detail.
Mathias is offline   #7 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,149

Old December 19th, 2017, 09:51 AM
That's cool. After the beta, I suppose. ^_^
Duggan is offline   #8 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 08:57 AM.


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