View Single Post
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

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