Move piece to new map after piece has left it

I am implementing a module for the board game “Hey That’s my Fish”.

In the game you move a penguin on a hex grid. Whatever piece you were previously on you gain and it gets added up as Victory Points at the end of the game.

Currently I use a Send to Location command to allow players to send the piece to that players piece board.

What I would like to do is be able to automatically move that piece to the players board after the player has moved their piece. Currently I am trying to implement it by the following:
(1) The main playing board (Map Window) issues a CTRL-M (using the “key command to apply to units ending movement on this map”) command after a piece moves.
(2) The tile I want to move to the players board has a Trigger Action that watches for CTRL-M. It also uses the Trigger when properties match “LocationName = $OldLocationName$” without the quotes. I am trying to match the $OldLocationName$ (should be the location of the Penguin piece before it was moved) to the current LocationName of the tile piece I am trying to move to the players board.
(3) If the trigger works it issues a CTRL-7 which is a Send To Location command for the tile piece. I use $playerSide$ to define the map name and all my maps are named after the sides i.e. blue, black, green, red. This part works if I right click on a piece and do CTRL-7. It sends the piece to the players board that issued the CTRL-7 command. It does not work automatically though.

If anyone could help me out I would appreciate it. I am still trying to figure out these key command things and triggers. :slight_smile:

If you want to look at the module to help solve the problem you can find it here:
http://www.mediafire.com/?7e4a2wmrmdl7ttz

Thanks,
John

Your very close. The trigger for LocationName = $OldLocationName$ needs to
be on the penguin and instead of being a trigger make it a GKC so that it
then activates the piece in the old location.

That piece will fire off the matching GKC key to move itself to whichever
hand.

If your still stuck , send me a link and I can fix this up for you pretty
quick

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of joja15
Sent: Friday, February 04, 2011 7:20 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Move piece to new map after piece
hasleft it

I am implementing a module for the board game “Hey That’s my Fish”.

In the game you move a penguin on a hex grid. Whatever piece you were
previously on you gain and it gets added up as Victory Points at the end
of the game.

Currently I use a Send to Location command to allow players to send the
piece to that players piece board.

What I would like to do is be able to automatically move that piece to
the players board after the player has moved their piece. Currently I am
trying to implement it by the following:
(1) The main playing board (Map Window) issues a CTRL-M (using the “key
command to apply to units ending movement on this map”) command after a
piece moves.
(2) The tile I want to move to the players board has a Trigger Action
that watches for CTRL-M. It also uses the Trigger when properties match
“LocationName = $OldLocationName$” without the quotes. I am trying to
match the $OldLocationName$ (should be the location of the Penguin piece
before it was moved) to the current LocationName of the tile piece I am
trying to move to the players board.
(3) If the trigger works it issues a CTRL-7 which is a Send To Location
command for the tile piece. I use $playerSide$ to define the map name
and all my maps are named after the sides i.e. blue, black, green, red.
This part works if I right click on a piece and do CTRL-7. It sends the
piece to the players board that issued the CTRL-7 command. It does not
work automatically though.

If anyone could help me out I would appreciate it. I am still trying to
figure out these key command things and triggers. :slight_smile:

I can share the module if anyone would like to look at it to help solve
the problem.

Thanks,
John


Read this topic online here:
https://forum.vassalengine.org/t/move-piece-to-new-map-after-piece-has-left-it/3638/1

Awesome! That worked like a charm. Thank you for the quick reply.

Can you explain to me how that works so I can better understand how this worked.

This is my understanding:
The Map issues a CTRL-M when the Penguin Moves
The Penguin with the GKC catches the CTRL-M and also looks at the trigger property LocationName = $OldLocationName$ (this is the part that confuses me). I am assuming since it is on the Penguin LocationName is the Penguin’s current Location and $OldLocationName$ is the Penguin’s old location name which should not match since it moved. It works but I can’t figure out how it is getting the tiles location in LocationName. How does it now to populate that in LocationName or is it going through every piece and for each piece it populates LocationName with that pieces location and then does a check for the trigger. If it is true it kicks off the trigger if it is false it moves on to the next piece. Is that how it works?

Thanks,
John