Neophyte user with basic question: token counter?

I’ve been trying my hand at getting into Vassal, and if I’m being completely honest, it’s been rough. Of the many hurdles I’ve run into, my current issue is the implementation of some sort of score counter. My vision is to be able to drag a token from a “Main Map” into a “Player Hand” and have that token trigger the addition of “1” to a counter that shows only in that player’s hand. Each turn, players will have the option (based on other metrics) of drawing one or more tokens. That said, if I could just implement a button that adds to the counter in that player’s hand, that would also work. I’ve tried both and failed miserably. Any help would be greatly appreciated.

Here’s an extremely minimal module doing what you describe: Example module

Open the module, take the Player1 side. Double-click the stack of generic pieces to expand the stack. Drag one piece to the Player1 hand window and watch the score counter increase by 1.

The barest set of features you can combo together to make this work (and iterate on to add more) are:

  1. Global Property (to track a numeric value like a score)
  2. a key command to be applied to pieces ending movement on a map window (in the Player1 map window’s config)
  3. a static, no-image piece in the Player1 hand with a Text Label trait that displays the value of the Global Property (item 1) corresponding to the score
  4. a Set Global Property trait in the pieces themselves to adjust the score Global Property (item 1)
  5. a Trigger Action in the pieces to detect the map-based movement key command in the right circumstances (item 2 above) and react to it by firing the “adjust the score” Set Global Property (item 4)

From here, there are untold ways you could extend this. Adjust the score back downward when pieces leave the Player hand window. Have multiple score trackers corresponding to different classes of pieces. Can make the score tracker more elaborate by having Action Buttons to adjust the score manually or set it to a specific value (see the Pax Porfiriana money trackers for an example of this). And on and on…

1 Like

@JoelCFC25 This looks tremendously helpful, thank you!