Cards and masking

This a newbie question, and I apologise for it (searching the forum didn’t help), but I just noticed now that I am completely baffled by how cards/masking is supposed to work.

I have a deck cards with the Mask trait set to plain (with a card back gif uploaded). I also have player sides Red and Blue defined.

If I start a game as Red and draw a card from the deck and drag it somewhere on the map (just one map in a test module) it displays unmasked but as soon as I click elsewhere on the map it masks. So far so good.

But when I Retire and join back as Blue I can still click on the card (supposedly belonging to Red) and it will flip over…

Is this how it is supposed to work? What is the point of masking then? Or is it maybe a “bug” with the retire button and the use of a single password? (But this offline mode…)

Ok, I found that the solutions is to set to the Mask trait to “Any side” instead of “Any player”.

Now a more difficult question: if a player is the dealer like in a game of poker, how to remove ownership of the distributed cards from him and hand it out to the other players accordingly (for mask/unmask purposes)?

It seems like that unless everybody draws his own cards they won’t be able to play poker…

I have never had any luck testing Mask offline. I suspect it works correctly as you had it before, but from a single client, it’s hard to test. I recommend opening a second client under a different Windows/Mac/*nix profile and trying it online.
As for the dealer - what precisely do you want to do?

The masking with “Any side” set works ok.

The problem is that I had coded as part of a setup procedure the dealing of several cards to every player (like dealing 5 cards to each player in a poker table). This setup procedure is triggered by the first player to hit a “start game” button. Similarly, in other stages of the game, the player who fires some command on some of his pieces triggers dealing of more cards to everybody else.

Unfortunately, then this player will automatically be the owner of all the cards dealt. Not only he will be able to look at them, but they will be masked and thus not viewable at all to the other players.

Is there a way to change the “ownership” of cards dealt by player A if he wants to pass it on to player B?

Seems really strange that such a basic task of dealing out cards relinquishing ownership is impossible to do (except using private windows, I guess, maybe, which I cannot do in this case), or isn’t it?

Nope, I don’t think this is possible the way you are describing. However, here is a somewhat convoluted workaround:

  1. Give each card a Basic Piece trait with the card back as the main image.
  2. Give each card a Mask trait with the card back as the main image. For ‘Display Style’ choose ‘Use image’ and give it your card front image.
  3. Finally, give each card a layer trait with the card front.
  4. The cards can be face-up or face-down in the deck, but they should be dealt face-up. This way, any player can deal the cards, and they won’t see the card front (as they would normally if they were dealing them face-down with a regular Mask).
  5. After a player receives new cards, they will need to flip them over manually, either by selecting the cards and using a context menu, or by clicking an action button or toolbar button somewhere. Sorry, I don’t think there is currently a way to run a command, i.e. Mask, as anyone other than the actual player triggering the command. So at some point each player will have to click something to assign the cards to themselves. This should trigger the Mask, which will still show the card back to everyone else, and the card front to the masking player.
  6. When the card is played, deactivate the Mask and activate the layer - now the card is visible to everyone. Remember to deactivate the layer when sending the card to a deck! I recommend a trigger that checks CurrentZone = Play Area, something like that, so people don’t forget.


Irishwulf, thanks for your clever suggestion.

I had another workaround in mind, which I tested yesterday: after dealing the cards the “dealer” unmasks them but immediately covers them with another marker showing the back of the cards. BTW, let’s remember this is actually an automatic dealing procedure, not actually a physical drag and drop by a player (I am anxiously waiting for TimM’s UNMOVABLE (?) trait in 3.2.0).

This other “fake” cover piece has an action button covering the all card which, when clicked, deletes itself and issues a gck command to mask all unmasked cards in the given area (btw, InvisibleToOthers=false seemed not to work right). A restrict command limits clicking this action button to the correct player only.

However, this turned out rather ugly because either the cards have a DOES NOT STACK trait, making them ugly to play, or they will show as a stack double in size (10 cards instead of 5 in the poker example: each real card having the fake cover on top).

Anyway, I think I will try now a third way, kinda of a cross between yours and mine, which involves only adding a layer and an action buttom (plus some triggers and restrict commands) in the prototype shared by the cards (not on each cards).

  1. All cards have normal basic piece image and mask with card back image, no need to change anything.
  2. All cards have also a layer in the prototype with just 1 level (card back image), default off.
  3. All cards have also an action button in the prototype covering the all card, restricted in use to the correct player (location based) and to correct time only (layer described above active)
  4. When the player acting as dealer distributes cards around he first turns the layer on and unmasks them.
  5. When the legitimate owner of the card clicks on one of these cards he masks them back and turns off the layer, so to him they will look like he just flipped them over to privately look at them
  6. The mask command on cards will also be restricted, based on location, so that the dealer won’t be able to unmask-mask
    them again before the legitimate player has had a chance to “own” them (basically mask will be hidden when:
    CurrentZone != Table (where the deck also is) || CurrentMap != $playerSide$)
  7. Whenever cards are discared some trigger will make sure the layer described above is off (they need to show face up in the discard deck).

I haven’t tried yet, but I think it should work. Why Vassal makes simple tasks so hard at times, though…?

I’m a bit sleepy right now, but yes, that sounds like it should work, and it’s a more intuitive solution than mine. Try ObscuredToOthers = false.