Action button to move a Piece

Hi,

I have this Action Button in the bar I know how to make Send a Hotkey, like CTRL 3.

I have this Single Piece, defined from a Scrollable List in Game Piece Palette Tabbed Pannel.
I set a trait : Move Fixed distance, with keyboard shortcut : CTRL 3.

I expected the piece to move, from it’s position on the Map Board, when I click on the Action Button. It does not.
I need the Single Piece to be selected first, by mouse Drag or Click, before I can use the shortcut CTRL 3. But then I can’t chose the action button. If I do so, the piece is unselected.

Any idea ? I tried to use a global property but I can’t make it work either.

Thanks for helping

A few remarks:

  • You did not tell us where you located the action button. Main toolbar? In that case you need to use a Global Key Command and a property or marker on the piece that you can use for the condition in the GKC definition.

  • I avoid keys like “CTRL 3” for automation, i. e. I use such “typable key” combinations only if the user is actually expected to hit them. For automation I recommend to use an arbitrary string (maybe “MoveThatPiece” in this case, you will have to re-type the “Mo” when you enter it) that cannot be hit by accident. Not sure if you intend that users hit CTRL 3 to move the piece.

Thx for help.

  • Vassal version is 3.2.17. My working system is a Mac Os X Sierra.
  • Action button is in the Module, visible on the Main Toolbar.
    Following your recommendation, I tried to create a Global Key Command.
    But I see I can make one in the Module OR as a Property on my single piece.

I wanted pressing the Main toolbar Action Button to do as shortcut CTRL +3 : increase a counter AND reporting AND moving the piece on the Main Board. (thanks to your advice, I will rename my action with arbitrary string).

Let’s say I define my Single Piece Trait : Move Fixed distance, associated with Command Name and Keyboard shortcut : Increase. (I give same name, now)
Alone that allows me in the running game to right click on the piece and chose : Increase. That pushes my cube Up.

However, I don’t see how to set the GKC properties : the keyboard command, the global key command, and the matching properties.
I don’t see which matching property I should check to act on the Single Piece, from the Action Button.
There is no such think as : If Action Button is Pressed …

Any more lead ? :slight_smile:

Gotcha !

A GKC is a button. Ether on the main toolbar (if the GKC is defined in the module) or on the Map toolbar (if the GKC is defined in the Map Window, or any map).
The GKC has a Key Command I named Increase.This Key Command has the same name as the Command Name on my single piece’s property : Move fixed Distance.
The single piece has now a Marker, with property name : GlobalObj, and a value : 3
The GKC has a the Matching properties : GlobalObj=3.

So now, when I click my GKC button, it calls the piece with GlobalObj=3, and sends to it the action increase, which moves the piece up.

Thanks a lot PunTheHun !

Yep, that’s it! Glad I could help. It took me a while to figure this out when I did my first “serious” module, so I know that feeling.