VASSAL Reference Manual

Mask

The Mask trait allows you to create a generic "reverse side" for pieces (like a deck of cards, or chits) which are intended to be "flipped over" to obscure their faces from opponents.

A masked piece looks different to players other than the player who hid it, but its existence remains visible to all players (unlike a piece with the Invisible trait, which would not appear at all). The Mask trait is useful for playing cards: players may drag a card face down from their hand to the playing area. The owning player will be able to see the identity of the card, but other players will only see the back until it is turned face up. Board games with a concept of concealment can also make use this trait.

Like the Invisible trait, this trait only hides traits that appear before it in the piece’s list of traits. As a general rule of thumb, it should be placed before any Invisible trait but after all other traits of the piece.

A piece with the Mask trait is "owned" by the player who masks it. If it is unmasked but then is masked again by a different player, the second player becomes the owner. Menu commands of traits hidden by a masked piece are not available to non-owning players. A setting in the Global Options determines whether non-owning players can unmask pieces.

EXAMPLE: An ordinary playing card can be implemented by setting the basic image to represent the front of the card. In the "Mask" controls, specify an image for the back of the playing card. When a player types Ctrl+F, that card will be known only to him (as though held in his hand). Typing Ctrl+F again will reveal the card to the other players (as when playing it on the table).

Description:

A short description of this trait for your own reference.

Menu command:

The name of the right-click context menu entry that mask/unmasks this piece. If left blank, no context menu item will appear, but the piece can still be masked e.g. by the Key Command below.

Key command:

The Keystroke or Named Command to mask/unmask this piece.

Can be masked by:

Defines who may "own" this piece (i.e. mask it from other players). Any Player means that any player may mask this piece, including observers.

Any Side means that any player who has been assigned a side in a game (not an observer) can mask this piece. If the player resigns and another player takes the side, then the new player for that side will be the owner.

Any of the Specified Sides allows you to enter a list of sides. Only players assigned to one of the named sides can mask the piece, but the players of all the listed sides will be able to see and modify the piece. This is useful for referee players or games with multi-player teams.

Deal-facedown-to-side command: When this key command is received, the piece will attempt to assign the side specified in the Deal to this side expression as the owner. Ownership will not change if the piece is already masked by a different player/side from the one executing the command, but if the piece is unmasked or else owned by current player it can be assigned ("dealt to") a player from the specified side. If the Can be masked by field is set to either Any Side or Any of the Specified Sides then the piece’s ownership will be assigned to that side. If the masking is by Any Player, however, the piece will become owned by the player currently playing that side—​or if no player is currently playing that side the piece will become unmasked (unowned).

Deal to this side: An expression which determines which side to assign ownership of the piece when the Deal-facedown-to-side command is received. Note that if the expression does not match any valid side from the Definition of Player Sides then ownership will not be assigned.

View when masked:

To non-owning players, the piece will be drawn using this image when it is masked.

Name when masked:

To non-owning players, the piece will be reported with this name when it is masked.

Display style:

Determines how a masked piece is seen by the owning player. The following options are available:

Inset draws the mask image at reduced size over top of the regular image, inset into the upper left corner.

Inset Image draws the regular image at reduced size over top of the mask image, inset into the center.

Background draws the mask image at full size and the regular piece at reduced size centered within it.

Plain draws only the mask image, so the piece looks the same to all players. A "Peek" command key may be specified. When the owning player selects the "Peek" command, he will see the unmasked piece so long as it remains selected (i.e. until he clicks elsewhere on the map). If the "Peek" command key is left blank, then the owning player will see all selected pieces in their unmasked state.

Use Image draws the unmasked piece and then a specifiable image on top of the piece. The image can make use of transparency to let some of the information through.

Autopeek on Rollover:

If checked, then when displayed in any Mouse-over Viewer to a player eligible to see the piece, the piece will appear unmasked.

Mask

Mask2


This trait sets the Property ObscuredToOthers=true when the piece is masked.