Thread: War of the Dead: Slow Shamblers
-
May 16th, 2012, 08:44 #1
War of the Dead: Slow Shamblers (now with added Extension)
Howdy,
I'm looking at running a War of the Dead campaign some time on the future and in attempt to learn a little about creating modules I've been working my way through getting chapter one into FG.
One thing I've added but I'd like to automate in the combat tracker is the "Slow" special ability. Basically all I want to do is make sure that any character/personality with Slow gets redealt cards until their card is 5 or less.
I've found the references for Quick in the main SW files and I think I could just hack Slow along side it in there but I'd rather put it in a seperate module.
So where would I begin to do this? I don't expect anyone to give me all the code, in fact I'd much prefer to work through this myself. I'd just rather not stumble around in the dark for a month or two only to have someone eventually say "nah that won't work: do it this way." Just a reference to an xml file node or lua file line number would be a great help.
Additionally if there's another module out there that has already implemented something like this could you let me know what it is and I'll grab that and start digging.
Thanks in advance,
TimboLast edited by Timbo1974; May 17th, 2012 at 13:52. Reason: Added extension.
-
May 16th, 2012, 12:00 #2
Excellent project - esp. as I made combat tracker edges nice and extensible to support exactly this !
You'll need a directory in your extensions folder called "MyWarOfTheDeadExtension" or anything you like. You'll zip up all the files in this folder and put a .ext extension on it eventually, but for now just having that directory will let you play with it.
Inside there you'll first need an extension.xml file - this is the "base" file that bootstraps everything. It should look something like this :
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Copyright SmiteWorks USA, LLC., 2011 -->
<root version="2.8">
<properties>
<name>My awesome extension</name>
<version>1.0</version>
<author>My Name</author>
<description>Adds Slow support and stuff</description>
<ruleset>
<name>SavageWorlds3</name>
<minrelease>3.2</minrelease>
</ruleset>
</properties>
<base>
<includefile source="an_xml_file.xml" />
<script name="NameOfScriptThatIsntTooImportant" file="scripts/my_script_name.lua" />
</base>
</root>
Then, you'll need to write some actual code and make sure you reference the files in this file ! You can actually define windowclasses in the extension.xml file, but best practice suggests keeping windowclass definitions in separate files (how they are organised beyond that is probably more a matter of taste than convention).
It might just be one script file you need, thinking about it - that was probably overkill advice ! I would expect it to have an onInit() method like so :
function onInit()
InitiativeManager.registerAbilityHandler("slow", "SLOW", slowHandler)
end
function slowHandler(wActorGroup, tCard, fDraw)
-- Left as exercise for reader
end
Any questions, just shout. Don't forget to post the solution up on the forums (as an .ext file) - I know a couple of people asked about this a while back...Former SW ruleset / Deadlands extension author. Now I just wanna play a few games. And maybe hack. A little.
-
May 16th, 2012, 17:03 #3Originally Posted by phantomwhaleMy 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
First GM to post a game for the original FG Con!
-
May 17th, 2012, 10:41 #4
Almost There
Firstly I have to say a HUGE thanks to phantomwhale for your help, it's greatly appreciated and I'll make sure to post the results here ASAP.
As for the code well it's done... almost.
I've got the extension working with the following code but I'm getting an error on the msg.text = wCombatantGroup.getName() line. I suspect this is a global variable or scope issue, which may not be fixable.
I come from a Delphi/Powershell background so this whole thing is a bit of a crash course in LUA. I've looked through a few of the other lua files and put my (limited) Google-fu to task but couldn't find any hints on how to solve this sooooo I thought I'd once again ask for help. If it's not do-able then I can easily change the line to state something like "Dealt an X and redealing due to Slow" or something like that.
Code:function slowHandler(wActorGroup, tCard, fDraw) local msg = {font = "systemfont"} if OptionsManager.isOption("ARIN", "on") then while tCard.getValue().getOrder() > CardLib.Value.five.getOrder() do msg.text = wCombatantGroup.getName() .. " was dealt the " .. tCard.displayName() .. "; redealing" ChatManager.deliverMessage(msg) tCard = fDraw() end elseif tCard.getValue().getOrder() > CardLib.Value.five.getOrder() then msg.text = wCombatantGroup.getName() .. " was dealt the " .. tCard.displayName() .. " and may redraw" ChatManager.deliverMessage(msg) end return tCard end
-
May 17th, 2012, 12:50 #5
Ah - when I gave you the sample code, it was from my latest, greatest version of the software, where clearly I have decided the "Combatants" are actually "Actors" (as sometimes it's not a combat, it might be a chase or a social dillema).
Details aside, the error is a simple one. One of the parameters passed into the slowHandler function is called "wActorGroup" - that is the "window contained the actor group". If you change that parameter name to "wCombatantGroup", then it should work.Former SW ruleset / Deadlands extension author. Now I just wanna play a few games. And maybe hack. A little.
-
May 17th, 2012, 13:51 #6Originally Posted by phantomwhale
Anyway thanks again phantomwhale.
Even though my total input in this process has been nothing more than replacing a ">=" with a "<" I think I can say I've got bug. FG is an amazing piece of software as it is but the ability to write some code and extend it just helps us get one step closer to the ultimate RPG dream: rules without (too much) paperwork.
So without further ado here it is, version 1.0 of the extension: Attachment 2495.
-
May 17th, 2012, 14:05 #7
- Join Date
- Feb 2009
- Location
- USA Eastern Time Zone (GMT -5/-4)
- Posts
- 2,479
- Blog Entries
- 1
I'm running a game this weekend so I'm gonna grab this extension and let you know how it went. Thanks in advance!
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
-
May 21st, 2012, 13:54 #8
- Join Date
- Feb 2009
- Location
- USA Eastern Time Zone (GMT -5/-4)
- Posts
- 2,479
- Blog Entries
- 1
We playtested the extension this weekend. It worked as intended. Thanks Timbo!
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
-
May 21st, 2012, 15:28 #9Originally Posted by Mask_of_winter
Timbo
-
May 23rd, 2012, 19:23 #10
I would very much like to get this extension.. As I too play WoTD Where can I find it *Edit* in the module?
Last edited by ShotGun Jolly; May 24th, 2012 at 04:16.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks