STAR TREK 2d20
Page 1 of 17 12311 ... Last
  1. #1
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291

    Basic Card Tables Extensions

    A new version has been added to the FGU Forge here: https://forge.fantasygrounds.com/shop/items/97/view Subscribing via the forge will allow you to get updates via the FG update process.

    Use the version from the Forge if you're using FG Unity - the extension at the bottom of this post is for FG Classic only!

    The direct download is available in post #138 in this thread here: https://www.fantasygrounds.com/forum...l=1#post612080 But that probably won't be kept up-to-date.

    Based off this thread I decided to write a small extension to allow basic random card drawing functionality.

    The main goal behind this extension is to be as lightweight as possible and keep underlying code changes to a minimum - allowing it to be used in all/most CoreRPG based rulesets and helping to keep future upgrade issues to a minimum. As such, it has very basic functionality. I'll continue development of this, but thought I'd share it with you now.

    Versions

    v0.7: April 22nd, 2020. Minor update - message in chat to indicate deck needs shuffling when trying to get a card from an empty deck. Thanks superteddy57!
    v0.6: FG v3.2.2 compatibility plus clearing any existing assigned dice when a table is changed to a card table.
    v0.5: FG v3.1.7 compatibility and critical table issue fix.
    v0.4: Added "Auto?" option to automatically check cards as they are "drawn". Ordered the table so that drawn cards are at the bottom of the list. Enabled players to draw and reset decks shared with them.
    V0.3: Adds a "Cards?" option to the table to turn card use on/off. Fixed module die roll not updating when card used. Previous downloads: 9.

    How does it work?

    Step 1 - Create a table in your campaign and click the "Cards?" option (1) to show the "Used?" values (3) after each table row. If you want the used checks automatically selected as cards are "dealt" then select the "Auto?" topion (2). Info on campaign tables here: https://www.fantasygrounds.com/wiki/index.php/Tables

    Attachment 13495

    #2: This extension adds a "Used?" check button to each row in a table. When checked, the table row will have it's number range blanked out so it will not be included in future rolls on the table. This can be seen in the following screenshot where "The Betrayal" card has been marked as used and removed from the number range. The "card" is still in the table (so it can be used later) but it will not be included in table rolls until the "Used?" check is removed.

    Attachment 13498


    Resetting the "card deck"

    When you want to reset the card deck, right click on any of the rows and select the "Reset All Cards" radial menu option:

    Attachment 13496


    Setting it up

    When you create your table, don't enter any number values - just add the number of rows you need and then right-click on one of the rows and select "Reset All Cards". This will auto fill out the numbers, starting at 1. Note that each line will have a number range of 1 (e.g. 10-10) if you want multiple cards then enter them on multiple rows.

    A roll example
    Here is an example roll based of the table shown in the first screenshot.

    1. The GM, or player, "deals" two cards by pressing the dice icon in the table twice.
    2. The two cards dealt are automatically marked as used and are put at the bottom of the list.
    3. The two cards dealt are shown in the chat window, including any links from the table.
    4. Clicking on the link in the chat window (or the table) will open the link - images representing the card faces in this example.


    Attachment 13497


    NOTE: The extension can now automatically check the "Used" indicator, if the GM has selected the "Auto?" option for the table. If "auto?" isn't selected the GM has to manually check off the cards. This can simulate a "re draw" if the first result is not acceptable. Or, if "Auto?" is enabled and a re-draw is needed, the GM can put the card back in the deck by deselecting the "Used?" check mark.

    What is this simulating?

    This extension is simulating a card deck that has been shuffled and cards are drawn one at a time from the card deck. Cards that have been drawn can either be put back in the deck at random (the GM unchecks "Used?") or removed from the deck and not included in the next draw (the "Used?" indicator is checked). When the GM want's to shuffle back any used cards then they reset the card deck.

    This does not simulate a deck where cards are taken off the top and put back at the bottom. But it does simulate a complete shuffle of a deck and removing cards from a shuffled deck.

    Existing tables

    This works with existing tables - the "Cards?" check button is added to existing tables if this extension is enabled. If you don't want this to break non-card tables then don't select this check button and if you do, don't click any of the "Used?" check buttons as this will change the number ranges.

    Known Issue
    - If a new table is created through the right-click menu it will show the "Used" check boxes when first opened. Close the table and re-open it to show no check boxes.
    - Occasionally, on the player side, a table with a lot of cards will display one less card used/die roll. But the die roll will be correct.

    Previous downloads: 758

    Use the version from the Forge if you're using FG Unity - the extension file below is for FG Classic only!
    Attached Files Attached Files
    Last edited by Trenloe; February 27th, 2022 at 21:05.
    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!

  2. #2
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    That's very cool, it will work well with the module I created for the harrow deck.
    Last edited by Blackfoot; January 31st, 2015 at 21:25.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  3. #3
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    A little odd behavior... the extension is causing the 3rd column to wrap... no matter how wide I make the table.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  4. #4
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    Also seems to do something a bit odd with the sort after you click the box.. makes it pretty hard to find the next card to click.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    I only tried it with single columns. I'll look into the anchoring for more than one column. It shouldn't stop you using it.
    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!

  6. #6
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    True enough. Seems pretty nifty really.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    Quote Originally Posted by Blackfoot View Post
    Also seems to do something a bit odd with the sort after you click the box.. makes it pretty hard to find the next card to click.
    Is this a table in a module or a previously created one? Can you try it on a newly created table?
    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
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    Working with a module.. will try it with a regular older table and brand new one.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  9. #9
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    OK... it does seem to work differently with the module vs a new or old table. In a non-module it moves the blanks to the top.. in a module.. well it gets kinda crazy. I can't figure what the order of things is there.
    Note: it will permanently change the order of the items in your tables (including modules)... AND DO NOT use it with weighted tables as it will simplify your list to the least number of entries.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  10. #10
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    Quote Originally Posted by Blackfoot View Post
    Note: it will permanently change the order of the items in your tables (including modules)... AND DO NOT use it with weighted tables as it will simplify your list to the least number of entries.
    Yeah, mentioned this above. If you want weighted numbers (i.e. multiple cards of the same type) then you'll need to enter them separately. This is simulating cards, not other types of tables - if you don't click the "Used?" check box then your normal tables will continue to operate as before. As mentioned above, I'll be adding in a separate option to enable a table as a "card deck" sometime soon...
    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!

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
  •  
DICE PACKS BUNDLE

Log in

Log in