DICE PACKS BUNDLE
Page 1 of 3 123 Last
  1. #1
    Ikael's Avatar
    Join Date
    Jan 2008
    Location
    Finland/Joensuu
    Posts
    2,383

    How to add new Derived Stat tutorial

    Savage Worlds ruleset provides way to easily add new derived stats. You will still need to be able to create extensions for Fantasy Grounds to achive this, but if you're able to do it it will be piece of cake. This tutorial does not teach you how to do extension as is, you can find other fine documentations how to do them.

    There is only two things you need to do:
    • Create new xml template defining how new derived stat's base value is calculated. If you don't care about this, you can use default template: derivedstat_default instead
    • Register new derived stat in lua script.


    XML-template
    The following shows you what you can do in the template definition, there are several predefined values you can use. don't be scared yet, this only demonstrates everything you can do in the template, but you must only define things you actually need!!

    Code:
    <template name="DerivedStatTemplate"> <!-- name of the template, should be unique -->
        <derbase>
            <setup> <!-- within setup you can define how base value is calculated -->
              <attribute> <!-- base value can be from set of attributes -->
                  <sum/> <!-- you can define one of these values: sum, min, max, avg if nothing is included sum will be used -->
                  <min/>
                  <max/>
                  <avg/>
                  <half>Agility</half> <!-- you can include either half of full value -->
                  <full>Smarts</full>
              </attribute>
              <node> <!-- base value can be from any other nodes -->
                  <sum/>
                  <min/>
                  <max/>
                  <avg/>
                  <half>main.xp</half>
                  <full>pace</full>
              </node>
              <skill>  <!-- base value can be from any skill -->
                  <sum/>
                  <min/>
                  <max/>
                  <avg/>
                  <half>Fighting</half>
                  <full>Notice</full>
              </skill>
              <division>2</division>  <!-- value can be divided by someting -->
              <multiplier>3</multiplier> <!-- value can be multiplied by someting -->
               <modifier>1</modifier>  <!-- value can be modified by something -->
           </setup>
        </derbase>
    </template>

    • Basically Derived stat's base value can be calculated from attribute, skill or any other numberic node value OR any combination of these three. Let's call these "sources"
    • You can get either half or full value from above sources. For instance "Half of Fighting"
    • You can define one -- and only one of following: sum, min, max, avg. These values will determine how multiple sources are included in. If you define sum, then all values from different sources are summed together. In case of min or max only the minimum or maximum value from all possible sources counts. In case of avg the average o all source value is taken. Note that even if you are able to define these into different type of sources, only ONE and ONLY ONE is applied. If nothing is defined, then sum will be used.
    • After "sources" you can adjust the final value by providing division, multiplier and/or modifier.


    For example to define derived stat that's base value is "Minimum of Half of Notice or Half of Streetwise, + 2" you would define following:

    Code:
    <template name="ExampleDerivedStat1">
        <derbase>
            <setup>
              <skill>
                  <min/>
                  <half>Notice</half>
                  <half>Streetwise</half>
              </skill>
              <modifier>2</modifier>
           </setup>
        </derbase>
    </template>
    To define "one fifth of your current experience" you define following:

    Code:
    <template name="DerviedStatExample2">
        <derbase>
            <setup>
              <node>
                  <full>main.xp</full>
              </node>
              <division>5</division>
           </setup>
        </derbase>
    </template>
    "Half of Fighting + 2"

    Code:
    <template name="DerviedStatExample3">
        <derbase>
            <setup>
              <skill>
                  <half>Fighting</half>
              </skill>
              <modifier>2</modifier>
           </setup>
        </derbase>
    </template>
    "Average of Spirit and Vigor"

    Code:
    <template name="DerviedStatExample4">
        <derbase>
            <setup>
              <attribute>
                  <avg/>
                  <full>Spirit</full>
                  <full>Vigor</full>
              </attribute>
           </setup>
        </derbase>
    </template>
    Like mentioned above if you really don't care about calculation of base value you can skip this phase

    Register new Derived Stat in Lua
    This is the one-liner you must use to register your derived stat:

    Code:
    DerivedStatManager.registerDerivedStat("LongName", "ShortName", "NodeName", "DerivedStatTemplate", {charsheet=true, minisheet=true, npc=true, ct=true, ct_client=true})

    • The first argument is the name of the derived stat
    • The second argument is the short name of the derived stat
    • The third argument is the nodename of your derived stat. This should be unique!
    • The fourth argument is name of the xml-template you just define. Alternatively if you skipped the phase you should use value derivedstat_default
    • The last argument define in which view the derived stat is displayed in. There are following supported values: charsheet, minisheet, npc, ct and ct_client. If the value is set true then it's showed in. Values must be given within {}'s since they are a list.


    Give this a try and give us feedback!
    "Alright, you primitive screwheads, listen up: THIS... is my BOOMSTICK!" -- Ash Williams, Army of Darkness

    Post your SavageWorlds ruleset feature requests and issue reports here!

  2. #2
    Ok, so I played with this some today and the instructions here are excellent, thank you. That said I have an interesting stat to create that actually uses another derived stat in it's calculation. Is there a way I can do (half (spirit+Derived Stat A))+2?

    I tried this and I honestly didn't expect it to work but wasn't sure if there was any way to reference a created derived stat in this fashion.
    <template name="DerviedStat_Sanity">
    <derbase>
    <setup>
    <node>
    <half>Cha_Humanity</half>
    </node>
    <attribute>
    <half>Spirit</half>
    </attribute>
    <modifier>2</modifier>
    </setup>
    </derbase>
    </template>

  3. #3
    Ikael's Avatar
    Join Date
    Jan 2008
    Location
    Finland/Joensuu
    Posts
    2,383
    Quote Originally Posted by Coanunn View Post
    Ok, so I played with this some today and the instructions here are excellent, thank you. That said I have an interesting stat to create that actually uses another derived stat in it's calculation. Is there a way I can do (half (spirit+Derived Stat A))+2?

    I tried this and I honestly didn't expect it to work but wasn't sure if there was any way to reference a created derived stat in this fashion.
    If I recall right, yes you can reference another created stat. Just use the name which you gave it in LUA registration phase. Ie. In your case the third parameter in lua should be Cha_Humanity

    Hope this helps and sorry for late answer
    "Alright, you primitive screwheads, listen up: THIS... is my BOOMSTICK!" -- Ash Williams, Army of Darkness

    Post your SavageWorlds ruleset feature requests and issue reports here!

  4. #4
    Thanks a lot for the Tutorial Ikael. I've achieved to add 3 new Derived stats for Interface Zero 2.0 (while the official one doesn't come out), attached my extension if it interests anyone for using or learning.

    Edit: Updated the extension, there was a miscalculation on Street Cred derived stat.
    Last edited by Dr0W; August 10th, 2015 at 22:04.

  5. #5
    Doswelk's Avatar
    Join Date
    Jul 2005
    Location
    Surrey, UK
    Posts
    2,679
    I think you will find that IZ 2.0 will be around soon...
    My players just defeated an army, had a dogfight with aliens, machine-gunned the zombies, stormed the tower, became Legendary and died heroically

    Yours are still on combat round 6

    Get Savage
    Ultimate License Holder.
    First GM to post a game for the original FG Con!

  6. #6
    I'm saving my credits for it.

  7. #7
    Mask_of_winter's Avatar
    Join Date
    Feb 2009
    Location
    USA Eastern Time Zone (GMT -5/-4)
    Posts
    2,479
    Blog Entries
    1
    Quote Originally Posted by Doswelk View Post
    I think you will find that IZ 2.0 will be around soon...
    promises, promises :P
    Writer for Just Insert Imagination and co-host of the Wild Die Podcast.
    Find me on G+ to get in on one-shots, check out my YouTube and Twitch channel and follow me on Twitter @Mask_of_Winter

  8. #8
    Holy Sh.. Doswelk! It's already out!

  9. #9
    Quote Originally Posted by Dr0W View Post
    Holy Sh.. Doswelk! It's already out!
    https://www.fantasygrounds.com/store...p?id=GMGIZ20FG

  10. #10

    Join Date
    Apr 2020
    Location
    Pfaffenhofen, Bavaria
    Posts
    10
    Hello Ikael,
    I am fairly new to Fantasy Grounds and I am in need to add a derived stat to my Savage World campaign. I stumbled upon this tutorial, but I still have a couple of questions. Where do I place the xml-File? Does it have to be in the campaign directory e.g.:

    ...\Fantasy Grounds\campaigns\SevenWorlds

    Which lua-File do I have to update and where to place it? In the above directory there is the CampaignRegistry.lua file. Do I use that one?

    Best wishes and keep up the good work.
    Deryl

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in