Adding Tokens to predetermined locations via a button?

In the module I am creating, there are a few enemy reinforcement cards. When these are played, there are 10 spawn points in which enemies will spawn from.

Is there a way to create a button (along the top) that will place 10 tokens in the pre-determined locations to avoid having to drag and drop 10x from my token list. Also, how does one attach a sound to these buttons to add to the effect.

Any help in this matter is greatly appreciated!


Best way that I can see offhand to do this would be to have a button (or right-click command) on the enemy reinforcement card. The card is played, the command on the card is activated, and the 10 tokens are placed. You can even have the 10 tokens placed automatically whenever the reinforcement card is played without any further action by having the command on the card triggered by the map the card is being placed on …although this may be a problem if the card was played in error.

I can put a sample of this together, if you like.

I would prefer a button in case of error in playing the card.

Basically the script I want is: [Press Button]

  • Add 10 units to the 10 different spots (as defined by coordinates or even Zones - haven’t defined them yet)
  • Play sound

Cheers! A sample would be great, as i’m not sure where to put the code. Multi-Action Button?

Here’s a sample for you. Just change the .zip to .vmod.

It includes the button on the card instead of as a toolbar button …far easier to add a multitude of controls to a button on or as a game piece then as a button on the toolbar.

The green rectangle represents the back of the card. Drag the card to the right and it will turn face up. This represents a card being played by a player. In this case, it would be a Reinforcement card. You’ll note the card has a “Get Units” button. Click that and your units will be placed and a sound will occur …I know, it’s a dice rolling sound …I had it handy.

I made this easy on myself by naming all the regions 1 thru 10 and did the same with the units (see the map windows called Resources). That way I can just have the units send themselves to $BasicName$ (see UnitControl prototype). Of course, you can set up your regions and Send to Locations anyway you want.

OK. I understand all, however does this particular method only allows for a finite amount of units? Is there a way to create tokens from an unlimited database? The reinforcements card can show up quite often and draws from an off board source (let’s say space)…

EXAMPLE: A card that allows a player to call for reinforcements from space. They send down 9 orbital drop ships each with one one unit in them. They land at predetermined reinforcement spots.

EXAMPLE 2: Event card drawn says, Zombies know your location! They have sniffed out your hiding spot and have entered from all spawn points on the board (all of them).

In essence: is there a way to script the following:

  • Play the sound
  • create 1 tank, place unit onto grid at coords 1A
  • create 1 tank, place unit onto grid at coords 1B
  • etc
  • OR create 10 tanks, place onto grid 1A, 1B, 1C… etc
    [and be able to do this again and again and again]

All of the units are identical.

This isn’t absolutely necessary to perform the game, however instead of clicking and dragging new units onto the board 10x every two minutes the EASY button is there (whether on a card/toolbar). Yes it can be this often too. As you get further into the game every card you draw almost presents more and more units. I’ve played this particular game in real life, I just wanted to add an easy button to pulling out hundreds of penny markers :slight_smile: Otherwise this game is 98% complete…

Thanks for your help so far!


OK, so what I’ve done is taken an ‘action button’ and placed it straight onto my Main Map. I’ve created a seemingly limitless deck of tokens (hundreds of copied versions of each card). And I’ve auto-shuffled this deck so that when the button is pressed, it randomly selects 9 cards and places them into their respective spots.

The ‘Global Key Command’ is set to distribute a fixed number of pieces (9) as a maximum - to prevent the entire deck of cards from puking all over the board.

So far so good!

Nit Picky Question:
Other than to re-order every single reinforcement card in the deck (or relabel them in order)…

Instead of a Deck looking like this:
1111111122222222233333… etc etc

I want it to look like:
1234567891234567891234… etc

OR draw unique numbers from the deck every time (none of the nine cards drawn to equal another)

This would eliminate the randomness of placement, and instead just place a single token at every point. Instead for now, I hav a handful placed there, few here and none there. Do you follow?

I’ll take a closer look at this one tomorrow morning. I’m going to bed now.

LOL! Appreciate the help!

Just ran my first trial of a 3 player game. Worked great, except for the randomness of the reinforcements. It needs to change. LOL! and it was hard enough to keep up with the amount of tokens (needing to be moved every time this particular card shows).

In the final round of our game tonight, we had well over 100 of these reinforcement tokens on the board!!

Sorry about the thread necromancy - was this ever resolved? I’m in a similar situation.

I’m working on a Warhammer 40k mod and would like to load models (GamePieces) through a Java method. I’ve got map placement and everything down, but I can’t figure out how to “grab” a GamePiece (including prototypes, layers, etc.) from a palette. Is it possible to do so from Java?