VASSAL Reference Manual
Home > Module > Game Piece Palette > Game Piece > Basic Piece
Basic Piece
The simplest game piece consists of an image and a name.
The image is optional, or different pieces can share the same image, but you should always either give each Basic Piece a unique name or add a Basic Name trait to provide one.
Simple piece images can be created from scratch within Vassal using Game Piece Image Definitions, but you will usually get a better result by loading images sourced from existing artwork or created with specialist graphics software.
To give a piece more complex behaviors, you can add more Traits to it in the Piece Definer dialog. For example you could omit or remove the image from the Basic Piece and instead add a Layer trait to allow the piece to use multiple images.
|
A Basic Piece containing an image and a name. Choosing an image that has already been loaded into the module. |
The following Properties are defined in a Basic Piece, meaning that any trait in the piece can refer to them:
-
BasicName contains the name of Basic Piece trait. Can be overridden by adding a Basic Name trait to the piece.
-
PieceName contains the full name of the piece, including any additional strings added by e.g. Layer or Text Label traits (Note the distinction from the use of $pieceName$ with lowercase p inside the Text Label trait and in a Map’s movement report fields — those are similar but separate uses specific to those situations. The general-purpose property for a piece’s traits to use to get the piece’s own full name, as well as for Property Match Expressions selecting for target pieces in a Global Key Command, is PieceName with the capital P).
-
PlayerSide contains the side of the current player, as specified in the Definition of Player Sides
-
LocationName contains the name of the current location, as determined by the local grid. If the piece is in a Zone in a Multi-Zone Grid, then whether LocationName returns the name of the Zone or a Region within the Zone’s grid depends on the configuration of the Zone.
-
CurrentMap contains the name of the current Map Window
-
CurrentBoard contains the name of the current Board
-
CurrentZone contains the name of the current Zone
-
CurrentX contains the current map X coordinate
-
CurrentY contains the current map Y coordinate
-
DeckName contains the name of the Deck if the piece is currently stacked in one.
-
DeckPosition contains the position of a piece within a Deck (top = 1) if the piece is currently stacked in one, or 0 otherwise.
-
Selected contains true when the piece has been selected with the mouse
-
PieceId contains a string that uniquely defines the source of the piece. All pieces sourced from the same Game Piece Palette slot will have the same PieceId string.
-
DrawingMouseover contains true when a Mouseover Stack Viewer is currently being drawn, and contains false otherwise.
-
DrawingMouseoverIndex contains 2 when a Mouseover Stack Viewer is currently being drawn, and contains 1 otherwise. This can be used e.g. in the Follows Expression field of a Layer trait to draw a different image for the Mouseover than is normally used when drawing the piece on the map.
The following Properties are defined after a piece is moved, either manually by drag-and-drop movement or by a Send To Location trait:
-
OldLocationName contains the name of the previous location, as determined by the local grid
-
OldMap contains the name of the previous Map Window
-
OldBoard contains the name of the previous Board
-
OldZone contains the name of the previous Zone
-
OldX contains the previous map X coordinate
-
OldY contains the previous map Y coordinate
-
OldMat contains the previous Mat, if this is a Mat Cargo piece.
-
OldMatID contains the previous Mat ID, if this is a Mat Cargo piece.
-
OldMatPieceName contains the previous Mat’s Piece Name
-
OldMatBasicName contains the previous Mat’s Basic Name
The following Properties are defined after the player has selected something from the piece’s right-click context menu:
-
ClickedX contains the X location on current map where right-click took place.
-
ClickedY contains the Y location on current map where right-click took place.