VASSAL Reference Manual

Home > Module > Game Piece Palette > Game Piece > Properties

Properties

Each Game Piece has its own set of properties (each with a name and a value) that can be used for identification by various components.

Properties can be matched using expressions like name = value for an exact match, name != value for a non-match, or name =~ value for a regular expression match.   For  properties that return a numeric value (e.g. the level in a Layer) you can use <, <=, >, and >=.  You can combine expressions using && for logical AND and || for a logical OR.

Common properties
  • The Basic Piece defines properties related to a piece's name, location, side, and whether it's selected
  • The Layer trait defines properties related to the state of that Layer
  • The Text Label trait returns the value of the label as a property
  • The Marker trait allows you to define your own static properties
  • The Mark When Moved trait sets a property when a piece has moved
  • The Mask trait sets a property when the piece is masked
  • The Invisible trait sets a property when the piece is invisible
  • The Property Sheet trait exposes a set of user-editable properties.

Components that use properties
  • The Global Key Command component uses properties to determine which pieces will respond to the command.
  • The Game Piece Layers component uses properties to determine relative ordering when drawing pieces on the map.
  • The Trigger Action trait uses properties to determine when to fire a keyboard command.
  • The Text Label trait substitutes properties when setting the text of the label.