DICE PACKS BUNDLE
  1. #1

    Looking for a new derived trait sample

    Hi,

    Can you share with me a very simple extension for adding a derived trait. My attempts are not getting results!!!

    Thanks in advance,

    Gon

  2. #2
    Skellan's Avatar
    Join Date
    Jul 2012
    Location
    Staffordshire, UK
    Posts
    2,479
    Ultimate License Holder - My games are free to play
    Timezone: GMT

  3. #3
    Quote Originally Posted by Skellan View Post
    Thanks Skellan, but It looks like the link has been removed!!!

  4. #4
    Skellan's Avatar
    Join Date
    Jul 2012
    Location
    Staffordshire, UK
    Posts
    2,479
    Oh, I think you just need to scroll up a bit
    Ultimate License Holder - My games are free to play
    Timezone: GMT

  5. #5
    Mask_of_winter's Avatar
    Join Date
    Feb 2009
    Location
    USA Eastern Time Zone (GMT -5/-4)
    Posts
    2,479
    Blog Entries
    1
    This too from Ikael should show you how to code a new derived stat: https://www.fantasygrounds.com/forum...age-Worlds-API
    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

  6. #6
    Quote Originally Posted by Mask_of_winter View Post
    This too from Ikael should show you how to code a new derived stat: https://www.fantasygrounds.com/forum...age-Worlds-API
    This is the info I tried to use before asking for help. I created an extension with a single file inside (extension.xml) And this is the content:

    Code:
    ?xml version="1.0" encoding="iso-8859-1"?
    root version="3.0"
    	properties
    		 name Cordura Addon /name 
    		 version 1.0 /version 
    		 author Gon /author 
    		 description Atributo derivado para Weird Wars Rome /description 
    		 ruleset 
    			 name SavageWorlds /name 
    		 /ruleset 
    	 /properties 
    	 base 
    		 script name="Cordura" 
    			function onInit()
    				DerivedStatManager.registerDerivedStat(1, "Cordura", "Cordura", "cordura", "derivedstat_cordura", {charsheet=true, minisheet=true, npc=true, ct=true, ct_client=true})
    			end
    		 /script 
    	 /base 
     /root

  7. #7
    Ikael's Avatar
    Join Date
    Jan 2008
    Location
    Finland/Joensuu
    Posts
    2,383
    Quote Originally Posted by g0ntzal View Post
    This is the info I tried to use before asking for help. I created an extension with a single file inside (extension.xml) And this is the content:

    Code:
    ?xml version="1.0" encoding="iso-8859-1"?
    root version="3.0"
    	properties
    		 name Cordura Addon /name 
    		 version 1.0 /version 
    		 author Gon /author 
    		 description Atributo derivado para Weird Wars Rome /description 
    		 ruleset 
    			 name SavageWorlds /name 
    		 /ruleset 
    	 /properties 
    	 base 
    		 script name="Cordura" 
    			function onInit()
    				DerivedStatManager.registerDerivedStat(1, "Cordura", "Cordura", "cordura", "derivedstat_cordura", {charsheet=true, minisheet=true, npc=true, ct=true, ct_client=true})
    			end
    		 /script 
    	 /base 
     /root
    I bet you have not defined template derivedstat_cordura which is causing issues. Check the Derived Stats API, there is comment that you can use derivedstat_default if you don't want to provide own template implementation
    "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!

  8. #8
    Quote Originally Posted by Ikael View Post
    I bet you have not defined template derivedstat_cordura which is causing issues. Check the Derived Stats API, there is comment that you can use derivedstat_default if you don't want to provide own template implementation
    I missed that comment, Ikael. I've modified the derivedstat_cordura and now I'm using derivedstat_default. I don't get any error message but I can't see the Cordura derived stat yet...

  9. #9
    Ikael's Avatar
    Join Date
    Jan 2008
    Location
    Finland/Joensuu
    Posts
    2,383
    Quote Originally Posted by g0ntzal View Post
    This is the info I tried to use before asking for help. I created an extension with a single file inside (extension.xml) And this is the content:

    Code:
    ?xml version="1.0" encoding="iso-8859-1"?
    root version="3.0"
        properties
             name Cordura Addon /name 
             version 1.0 /version 
             author Gon /author 
             description Atributo derivado para Weird Wars Rome /description 
             ruleset 
                 name SavageWorlds /name 
             /ruleset 
         /properties 
         base 
             script name="Cordura" 
                function onInit()
                    DerivedStatManager.registerDerivedStat(1, "Cordura", "Cordura", "cordura", "derivedstat_cordura", {charsheet=true, minisheet=true, npc=true, ct=true, ct_client=true})
                end
             /script 
         /base 
     /root
    One significant error I noticed from your code is that you are invoking DerivedStatManager.registerDerivedStat and passing number as the first parameter. You should pass number as the first parameter only if you use DerviedStatManager.registerDerivedStatToIndex function. The first number parameter in the function is the order number of your new derived stat. You can change your code to:

    DerivedStatManager.registerDerivedStat("Cordura", "Cordura", "cordura", "derivedstat_cordura", {charsheet=true, minisheet=true, npc=true, ct=true, ct_client=true}
    "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!

  10. #10
    Thanks Ikael... Taking the info from your two replies I've get it... Thanks so much.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 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