Replace card with card from deck

Hi everyone,

I have a grid where each position will have an “invisible” card.
And I will have a deck of cards at the side.

I would like to be able to right-click on an “empty” space on the grid (which is actually a “transparent card” and select an option to “draw a card”, and then this action would draw a card from the deck and place on top of the transparent card (or replace).

I know I can trigger commands on the transparent card to trigger this but, how can I make it draw a card from the deck and replace the transparent card with it (to place it on top)?

Many thanks in advance.

My first thought is:

  1. Add a Trigger Action to the “invisible” card prototype. This trigger action would
    [list=a][*]trigger a pair of Set Global Property traits to store the card’s CurrentX and CurrentY properties (you will need to add a pair of Global Properties (GP) to hold these).
  2. trigger a Global Key Command (GKC), which will use the Fast Match fields to specifically target the deck the cards are coming from (this will trigger a Send to Location trait on the cards).
  3. trigger a Delete trait, to remove the invisible card (I’m assuming it’s no longer needed?–if it is still needed, just skip this step–the new card should automatically obscure the invisible card anyway).
    ]Add a Send to Location trait to the cards, with the named key command from the GKC in step (b) above. It will use the 2 GPs you set up in step (a) above for the X and Y coordinates to send to.[/:m]
    ]Also, make sure your invisible cards have a Do Not Stack trait if you’re not going to delete them, so that the new card doesn’t try to form a stack with them and end up accidentally dragging it elsewhere (you probably want one, anyway, to prevent them from accidentally being moved by a player).[/*:m][/list:o]
    I think that should do it. Note that there are certainly other ways to do it, and someone else might have a better/more efficient solution!

I’m adding a couple comments to JRWatts’ reply because I do what you ask for all the time.

JR proposed using “send to location” via (x,y) pixel coordinates, but you could also use send-to-region or send-to-another-piece. For the sake of example, suppose we have 8 invisible cards I will call “locators.”

If they are stationary, we could define 8 map regions, “R0” to “R7”. Each card would have 8 send-to region commands (goToR0, goToR1, …). When someone clicked on locator 3, it would send GKC goToR3 to the cards. (The GKC form would be send-to-region, and the region would be R0 to R7 depending on the command, goToR0 to goToR7. You would also need to specify DeckName==“cards” or whatever you called the deck, and fixed number of cards = 1.)

A second way would be send-to-another-piece. In this case, each locator would have a unique marker property, e.g. locator=0 to locator=7. Again, each card would have goTo commands as above. Each command would send to the piece identified by the locator property. The advantage to this approach is the locators don’t need to be stationary.

Regarding stacking, this should not be a worry if you use map layers. I’d define layers like top, cards, locators with locators being on the bottom and the cards being in the cards layer. (If you don’t know what I’m talking about, ask.) This both ensures that cards will always be rendered above locators, and cards and locators will never stack because they are on different layers.

hmmm makes sense. I thought it would be something lie that just didn’t know about the “send-to-another-piece”.

I will give it a try and ping you guys again if I get it working or if I get more issues.

Thanks for your time and explanation :slight_smile:

hmmm I have a grid already in place where the tiles are supposed to be placed (since I was doing manualy before)
if there a way to use the grid itself for the mechanic you mentioned above?

I actually use Action buttons for this functionality. When I click the button it executes a trigger that draws a card from the deck on to the top of the button (use Game Piece layers and Does not Stack/Move) to keep button on bottom.

If it is for a one time use only I then destroy the button, else you can leave it in place for reuse whenever it is no longer covered by a card to draw again - see pic for example

BTW, you can use the button to help snap your piece to the grid (should be evident in pic this is what I am doing)

ok I was able to do it and it worked just fine, thank you!

I noticed also that there is an option to send to a “grid location” that could also work. But since I have to have the piece to trigger the action to send the ard there… There’s not much benefit.

Now … this was a paint to do … 49 tiles on the board xD