DICE PACKS BUNDLE
Page 1 of 3 123 Last
  1. #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,

    Timbo
    Last edited by Timbo1974; May 17th, 2012 at 13:52. Reason: Added extension.

  2. #2
    phantomwhale's Avatar
    Join Date
    Aug 2007
    Location
    Melbourne, Australia
    Posts
    1,370
    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>
    You'll need one line for each XML file, and one line for each "standalone" script (e.g. a script that does stuff without being used as part of a windowclass). You can happily scan the SavageWorlds ruleset for lots of examples of these (the file is called base.xml in the ruleset - extension.xml is for extensions, but they look the same).

    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
    Better stop myself here before I give away the answer

    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.

  3. #3
    Doswelk's Avatar
    Join Date
    Jul 2005
    Location
    Surrey, UK
    Posts
    2,679
    Quote Originally Posted by phantomwhale
    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...
    Indeed I know Weird War II has a similar hindrance and I think Necropolis does as well, I know two GMs who would be very happy to see this...
    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!

  4. #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

  5. #5
    phantomwhale's Avatar
    Join Date
    Aug 2007
    Location
    Melbourne, Australia
    Posts
    1,370
    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.

  6. #6
    Quote Originally Posted by phantomwhale
    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.
    Aha I was looking back over the code for the quickHandler earlier and noticed that... and then promptly forgot all about it *sigh* My youngest hasn't been too well and I've had very little sleep over the last two days so not probably the best time to pick up another coding project.

    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.

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

  8. #8
    Mask_of_winter's Avatar
    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

  9. #9
    Quote Originally Posted by Mask_of_winter
    We playtested the extension this weekend. It worked as intended. Thanks Timbo!
    Ah that's fantastic, I'm just glad someone found it useful.

    Timbo

  10. #10
    ShotGun Jolly's Avatar
    Join Date
    Aug 2009
    Location
    St. Johns, NL, Canada
    Posts
    717
    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

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