Results 1 to 2 of 2

Thread: Deck Fanning

  1. #1

    Lightbulb Deck Fanning

    I think it could be useful for a few different games to add a 'Fanning' tool to decks. It would work like this. You right-click a deck and choose the option "Fan Deck" or "Fanning" or just "Fan." Then you click and drag to make a box (similar to when you make hands, fog of war, etc.), and after that, the cards in the deck chosen fan out upside down in the area specified.

    Another way of doing this would be to add a "Fanned" zone. Just like before you designate an area as if you're making a hand, then, whatever deck you drop within that zone fans out automatically.
    Last edited by NoveFlameGamer; 05-28-2020 at 07:03 PM.

  2. #2
    Join Date
    Sep 2017
    Posts
    340
    It is not too hard to script a simple variation on this behavior. This code fans your selection at the location of the mouse pointer. I attach it to a scripting button...
    Code:
            pos = Player[who].getPointerPosition()
            roty = Player[who].getPointerRotation() -- not a vector
            local deckbase = deck.getScale().x * 0.5
            local offsetx = math.cos(roty * math.pi / 180) * -deckbase
            local offsetz = math.sin(roty * math.pi / 180) * deckbase
            local cards = Player[who].getSelectedObjects()
    
            for i, t in ipairs(cards) do
                rot = t.getRotation()
                rot.y = roty
                if t.tag == "Card" then
                    hasMelded[who] = true
                    print(string.format("%s melded a %s", Player[who].steam_name, t.getName()))
                    t.setRotation(rot)
                    t.setPosition(pos)
                    pos.x = pos.x + offsetx
                    pos.y = pos.y + 1.0
                    pos.z = pos.z + offsetz
                elseif t.tag == "Deck" then
                    shards = t.getObjects()
                    for j, u in ipairs(shards) do
                        local params = {
                            position = pos,
                            rotation = rot,
                        }
                        s = t.takeObject(params)
                        hasMelded[who] = true
                        print(string.format("%s melded a %s", Player[who].steam_name, s.getName()))
                        pos.x = pos.x + offsetx
                        pos.y = pos.y + 1.0
                        pos.z = pos.z + offsetz
    
                    end
                else
                    print("don't know how to handle: ", t.tag)
                end

Similar Threads

  1. [SUPPORT] Resetting card deck with grouped cards or exhausted deck
    By Melds in forum Technical Support
    Replies: 0
    Last Post: 05-18-2020, 03:10 PM
  2. Replies: 1
    Last Post: 11-10-2016, 07:05 PM
  3. Replies: 2
    Last Post: 07-07-2016, 05:15 PM
  4. Replies: 3
    Last Post: 06-02-2015, 07:57 AM
  5. [SOLVED] Deck Builder Can't Export Deck Image on Linux
    By rmblr in forum Technical Support
    Replies: 1
    Last Post: 03-29-2015, 09:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •