Tip: Conditional Action Button

The Action Button is a very handy feature for quickly adding a button or hotkey.

The Action Button supports button disabling (since Vassal v3.6) but if you need more dynamic or complex control over whether an Action Button runs or not, consider using a “loop index property”. This is the same as you may know from the Trigger Trait.

Here is a simple example, that allows the escape key to be pressed by Player 1 (only) to send a Hotkey that in turn displays a window belonging to Player 1. This example loop runs once or not at all.

Avoid duplicating the loop property name. This gives rise to conflicts; typically resulting in an infinite loop.
To help you specify a unique property for every Action Button loop that you define, consider using the Hotkey name in the loop index property name (if you have more than one loop on the same hotkey, just add a suffix number - as in the example above).

1 Like