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 defined for a Zone, a Map or for the entire module.  If a property is not defined in a Game Piece, the program looks for the value in the Map containing the piece, then in the module.

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.

Components that use properties
  • Any Message Format defined in a Game Piece will substitute values for the properties defined on that Game Piece
  • 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.
  • A Zone uses properties to specify a Zone Highlighter.
Properties defined by Game Pieces
  • 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 Rotate trait defines properties related to the current facing of the piece.
  • 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 Dynamic Property trait allows you to define your own changeable 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.
Properties defined by other components
  • The Global Property component defines properties for a Zone, Map or the module.
  • The Global Options component allows you to tie property values to preferences settings.
  • The results of a roll by a Dice Button is exposed as a property
  • A Deck component exposes the number of cards remaining as a Map-level property.