DICE PACKS BUNDLE
Page 1 of 2 12 Last
  1. #1

    Custom Playing Cards

    Right, started on part of creating an extension, but unsure what to do as code. Extension is for Savage Worlds, creating custom playing cards for different settings. As far as images go, I started with Deadlands Reloaded all that is left is to export images and name them, but will eventually make one for each.

    I am guessing that all would initially need done is to create a bit of code that redirects which folder it draws the card images from. After that I am unsure on whether it would be better to simply make each set a different extension or to add to the preferences (or somewhere else) a selector of which card set you would prefer.

    I have some experience programming, but am rather unfamiliar with LUA and FG structure.

    MODERATOR: Moved to new thread.
    Last edited by Trenloe; October 20th, 2013 at 10:39.
    Location: Central Pa (East -5)
    Ultimate License Holder
    Current Campaign: Necessary Evil
    Current Project: Dawn of Daikaiju: Converting, Deadlands: Reloaded The last Sons - Quality Assurance Checking
    Discord: Mgrancey#4994
    "Mad Science" means never stopping to ask "what's the worst thing that could happen?" -- Maxim 14 of The Seventy Maxims of Maximally Effective Mercenaries
    Adventure: Keep Living Life Like There's No Tomorrow and You'll Eventually Be Right,

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Are you looking to change the normal playing card deck images?

    If so, which images are used are specified in the \graphics\graphics_cards.xml file in the base SavageWorlds ruleset.

    For example:
    Code:
    <root>
      <icon name="AceClubs" file="tokens/cards/Ace of Clubs.png" />
      <icon name="AceDiamonds" file="tokens/cards/Ace of Diamonds.png" />
      <icon name="AceHearts" file="tokens/cards/Ace of Hearts.png" />
      <icon name="AceSpades" file="tokens/cards/Ace of Spades.png" />
      <icon name="BlackJoker" file="tokens/cards/Black Joker.png" />
      <icon name="CardBack" file="tokens/cards/ct_card_place.png" />
    ...
    Your extension could simply contain a modified \graphics\graphics_cards.xml file that points to different image files (tokens) to use for each card in the deck. Then include a new directory in the \tokens directory within the extension that contains the modified token files.

    Here is the current location of the standard playing card tokens in the Savage Worlds ruleset:



    So, your extension would really just need a directory holding all of your new card tokens and the modified \graphics\graphics_cards.xml file that is modified to point to the relevant new tokens.

    This is the most straightforward way of doing theme changes and would require that each different card "theme" would be in a separate extension, only one of which would need to be activated before loading the campaign.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    I had found the folder holding the cards and their images, but was unsure about if there was anything extra that was needed for the code inside the extension. So I just need to make a copy of the original "graphics\graphics_cards.xml" file and edit it the links so they simply point towards the new images?

    If so this will be fairly easy, real easy if Notepad++ would quit being so fussy.

    Would it possible for you to edit this thread and add a poll for other settings that people would like see done first after Deadlands Reloaded?
    Last edited by Mgrancey; October 20th, 2013 at 13:21.
    Location: Central Pa (East -5)
    Ultimate License Holder
    Current Campaign: Necessary Evil
    Current Project: Dawn of Daikaiju: Converting, Deadlands: Reloaded The last Sons - Quality Assurance Checking
    Discord: Mgrancey#4994
    "Mad Science" means never stopping to ask "what's the worst thing that could happen?" -- Maxim 14 of The Seventy Maxims of Maximally Effective Mercenaries
    Adventure: Keep Living Life Like There's No Tomorrow and You'll Eventually Be Right,

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by Mgrancey View Post
    Would it possible for you to edit this thread and add a poll for other settings that people would like see done first after Deadlands Reloaded?
    It's probably best for you to start a new thread with a poll - I'm not sure all of the options you want in the poll so it would be better for you to create a poll with the options you want, plus this is a bit of a technical thread about how to use custom cards so best to keep a poll and discussion about that separate.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    Then include a new directory in the \tokens directory within the extension that contains the modified token files.
    Is there a particular way this should be done? I was just going to do a module with the tokens added then extension points at them, but it doesn't seem to be finding them.
    Location: Central Pa (East -5)
    Ultimate License Holder
    Current Campaign: Necessary Evil
    Current Project: Dawn of Daikaiju: Converting, Deadlands: Reloaded The last Sons - Quality Assurance Checking
    Discord: Mgrancey#4994
    "Mad Science" means never stopping to ask "what's the worst thing that could happen?" -- Maxim 14 of The Seventy Maxims of Maximally Effective Mercenaries
    Adventure: Keep Living Life Like There's No Tomorrow and You'll Eventually Be Right,

  6. #6
    Does your extension.xml file have a pointer to your overridden graphics_cards.xml file?

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by Mgrancey View Post
    Is there a particular way this should be done? I was just going to do a module with the tokens added then extension points at them, but it doesn't seem to be finding them.
    Anything contained in a module has to be referenced as <item name in module>@<module name>

    For this extension I really wouldn't recommend using card tokens from a separate module. This would mean that the extension won't work at all without the module being installed as well. If you plan on distributing the extension then this will avoid a lot of "my extension doesn't work" posts be users who haven't installed the 2 required files to 2 different directories.

    Also, as Debinani says, files in an extension that are being used need to be activated in the extension.xml <base> section.

    I've written a quick example extension for you that replaces the Ace of Clubs card with a Test Card image - all contained within the same extension. See the attached file:

    Attachment 5319
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  8. #8

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    You can actually just put the contents of the graphics_cards.xml file right into the extension.xml file.

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by Andraax View Post
    You can actually just put the contents of the graphics_cards.xml file right into the extension.xml file.
    You could, but then that doesn't really help people who may look at your extension to understand what it is overriding from the standard ruleset. Also, if the extension is broken by a future FG ruleset upgrade (or someone else's extension) then having the changes/files used matching the normal ruleset will help people see where changes were made and so know where to look for fixes. Just having a long list of specific XML changes/additions/overrides in the extension.xml file will work, but won't help others coming after in understanding how it all hangs together and making it easy to keep the extension up-to-date and enjoyable by the community long after the original owner has moved on.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  10. #10
    so I can put the new card images just in a tokens/<folder> as part of the extension. That was what I wasn't sure about. Thanks. I already had the graphicx_card.xml working since the old cards weren't showing up.

    Thanks for the LUA code to announce its use as well.
    Location: Central Pa (East -5)
    Ultimate License Holder
    Current Campaign: Necessary Evil
    Current Project: Dawn of Daikaiju: Converting, Deadlands: Reloaded The last Sons - Quality Assurance Checking
    Discord: Mgrancey#4994
    "Mad Science" means never stopping to ask "what's the worst thing that could happen?" -- Maxim 14 of The Seventy Maxims of Maximally Effective Mercenaries
    Adventure: Keep Living Life Like There's No Tomorrow and You'll Eventually Be Right,

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
  •  
FG Spreadshirt Swag

Log in

Log in