VASSAL module designing GODS:
I’m making a module for SPI’s “The Plot to Assassinate Hitler” and I need some ideas on how to track how many MP’s a piece has expended as it moves.
Backgound: In the actual game, a piece may have (for example) 9 MP’s. It costs 1 MP for each hex moved (that is a static amount- always 1 MP). However, the unit can also expend 1 MP to “attack” a unit in an adjacent hex. And it can keep expending MP’s to either move or attack for as long as it has MP’s remaining. The boardgame has a track for keeping a tally of the MP’s expended and I have a track on my map however, it’s clunky to have the focus point move from piece to track as the player has to manually move each.
Ideas: I’m thinking perhaps a text label on each piece that would count down as it moves. That should be fairly easy to implement however I don’t know how I’d have it count a hex that it attacks. Also, what if a player messes up a move and “takes back” a portion of it; I don’t think that “counter” would know to increase the number if a player does move the piece back a hex or two (or even restarts his move).
Does anybody have an example perhaps of something similar that was done or does anybody have an idea of how to handle this in an eloquent manner?
Thanks in advance!
Use a Dynamic Property to store the MP’s remaining for the piece. You can then use this to display the remaining MP’s either via a text Label, or for a fancier look, by using it to control the level displayed by a Layer trait (Make up a set of small icons numbered 1-9 and create a 9 level layer that follows the dynamic property.
You can use the Map feature ‘Send command to any unit that ends movement on this map’ to fire off a ‘Decrement value by 1’ command on the Dynamic Property.
I would just add an extra Key Command ‘Attack Adjacent Piece’ that also reduces the count by 1.
If a player undoes their move using the Vassal Undo move button, then Vassal will handle the required increase. For other situations, I would also add a ‘Set MP to value’ command on the Dynamic Property so that players can manually reset the MP to any value if needed.
The secret of good automation in Vassal is to not try to do too much, just aim to provide support to players to do things that would otherwise be slow, unwieldy or clunky to do manually. Oh, and always include an over-ride so players can fix things up manually if it goes pear shaped.
Thanks Brent, I’ll give that a try on a set of units to see how well it works. I assume that I could set up a GKC to reset all the MP markers back to their default number as well?