Problems with "Draw Card" button

Hi everyone,

I’m creating a module where at the start of the game each player randomly pick up a token and add it to his player area.

The easiest way to do it would be to have a simple DECK with the tokens and every player go there, draw a tokens and drag it to his player area. This is easy, but … I wanted to go a little bit further and also learn more in the process so … I went the “hard” path, which is … create a Draw Token button.

This is what I have:

  • I have the main map
  • I have a support map where the tokens deck are (they have a blank mask so you won’t see it but its there :smiley: )
  • I have 3 private maps one for each player
  • each player map has a “draw token” button

It seems to work but … not has I expected. This is what’s happening:
if you click on the buttons in this order : Player 1 → Play 2 → Player 3
it works just fine. the tokens are drawn from the deck and moved to the button location on that player area

HOWEVER… if you click on the buttons on any other order… the tokens are moved to a random player area and I’m not being able to figure out what is the problem :frowning: it doesn’t make much sense to me at least.

So, If anyone would be able to have a look at this example module and figure out what is the issue… I would be deeply grateful.
Here is the module file : dropbox.com/s/ru6jvnbfl1fm7 … n.rar?dl=0

As reference, I followed this tutorial on how to do it: vassalengine.org/mediawiki/i … button.pdf

Many thanks in advance,

  • Miguel

The problem is that all the Send to Location traits in your player-token prototype are bound to the same keystroke (CTRL-T). Each one needs to be different.

One of the reasons I’m not a big fan of the Draw Card buttons is that they require a lot of extra setup and properties for what is fundamentally a very simple action. Consider this alternative, where you have a toolbar button (could easily be bound to an Action Button on a piece as you have it now instead) that dispatches a GKC to the deck of tokens, and the tokens get sent to a named region on each player’s private window.

Demo module

So, basically on each map you have a button that triggers a global key command that will affect only a specific deck
and all the pieces on that deck have a “go to location” for each player area which is triggered by the GKC defined on the player area …

seams doable and it works just fine :smiley:

thank you very much!!

I really would like to have a list of “variables” that I could use in the "matching property field :frowning:

  • Miguel