VASSAL Reference Manual


Clone

The Clone trait provides the capability for a piece to be duplicated by players during a game.

When this trait’s Key Command or menu item is activated, an exact copy of the piece is placed in the game at the same location.

The piece that initiates the first Clone, and all subsequent pieces Cloned from Clones, have a unique value (the value of the UniqueID property from initially Cloning piece) stored into the property CloneID that uniquely identifies that set of clones.

This allows any of the Clones to use the Global Key Command trait or the Set Piece Property trait to communicate with the other Clones by including the following in the Additional matching expression:

{CloneID=="$CloneID$"}

If you need to know which of the Clones was the initial piece that was cloned, it will have a value for the CloneID property that is equal to its own UniqueID property.

Note
If you pull a new version of a piece that has been Cloned from a Piece Palette, it will NOT have a value for CloneID and if you then Clone it, the value of CloneID for it and the clone will be different to any earlier Clonings of the earlier version of the piece.
Command:

Text for the right-click context menu item that will clone the piece. If left blank, no context menu item will appear, but the piece can still be cloned with the Key Command.

Key command:

The Keystroke or Named Command that will cause the piece to be duplicated.

Clone

Back to Trait List