VASSAL Reference Manual

Home > Module > Game Piece Palette > Game Piece > Set Global Property


Set Global Property

This trait allows a Game Piece to change the value of a Global Property.

SetGlobalProperty

Description: A brief description of this trait for reference in the editor (not used during play).

Global Property Name An Expression that defines the name of the property to be set. Often, a specific Global Property is simply listed by name, but it is possible to compute the name of the Global Property to be changed based on other properties of the piece, e.g. { "Resources" + GetProperty("Side") }. In this case when the property Side holds the value "Allied" then the Global Property to be set will be ResourcesAllied.

Locate Property starting in the: You may name a Zone or Map containing the Global Property to be set, or you may set the property based on the piece’s current location, looking for the occupied Zone or Map before defaulting to the Module. The name of the Zone or Map is defined using an Expression, and so again can be named directly or computed based on the values of Properties.

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.

Maximum Value: Numeric values will be restricted to no more than this number.

Wrap Around: 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 commands for this piece, each of which will set change the value of the designated property in the specified way. Click the New button to add a new command and the Remove button to remove one. For each command:

Menu Command: Right-click context menu text for the command, or leave blank to display no context menu item.

Key Command: Keyboard shortcut or Named Key Command which will activate this change.

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.

  • Increment numeric value: Increment the value of the property by the value of the Expression entered in the Increment by field. To "decrement" the value, simple increment by a negative number.

  • Prompt user: Pop up a dialog and ask the user 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.