## VASSAL Reference Manual

Home > Module > Game Piece Palette > Game Piece > Dynamic Property

### Dynamic Property

This trait attaches a Property to a Game Piece and allows you to define commands to change the value of the property during play.

Description:

  A short description of this property for your own reference.

Property name:

  The name of the property. Any other trait of this piece can reference this name in an Expression or Message Format to check or display its value.

Initial value:

  The value of the property at the start of a new game or when a piece is first created.

Is numeric:

  If true, then changes to the value of the property will be restricted to integer values.

Minimum value:

  Numeric values will be restricted to no less than this number whenever an Increment numeric value or Prompt user operation is performed. Note that Set Value Directly operations will not honor this constraint.

Maximum value:

  Numeric values will be restricted to no more than this number whenever an Increment numeric value or Prompt user operation is performed. Note that Set Value Directly operations will not honor this constraint.

Wrap:

  If true, then when incrementing this numeric property, values will wrap around from the maximum to the minimum and vice versa.

Key commands

  Adds any number of commands to the right-click context menu for this Game Piece. Click the List Control buttons on the right-hand side of the list to add, remove or re-order commands.

For each command:
  Menu Command:

    Right-click context menu item that will initiate this operation (can be left blank if only the Key Command portion is to be used).

  Key command:

    Keystroke or Named Command that will initiate this operation.

  Type:

    Select the way in which this command will change the property:

    Set value directly

      Set the property directly to the value of the Expression entered in the New Value field.

      Note | When setting the value of a numeric property directly with this option, the Minimum/Maximum constraints are not honored.

    Increment numeric value

      Increment the value of the property by the value of the Expression entered in the Increment by field. Maximum/Minimum constraints will be honored.

    Prompt user

      Pop up a dialog and ask the player for a new value for the property. They will be prompted for a new value using the text prompt entered in the Prompt field.

    Prompt user to select from list

      Similar to Prompt User but displays a list of items to select from in a drop-down menu. The items in the list can be generated dynamically by Expressions. If some items evaluate to a blank string, then those items are only purged from the menu if the Purge Blanks option in Global Options is selected; otherwise the blank options appear.

SEE ALSO: Marker, Set Global Property