Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old September 12th, 2014, 02:08 PM
Shadowrun stores the calculated cost in a field - trtAdvCost, and the calculations of that field's value is inbetween the if...elseif and the final line in the original script. You can replace what's there with whatever calculations are needed for your game.
Mathias is offline   #11 Reply With Quote
Gomo
Member
 
Join Date: Apr 2014
Posts: 50

Old September 12th, 2014, 02:11 PM
I had similar code but in other component:
Code:
  <component
    id="CanAdvance"
    name="Can Advance"
    ispublic="no">

    <!-- Each advancement needs its own identity tag to support denial of duplicate advancements -->
    <identity group="IsAdvance"/>

    <!-- Each advancement needs its own identity tag to restrict enhancement to existing advances -->
    <identity group="CanAdvance"/>

    <!-- All advancements need to displace themselves to the hero -->
    <displace target="hero">Helper.Displace</displace>

    <!-- Forward all advancement tags up to the containing gizmo.
        NOTE! Only do this when we're within an advancement gizmo and NOT the hero.
        -->
    <eval index="1" phase="Setup" priority="3000"><![CDATA[
      if (tagis[Advance.Gizmo] <> 0) then
        perform forward[IsAdvance.?,origin]
        endif
      ]]></eval>

    <!-- Forward the advancement allowed tag up to the hero -->
    <eval index="2" phase="Setup" priority="3000"><![CDATA[
      perform hero.setidentity[CanAdvance]
      ]]></eval>

    <!-- If this thing is unique, forward its identity advancement tag to the hero
        NOTE! This is needed to enable deny tags so we avoid adding an existing trait again.
        NOTE! We only need to do this for user-added things.
        -->
    <eval index="3" phase="Setup" priority="3000"><![CDATA[
      if (isunique <> 0) then
        if (isuser <> 0) then
          perform hero.setidentity[IsAdvance]
          endif
        endif
      ]]></eval>

    <!-- If this is an increase, add one to the trait, and subtract one for a decrease -->
    <eval index="4" phase="Traits" priority="2000"><![CDATA[
      ~we only worry about this on actual advances - not traits added at creation
      doneif (tagis[Advance.Gizmo] = 0)

      ~apply any appropriate increase or decrease for the linked trait
      ~Note: This pick is a child of the gizmo and our parent pick is the actual "Advance"
      ~       pick that contains the appopriate "Advance" tag, so be sure to check there.
      ~Note: Since the advancement is displaced to the hero, it's "parent" is *not* the
      ~       gizmo, so we must explicitly reference through the "origin" container.
      if (origin.parent.tagis[Advance.Increase] > 0) then
        linkage[basis].field[trtAdv].value += 1
		~linkage[basis].field[trtBonus].value += 1
      elseif (origin.parent.tagis[Advance.Decrease] > 0) then
        linkage[basis].field[trtAdv].value -= 1
		~linkage[basis].field[trtBonus].value -= 1
        endif
		      ]]></eval>

    </component>
Gomo is offline   #12 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old September 12th, 2014, 02:21 PM
Looks like it's just a matter of modifying script #4 in that code - add some more lines to the end after you increase trtAdv that calculate the cost.
Mathias is offline   #13 Reply With Quote
Gomo
Member
 
Join Date: Apr 2014
Posts: 50

Old September 12th, 2014, 02:37 PM
I tried to just move the script which calculate the cost to that component, but it seams that it mess up something with advancing abilities which uses other resources.
Anyway you gave me some clues how could I make it different -I'll make some test.
Thanks
Gomo is offline   #14 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old September 12th, 2014, 02:40 PM
Remember to consider the order scripts will execute in - in the Skeleton files, the script that adds the cost of an advancement to the resource:

Code:
    <!-- Each advancement consumes its cost in accrued advances -->
    <eval index="1" phase="Setup" priority="5000"><![CDATA[
      #resspent[resAdvance] += field[advCost].value
      ]]></eval>
Is at Setup/5000

The change I'm having you make means that the calculation of the cost doesn't happen until Traits/2000 - later than Setup/5000. So, you'll also need to change the timing of the script that records the cost on the resource so that it happens after you calculate the cost, instead of before.
Mathias is offline   #15 Reply With Quote
Gomo
Member
 
Join Date: Apr 2014
Posts: 50

Old September 13th, 2014, 07:34 AM
Yeah, I have made it work, but after that I realized that adding a skill in advancement (as "gain new skill") complicates things and then I've made some test with adding a new incrementer for advancement but after that I moved that incrementer to skill tab instead of advancement tab, so right now I have a skill in skill tab with two incrementers - one for creation and one for advancement - it is not related to advancement mode but right now it works.
Thanks for help.
Gomo is offline   #16 Reply With Quote
Reply


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 09:21 AM.


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