PDA

View Full Version : Setting Extension idea



Ikael
September 7th, 2010, 17:53
I started "playing" with the Savage Worlds ruleset yesterday and the first thing that I had in mind was capability to add additional devired stats into the character sheet. The core code was not flexible enough to allow that easily (without adding several lines of code, scripts and logic). This made me think if derived stats and attributes could be revised to have more flexible way to configure them.

I made this small extension that revised how attributes and derived stats work in the ruleset: They can be configured in one simple file and you can actually make your own extension of that configuration file and apply it to have different sets of attributes and derived stats. I attached the extension itself (which I call unofficial revision) and an example setting extension that changes the attributes and derived stats to something different.

from the SavageWorlds_examplesetting.ext archieve you can find following file: scripts/customized_properties.lua and inside it there is simple configuration such as:



attributes = {
{ ["nodename"] = "agility",
["name"] = "Dexterity",
["short"] = "Dex"
},
{ ["nodename"] = "smarts",
["name"] = "Reasoning",
["short"] = "Rea"
},
{ ["nodename"] = "spirit",
["name"] = "Willpower",
["short"] = "Wil"
},
{ ["nodename"] = "strength",
["name"] = "Strength",
["short"] = "Str"
},
{ ["nodename"] = "vigor",
["name"] = "Constitution",
["short"] = "Con"
}
}

derivedstats = {
{ ["name"] = "Pace",
["base"] = "8"
},
{ ["name"] = "Parry",
["base"] = "fighting/2+2"
},
{ ["name"] = "Toughness",
["base"] = "vigor/2+2"
},
{ ["name"] = "Dodge",
["base"] = "dexterity"
},
{ ["name"] = "Muscle",
["base"] = "(Constitution+Strength)/2+2"
}
}


In that file you can setup your attributes and derived stats. For attributes you can setup any number of attributes (however the charactersheet is only capable to display 5 of them at the moment) and give them name and shortnames, which can be referenced laterwards. For derived stats you can set any number of them (but the charactersheet can only display five of them at the moment) and give them a name and a formula how their base value is calculated.

However this is still experimental extension idea and lack few things like, it does only affect PC charactersheet and not for example NPC sheets and combat tracker (yet). There is also one minor bug where your fresh created skill doesn't affect your derived stats unless you close/reopen your character sheet. In the future there is also menace of changing the datasource names due to different structure in fixed entries and lists etc plaah... which means that it won't be fully compatable with earlier created campaigns (you might lose derived stat and attribute information, be careful).

Anyways, I would like to hear some comments and improvement ideas anyhow related to this idea because I am not so familiar with Savage Worlds (especially with all those different fancy settings) and it would really help me to understand what should and should not be done with this kind of idea.

PS: The image attached shows what you get if you enable both extensions.

VenomousFiligree
September 7th, 2010, 21:38
Look forward to getting home tomorrow and trying it out.

Ikael
September 8th, 2010, 16:26
Just finnished the 2nd version of the extension. Currently attributes and derived stats can be declared for evyerbody, including PCs, NPCs and they work in the Combattracker too. In addition character sheet's main page scales and is able to display more than 5 attributes and derived stats if declared. Here is a list what core classes this extension affects:

- charsheet_main
- charsheet_mini
- npc_combat
- combattracker_entry
- minitracker

Backward compatability is not supported in this version but it's possible to implement such a automated converter but it's on the very low priority at the moment.

Next possible update could contain ability to configure wounds such as you could add new wound types (like sanity/madness in cthulhu setting) and set up how many hits PCs could take before getting inc. (I am not sure about this one, but maybe in some other setting you can endure more than 3 wounds, no?). Any thoughts, ideas or suggestions about this extension?

VenomousFiligree
September 8th, 2010, 18:36
Wow good stuff! Makes my RoC extension obsolete! :) In Savage Suzerain you have 3 fatigue, not heard of anymore than 4 wounds though.

Doswelk
September 8th, 2010, 19:09
NPCs Don't work for me, however I do not use the Standard SW Ruleset though I really should these days (I have a Dev version with loads of extra "features").

Is SavageWorldsInstaller-3.0.8.msi the latest official version?

WIth the quality of the unofficial patches and the new extensions being added I want to go back to the official version.

Ikael
September 8th, 2010, 21:28
I use SavageWorldsInstaller-3.0.8.msi as base but I have also included some of the latest patches to the extension (including npc sheet). How is you NPC sheet not working or maybe how should it work?

EDIT: I did notice that there is something wicked going on with the bare extension, combattracker and npc sheet is not working like it should be. Probably I am just missing some dependiencies to base classes.

Ikael
September 8th, 2010, 21:58
The extension attached earlier had old codes included into it, that's why NPC and combat tracker didn't work properly. Now I tested this newly attached extension with the BARE version of SW (not with the version which was used to develope the extension itself) and it worked fine after I reassemled the extension's content.

Thank you Doswelk for letting me know about this! Developer is always blind behind his back :p

Ikael
September 9th, 2010, 11:27
Updated the extension to version 3. This new update includes possibility to configure damanges, ie what kind of damage types there is and how many hits character can endure each. Current configuration file is presented below. nodename property means to what node the value will be stored in db.xml, name is how the property is displayed in the sheets and short is just a shorthand version of the full name. For derived stats base property is how the base value is calculated and this property may consist any declared attribute or skill from your character sheet and some mathematcal expression such as ()'s +,-, / and * to calculate the value. combat property is for determining if given item is combat oriented or not (this will determine where the item is displayed on sheets). For damages/tolerance max property is how many hits PCs can take, penalties is how much much penalties PC get from each hit, penaltydescription is the description of the damage itself and combattracker property declared which damage type is displayed on the combat tracker. Note that only one will be displayed in the combat tracker and it will be the first item with this property set to true.



-- Attributes
attributes = {
{ ["nodename"] = "agility",
["name"] = "Agility",
["short"] = "Agi"
},
{ ["nodename"] = "smarts",
["name"] = "Smarts",
["short"] = "Sma"
},
{ ["nodename"] = "spirit",
["name"] = "Spirit",
["short"] = "Spi"
},
{ ["nodename"] = "strength",
["name"] = "Strength",
["short"] = "Str"
},
{ ["nodename"] = "vigor",
["name"] = "Vigor",
["short"] = "Vig"
}
}

-- Derivated Stats
derivedstats = {
{ ["nodename"] = "pace",
["name"] = "Pace",
["short"] = "Pace",
["base"] = "6",
["combat"] = true
},
{ ["nodename"] = "parry",
["name"] = "Parry",
["short"] = "Parry",
["base"] = "fighting/2+2",
["combat"] = true
},
{ ["nodename"] = "toughness",
["name"] = "Toughness",
["short"] = "Tough",
["base"] = "vigor/2+2",
["combat"] = true
},
{ ["nodename"] = "charisma",
["name"] = "Charisma",
["short"] = "Cha",
["base"] = "0",
["combat"] = false
}
}

-- NPCs additional Derivated Stats
npc_additional_derivedstats = {
{ ["nodename"] = "armor",
["name"] = "Armor",
["short"] = "(Armor)",
["combat"] = true
}
}

-- Tolerance
tolerance = {
{ ["nodename"] = "wounds",
["name"] = "Wounds",
["max"] = 3,
["penalties"] = {-1, -2, -3},
["penaltydescription"] = "Wound Penalty",
["combat"] = true,
["combattracker"] = true,
},
{ ["nodename"] = "fatique",
["name"] = "Fatique",
["max"] = 2,
["penalties"] = {-1, -2},
["penaltydescription"] = "Fatigue Penalty",
["combat"] = true,
["combattracker"] = false
}
}

Ikael
September 9th, 2010, 14:19
The development goes on really rapid rate with this extension. Version 3.1 attached here and it includes minor updates to core functionality that were discussed above. In addition I added exclusiongroup-tag to the setting extension that only one setting extension can be applied. Plus I made second example setting extension: Realm of Cthulhu (as it's the only setting that I know little bit). The image tell more than thousand gibberish words.

Doswelk
September 9th, 2010, 23:58
Okay what have I done wrong?

I get a console error: Script Error: [string "scripts/charsheet_tolerancelist.lua"]:5: bad arguement #1 to 'pairs' (table expected, got nil)

Below is my properties_customized.lua


-- Attributes
attributes = {
{ ["nodename"] = "agility",
["name"] = "Agility",
["short"] = "Agi"
},
{ ["nodename"] = "smarts",
["name"] = "Smarts",
["short"] = "Sma"
},
{ ["nodename"] = "spirit",
["name"] = "Spirit",
["short"] = "Spi"
},
{ ["nodename"] = "strength",
["name"] = "Strength",
["short"] = "Str"
},
{ ["nodename"] = "vigor",
["name"] = "Vigor",
["short"] = "Vig"
},
{ ["nodename"] = "wealth",
["name"] = "Wealth",
["short"] = "$"
}
}

-- Derivated Stats
derivedstats = {
{ ["nodename"] = "pace",
["name"] = "Pace",
["short"] = "Pace",
["base"] = "6",
["combat"] = true
},
{ ["nodename"] = "parry",
["name"] = "Parry",
["short"] = "Parry",
["base"] = "fighting/2+2",
["combat"] = true
},
{ ["nodename"] = "toughness",
["name"] = "Toughness",
["short"] = "Tough",
["base"] = "vigor/2+2",
["combat"] = true
},
{ ["nodename"] = "charisma",
["name"] = "Charisma",
["short"] = "Cha",
["base"] = "0",
["combat"] = false
},
{ ["nodename"] = "sanity",
["name"] = "Sanity",
["short"] = "San",
["base"] = "spirit/2+2",
["combat"] = true
},
{ ["nodename"] = "languages",
["name"] = "Languages",
["short"] = "lang",
["base"] = "smarts/2",
["combat"] = false
}
}

Ikael
September 10th, 2010, 02:00
You haven't declared any tolerance items (damage types) in your configuration file. You should at least include following to your properties_cutomized.lua.



-- Tolerance
tolerance = {
{ ["nodename"] = "wounds",
["name"] = "Wounds",
["max"] = 3,
["penalties"] = {-1, -2, -3},
["penaltydescription"] = "Wound Penalty",
["combat"] = true,
["combattracker"] = true,
},
{ ["nodename"] = "fatique",
["name"] = "Fatique",
["max"] = 2,
["penalties"] = {-1, -2},
["penaltydescription"] = "Fatigue Penalty",
["combat"] = true,
["combattracker"] = false
}
}


these are the basic damage propeties, if you don't provide any of then the system will go boom!

Doswelk
September 10th, 2010, 08:21
D'oh!

Ta :o

phantomwhale
September 10th, 2010, 10:22
Perhaps a default setting could be provided ? Then people only need to overwrite the bits they need.

Ikael
September 10th, 2010, 11:09
Indeed that's good idea. The default setting is provided in the main extension itself but yes you're correct it should be own setting extension as well! I did also minor update to the main extension where npc_additional_derivedstats is only optional. Earlier it was compulsory to declare those. In addition I did add the "Terror" derivedstat for NPCs in ROC setting extension.

Ikael
September 12th, 2010, 14:21
Although I mentioned earlier that no backward compatability will be supported in this extension I found out that it's easy to implement it. The solution is datasource converter tool. You can enable this extension with the unofficial revision extension and open the conversion menu by typing /convert to the chat. From the menu you can select direction of the conversion, either from core ruleset to extension (probably the thing you want) or from extension to the core ruleset.

What this means in general is that you can convert your earlier campaign data to fit for the revision extension (if you want to use it). However you SHOULD backup your campaign before using this tool, just in case because you can destroy your campaign data if you misuse this tool! Just be careful when selecting to which direction you can to convert your campaign.

Mask_of_winter
September 18th, 2010, 16:41
hey Ikael, you think you could make your "time stamp" extention available for us savages?

Ikael
September 18th, 2010, 22:00
I wonder what "time stamp" extension are you referring at here? The only thing to come in my mind is the campaign calendar extension, but isin't that already available for SW?

Mask_of_winter
September 18th, 2010, 22:27
When I played with you Unisystem ruleset, you had a feature on there that allowed the GM to send a time stamp into the chat window like : "October 30th 2009". You know what I mean now?

Ikael
September 19th, 2010, 08:29
That "time stamp" feature was indeed converted to an extension which works for any rulesets. You can find it from following link: Campaign Calendar (https://www.fantasygrounds.com/forums/attachment.php?attachmentid=1053&d=1264356972). Inside that archieve file you find two extensions, one that is the campaign calendar extension itself and the other that's calendarsystem example. By default the campaign calendar uses gregorian calendar system, but you can decalre any calendar system by making calendarsystem extension (just check out how the example calendarsystem extension is made). You can drag the date from any field to the chat to display the current time

Mask_of_winter
September 19th, 2010, 13:11
Thanks for the link!

Ikael
October 7th, 2010, 17:39
This extension along with all the other goodies are now uploaded to FGWiki and can be found from following direct link (https://oberoten.dyndns.org/fgwiki/index.php/Savage_Worlds_Unoffical_Revision).

dittotb
October 11th, 2010, 00:38
When I added your extension, (and thank you for the time spent), no errors come up when I convert but if I go to use a monster from a beastiary all of the stats appear to have been reset to d4 and the derived stats are all '0'.
Have I done something wrong?

Ikael
October 11th, 2010, 06:32
I believe the Beastinary is a part of module. At the moment NPCs written in module are not compatable with the extension because their datasource is fixed to the old one and converter's scope affects only to the local database of your campaign. However I believe that this issue is fixable/doable by checking that is the NPC source is static then it would run the conversion to that NPC automatically. I will see what I can do about this soon.

Thanks for letting me know, I did miss this thing when implementing the extension

Ikael
October 11th, 2010, 09:56
I did make update to the extension where NPC data is automatically converted to new datasources at the first time you open the NPC window.

EDIT: I updated the updated version as I realized how to previous quirks can be dealt with!
EDIT: The extension is now uploaded to the FGWiki

dittotb
October 11th, 2010, 17:27
Thank you for your quick response.
I will check it out when I am able to.
This is such a great online community.

Ikael
March 21st, 2013, 17:47
Now I don't want to rise a dead, but this idea is getting back into my workqueue. I want to re-implemented and refactor this into part of SWFI to easy setting up different derived stats and wounds types. However this time it will be more easily maintainable and is optional. Any ideas what should be taken account when redesigning this? What different SW setting uses, provides and what things should be configurable? Where different derived stats should be displayed etc. I don't have much experience with different SW setting that has new derived stats or wounds and that's why I am asking you. What would you like to have?

Draeus
March 22nd, 2013, 13:06
Fantastic addition Ikael! Keep up the good work!

nethru
March 23rd, 2013, 00:36
Would really love to see a Realms of Cthulhu one again. Sanity/Corruption/Madness.

Thanks!

chillybilly
March 23rd, 2013, 15:44
This is a great addition. A RoC touch would be wonderful. Anyway, thanks for all the heard work on this, it suits my needs nearly perfectly!

Two questions: What do the little stars next to weapons that you can highlight do? What does the "E" by the weapons mean? (something about inventory maybe?)

Is there a guide to sue this ruleset?

Okay, that was 3 questions but thanks again!

Isembard
March 23rd, 2013, 16:01
RoC would be amazing!

Ikael
March 23rd, 2013, 18:13
This is a great addition. A RoC touch would be wonderful. Anyway, thanks for all the heard work on this, it suits my needs nearly perfectly!

Two questions: What do the little stars next to weapons that you can highlight do? What does the "E" by the weapons mean? (something about inventory maybe?)

Is there a guide to sue this ruleset?

Okay, that was 3 questions but thanks again!

Star is for marking that given entry is favorite and it will be displayed in PC's minisheet. E states that attack is a weapon/gear/equipment which can be found from inventory. Natural attacks, for instance are not E/equipment and doesn't have weight etc.

I would like to make doc, but my time is limited (too much to develope :)) and the extension is going to get merged into core ruleset so maybe some more talented in documenting could help me doing it someday.

Ikael
March 23rd, 2013, 21:15
Would really love to see a Realms of Cthulhu one again. Sanity/Corruption/Madness.

Thanks!

Realm of Cthulhu is also my keypoint to drag me doing this. What I would like to hear is some ideas where these new derived stats and wounds (the madness) should be displayed in the ruleset? -- In addition what other factors there could be in other settings. I would like to make this more generic solution and that's why I am asking. Anyways here is what I have planned so far:


Register new derived stats and how they are calculated (sanity, corruption)
Register new wound types (madness), and allow setting up how many default dots each can have (in some setting there are place for 3 fatigue points)
Allow altering how many wound type dots there is per PC. For instance I have seen that in some setting a person could have 4 wounds because of some cybernetics etc.
Each registred derived stat can be marked to be displayed in PC and/or NPC sheet. "Grit" is not displayed in NPC sheet (??)
Each wound type can be marked to be displayed in combat tracker
Capability to unregister or alter any existing derived stat/wound type


Other ideas what to take account here?

What this actually requires is that I need to re-implement how these datas are being displayed in sheets and trackers. Registration and management is easy part. The main reason for this idea is to make it _easier_ to create different set of dervied stats/wound types to suit different SW settings and ease follow up maintenance of various commercial products.

chillybilly
March 24th, 2013, 14:40
Ikael,
First thank you VERY much for the love and attention you've given to SW. Your extension has basically breathed new life in the SW ruleset for me and my player's campaign.

The ideas you mentioned would be very valuable.

I also have a suggestion for those of us using a hybrid SW/GUMSHOE-the Trail of Cthulhu rules: is it possible to add a "Stability" attribute next to Sanity? Conversely, is it possible to track both a permanent sanity value and the player's current sanity value? In some variations of the rules, it's possible to only temporarily lose points from those stats. Not the end of the world if it's not accomplish-able, it would just be the icing on the cake of an already delicious extension.

At any rate, I couldn't be more impressed and pleased with this extension. My players were almost giddy when I introduced the features in the extension to them.

Ikael
March 26th, 2013, 10:35
This feature is progressing nicely, yesterday spend only few hours and Character Sheet's dynamic Dericed Stats are ready see the attachment. Next I am going to carry on to NPC sheet and Combat Trackers. Adding new derived stats is very simply (requires just few lines of xml and one line of lua, and the system will place your new derived stat to correct place automatically). After Derived Stats I am doing the Damage types and that's it for the first version!

Second thing that came to my mind is that I could even provide set of different setting's derived stats out-of-the-box. Host would be able to select (activate) any pre-defined settings on from preferences window view and.... boom, all requires derived stats/damage types are there without need to enable separate extension etc.

Now this would require that I would know what different derived/damage type settings there are in other settings. And are there some other differences? I would love to hear from people who know more about setting differences

Ikael
March 26th, 2013, 13:49
And dynamic Derived Stats is ready, see the attachment of my playground. Below is the sample piece of code how new derived stats can be added using this system:

Lua codes, here you need to register new derived stats to the ruleset. You need to give it a name, databasenodename, windowclass representing how the base value is calculated, and viewlist of where the given derived stat should be rendered


DerivedStatManager.registerDerivedStat("Sanity", "sanity", "derivedstat_sanity", {charsheet=true, minisheet=true, ct=true})
DerivedStatManager.registerDerivedStat("Corruption", "corruption", "derivedstat_default", {charsheet=true, minisheet=true, ct=true})
DerivedStatManager.registerDerivedStat("Grit", "grit", "derivedstat_grit", {charsheet=true, minisheet=true, ct=true})


XML codes where each derived stat needs to have windowclass to states how it's calculated.


<template name="derivedstat_sanity">
<derbase>
<setup>
<attribute>
<half>Spirit</half>
</attribute>
<modifier>2</modifier>
</setup>
</derbase>
</template>
<template name="derivedstat_grit">
<derbase>
<script>
function update()
local xp = source.getValue()
if xp then
setValue(math.max(math.min(1 + math.floor(xp/20), 5), 0))
end
end
function setSource(sourceNode)
source = sourceNode
source.onUpdate = update
update()
end
</script>
</derbase>
</template>


Next the damage types...

S Ferguson
March 26th, 2013, 19:42
So when are you going to stop to take a breather. All this coding must keep you up late at night :p !

phantomwhale
March 26th, 2013, 22:05
I don't think he sleeps... seriously...

Ikael
March 26th, 2013, 22:11
I do sleep, dance salsa, take care of my dog and even eat meanwhile :) Thou I happen to have extra vacation without bigger plans so I can do stuff that has been bugging me long-long-long time :)

Ikael
March 27th, 2013, 01:03
Here some screenshots of progression. All features are written, next some cleanuping and debugging. Thou I will slow down my pace now since I will have something else nice to deal with startin from tomorrow :)

S Ferguson
March 27th, 2013, 03:18
You Salsa? I didn't think it was indicative of your region. And take care of a dog, sleep, and still churn out code? Unbelievable :).

Ikael
March 27th, 2013, 18:52
I think that's it. Dynamic derived stats & damage types feature is now complete. Unofortunately it's based on unreleased SW v3.4 codebase so I cannot provide it for you yet. Meanwhile you can take alook on the attached image of showcase #1: Realms of Cthulhu. In addition I provided you "sneakpeak" extension which is the complete ROC setting extension, but notice: that it is not compatible with SWFI 0.71 or lesser. You will need to wait for SW v3.4 ruleset to come out first!

I could call this teasing, but I just want to show how easy it is to setup different derived stats and damage types and they work like "build-in" ones (including auto-apply if you like). I am also more than ever, willing to hear more about what differences there could be in SW settings. What should be taken account? -- Any shootouts are approciated.

I have also requested from Phantomwhale if he would want to review this feature and we might see it in core SW as well, but if not, it will be in next SWFI extension release.

PS: The extension is only about 100 lines of code to provide all that. I could have been fine with 50 or less, but I wanted to slightly make some items look prettier in the screen. At best you could be ok with 5 lines of code if you don't care for automatization.

EDIT: Attachment removed.

Ikael
July 21st, 2013, 22:25
This idea has now been implemented into core SW v3.4 ruleset as experimental feature.