How to orchestrate a massive random setup?

I have 10 decks (of anywhere from 75 down to 6 cards in a deck) that need to be distributed randomly to 50 sites across 2 boards for setup. Each site needs only cards from a few specific decks. It’s getting a little unwieldy, to say the least.

I was going to create a global variable for each site — a string containing the board, x,y coordinates, and how many cards from each deck. Something like
site1=“board2.330.250.0.3.0.0.1.0.6.1.0.0”
And I would split this string on “.” And get each “field”.

I would then have each of 10 decks loop thru all 50 sites, dealing out the required cards for that deck. A massive bookkeeping problem.

One problem is my newbie experience level — my first module. I’ve looked at several solutions to distributing cards to locations, and I think I understand some concepts, but there’s a whole lot of trial and error.

Since I need to do 2 or 3 levels of nested loops, I would like to know the best way of updating global variables and looping until a condition is met. Then when that’s done, firing off the next loop.

Any advice is welcome.

Trigger Actions are the best way to do loops; they have the ability built-in. The one caveat to beware of is to make certain you do not reuse any Loop Index Properties; unlike in traditional programming, where you might use a generic identifier such as i for multiple loop indexes, in VASSAL each Loop Index Property must be unique, or things will break.

1 Like

There are other ways to approach this that may be simpler.

I implemented a system where I had specific locations on the map and I had to deal a set of random event chits to those locations. Instead of worrying about driving the dealing part (It is a simple GKC), I controlled the delivery of the cards to the correct locations. Even though my requirement was much simpler that yours, I think my solution will scale up to handle your requirement.

I created a ‘Target’ counter which I placed in each of the target locations that required an event Chit, The target counter just has a Marker which makes it easy to find… Each Chit that needs to be dealt has a trigger that does the following 2 steps:

  • ‘Send to Location’ using ‘Any counter selected by properties’ and select the maker that defines the target.
  • Issue a Range 1 GKC to a Single Unit that Deletes 1 target marker in the same location where the dealt card has just arrived.

If you create one marker type for each Deck, and create a Stack of the right number and types of markers in each location (At-start stacks or predefined setup), then all you need to do is send a general, uncounted Deal GKC to each source Deck in order and the correct number of cards of each type will be dealt to each location.The dealing stops automatically when the last target marker of each type has been deleted,

2 Likes

Next snag: apparently you can’t send a GKC with a variable: DealDeck$DeckIndex$
Ugh! That means I can’t loop, and I have do several “get-ready-for-next-deck” steps in between within each in-line step. Double ugh!

It’s not clear from your description what exactly you are having a problem with here.

Can you post a screenshot of the GKC with it setup as you would like to use DealDeck$DeckIndex$?