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)
-   -   Why does my Specialty added via an Advance still cost points? (http://forums.wolflair.com/showthread.php?t=59779)

Duggan December 19th, 2017 04:39 AM

Why does my Specialty added via an Advance still cost points?
 
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>


Mathias 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>


Duggan 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.

Mathias 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.

Duggan 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 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?

Mathias 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.

Duggan December 19th, 2017 09:51 AM

That's cool. After the beta, I suppose. ^_^


All times are GMT -8. The time now is 05:34 PM.

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