PDA

View Full Version : Looking for a new derived trait sample



g0ntzal
April 18th, 2016, 21:21
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

Skellan
April 18th, 2016, 21:34
This might be helpful

https://www.fantasygrounds.com/forums/showthread.php?13133-Realms-of-Cthulhu-Extension&p=152740&viewfull=1#post152740

g0ntzal
April 18th, 2016, 21:45
This might be helpful

https://www.fantasygrounds.com/forums/showthread.php?13133-Realms-of-Cthulhu-Extension&p=152740&viewfull=1#post152740

Thanks Skellan, but It looks like the link has been removed!!!

Skellan
April 18th, 2016, 21:49
Oh, I think you just need to scroll up a bit

Mask_of_winter
April 18th, 2016, 23:39
This too from Ikael should show you how to code a new derived stat: https://www.fantasygrounds.com/forums/showthread.php?26363-Savage-Worlds-API

g0ntzal
April 19th, 2016, 06:06
This too from Ikael should show you how to code a new derived stat: https://www.fantasygrounds.com/forums/showthread.php?26363-Savage-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:


?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

Ikael
April 19th, 2016, 23:02
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:


?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

g0ntzal
April 21st, 2016, 07:34
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...

Ikael
April 21st, 2016, 14:26
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:


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

g0ntzal
April 21st, 2016, 19:18
Thanks Ikael... Taking the info from your two replies I've get it... Thanks so much.