VASSAL Reference Manual
As you define your piece, it will appear at the top of the window. You can select the piece and type commands for it or right-click to bring up its popup menu to test it as you go.
Once added to your piece, a trait's properties can be edited by selecting the trait and pushing the 'Properties' button, or by double-clicking on the trait.
When a piece is drawn, the traits are drawn in order, beginning with the basic piece and continuing downward. The order of traits can be important. For example the image in a Layer trait may obscure the Basic Piece or other Layers beneath it.
For highly specialized pieces, you may supply your own Java classes. The Java class must implement the GamePiece interface and most commonly extends the Decorator class. First, add the Java .class file to the module file using a Zip utility (remember to preserve the package structure). Then hit the "Import" button and enter the fully-qualified name of the class. The trait corresponding to your class will appear in the list of available traits and you may add it normally. See the Coding Tutorial for more details.
The order of traits is significant. Each trait is only affected by traits that are below it in the expanded list of traits after taking prototypes into account.
For example, if you want Text Labels to Rotate, then the Text Label trait must be above the Rotation trait. If you don't want your Text Labels to rotate, then they must be below the Rotation trait. You need to think about each trait, how it affects the counter, and whether it should affect, or be affected by, other traits that affect the counter.
Keystrokes and Traits
When a keystroke enters a piece, the traits are visited in a particular order to see if they're interested in that keystroke, and if they are interested, they execute.
When a keystroke enters a piece, the behaviour is identical irrespective of the origin of that keystroke. The keystroke could have come from the player, from a global key command, from an action button, or from a trigger within the piece.
The order traits are visited is as follows.
A simple piece drawn from an image.
A sequence of images with key commands to loop through them.
Insert a pre-defined set of traits defined in a prototype elsewhere.
A plain text label drawn somewhere on the piece.
The ability to be hidden to non-owning players.
The ability to show only limited information to non-owning players.
Defines a command to automatically send a piece to a pre-defined location.
Applies a command to to other pieces.
Defines a command to move a piece a fixed distance in a direction.
Defines a command to automatically send a piece to a Deck.
Prevents the piece from combining with other pieces in a stack.
Provides a popup window from which players may set and view auxiliary information about a piece. Includes sophisticated controls for specifying single- and multi-line text notes and tick-mark boxes for depletable resources (hit points, shield levels, damage, etc.)
Attaches an editable informational table to a piece. Unlike a Property Sheet, it contains only plain-text fields, but can contain arbitrary numbers of rows and columns.
Defines a keyboard command that places another piece on top of this piece.
Defines a keyboard command that replaces this piece with a different piece.
Defines ability to rotate through a specified number of facings.
Defines ability to pivot a piece, i.e. rotate around a point other than the center.
Directs a piece to ignore image transparency for purposes of selecting a piece with the mouse.
Adds a command that plays a specified sound when invoked.
Allows the piece to be automatically marked when moved in a Map Window.
Draws the recent movement path of the piece as a trail of points.
Highlights a specified radius around a piece.
Creates a sub-menu in the right-click drop-down menu.
Hides or removes keyboard/menu commands when certain conditions apply.
Limit control of a piece from non-owning players.
Allows the piece to automatically report state changes to the chat text area.
Allows you to trigger keyboard actions with other keyboard actions, combining multiple keystrokes into a single menu entry.
Allows you to trigger toolbar actions, via the hotkey associated with the button in the toolbar.
Allows you to specify a region of a piece that acts like a button, invoking an action when a player clicks within the region with the mouse.
Assigns a fixed value to a named property on a piece.
Assigns a user-changeable value to a named property on a piece.
Defines commands to change the value of a Global Property.