Random drawl pile of mission specified game pieces (not cards)

I’ve searched around and I can’t find an answer to this. I’m trying to create a draw pile (deck or at-start stack?) that allowed me to drop a few units (single pieces) and markers into at the beginning of the game and then draw random units from. I’ll try to explain better.

I’m modifying an existing module of Conflict of Heroes: AtB (3rd ed) to support the Eastern Front solo expansion. This being my first time editing a module I’m pretty happy with what I’ve been able to do. That being said, I can’t figure out how to do the rumored enemy (RE) draw pile.

Basically there are a few solo missions where there are rumored enemies on the map, represented by generic RE units that move around on the map like regular units until they are attacked, attack the player, or are in open terrain in LOS of a player unit. At that point the player is supposed to randomly draw from a pool of specific unit markers as well as a few No Rumored Enemy markers to determine whether the “rumor” was true or not. For example, in one mission the draw pool would include 3 Panzer II’s, 2 Panzer IV’s and 5 No RE chits. If a No RE marker is drawn from the pool the RE unit on the board is discarded and it’s as if you got bad battlefield intelligence. If one of the specific enemy units is drawn (ie, a Panzer II) that unit is placed on the spot where the generic RE marker was and proceeds to act like any other enemy AI unit.

Naturally, all of the units, No RE markers are set up as single game pieces. Is there any way for me to to be able to throw the specified game pieces into a draw pile which would shuffle the pieces and keep them masked until drawn?

It looks like only decks allow random draws but it seems like you can only add “cards” to the deck, not existing game pieces. I could create a whole deck of cards that look just like units/no RE markers but that’s a cumbersome way of solving this problem. Ideally I would want to draw a unit from that pool and immediately place it onto the game map.

Sorry for the long winded question. Any ideas?

A card is just a stackable, movable piece which includes a Mask trait. So you could create a deck somewhere appropriate to the module and create your RE markers there. Once removed from the deck, these markers will stack with other pieces in the same Game Piece Layer.

There’s more that you can do if you need things like automatic setup / random placement.

Is that any help?

What you’re saying is I would ultimately be recreating all of the existing units that might need to go into the deck as cards, and then just use those as game pieces? I kind of already figured I could do that but was hoping i could simply use the existing assets (game pieces).

You can add the traits that you need to existing pieces.

There is a utility (from Tools menu) to “Refresh Counters” which will apply your changes to an existing scenario. If you are just creating new scenarios for this feature, then you won’t need to refresh.

After fiddling around with the module again I realized that creating a deck and manually adding game pieces kind of works. I can create a stack of units and each time I draw one it’s randomized. My only gripe is that I’m not sure there is a way to create some kind of mask for the deck so I can put a generic rumored enemy graphic that stays on top of the deck at all times (without turning all the pieces into cards instead).

So are these pieces that normally have two sides and you want to have a third side for when the pieces are in a deck ?

Yes, I assume that means adding a layer to the pieces. How would i make that layer active only when the piece is in a specific deck?
Or, is there a way to simply impose a graphic over an area that will always be on top?

Have the layer for the normal sides of your piece; on reflection it is perhaps like that already in the module. Then the mask image will conceal your pieces whenever they are “face down”. You can configure the deck to be face down and pieces to draw as face up.

First I want to say thank you marktb1961 for your help. Your suggestion of turning all of the unit pieces into cards would in fact work, but I wasn’t ready to do that so i kept fiddling around and I think I’ve figured things out

For anyone else trying to create the same kind of mechanic here is what i did:

  • Create an empty deck with Re-Shuffle on always
  • Create an at-start stack on the same exact location as the deck
  • Add a single piece to the at-start deck and assign an image to that piece (this will act as the mask for the deck)
  • Add the Does Not Stack trait to the piece and set all settings to “never”

Now when i add pieces to the deck they are masked by the image from the at-start deck. Unfortunately this also means I can’t click and drag anything from the deck because the at-start stack is blocking that function but I’m pretty sure I can turn the at-start stack into an action button which will draw an item from the deck.

I’m also planning on adding a context menu action to the RE units on the map that will auto draw from the RE draw pile so I don’t really need to be able to physically pull chits form there.

Placing pieces “on top” of a deck doesn’t work reliably, in my experience; there is no way to assign the deck to a Game Piece Layer (GPL), so it’s always on the default top GPL, which means there’s no way to ensure your masking piece is always above it; sometimes it will be, sometimes it won’t.

You need to get over your resistance to turning pieces into “cards”; as far as VASSAL is concerned, there is no difference, a deck can hold any piece; you simply need a Mask trait if you want the pieces to be unidentifiable while they’re in the deck (and you can configure the deck to automatically turn them “face up” (which simply hides the Mask) when dealt (e.g., removed from the deck)).

Edit: This is where it would be very handy if you made your pieces using prototypes; if they all share a prototype, you can simply add the Mask trait to the prototype and you’re done.

As jrwatts said, trying to put a cap piece atop a deck is unreliable. In fact, I sometimes put button pieces under a deck so they don’t appear until the deck is empty.

FYI,

  1. There is almost no difference between a card and a piece. A card is a piece with a mask. Stop worrying about that.
  2. Decks don’t care about masks or cards. You can put any pieces in a deck. The only time you need masks in a deck is if you set it up to be face down.
  3. If your deck always shuffles, then what you see atop a deck is likely not what you will draw.

If I were you, I’d make the deck invisible and use buttons to draw from it. Then you can skip masking. How? Give the deck a large negative position. E.g. your pieces are 50 x 50 pixels. Put the deck at (-100,0) or (0,-100). The deck will be on the map but not in the visible area. I do this all the time.

1 Like

Just note that this is an unsupported hack that just happens to work (siting Decks at negative locations). While not being officially supported, it is extremely unlikely that we will change anything in V3 to break this (Officially tolerated?).

But this does have consequences, you cannot scroll the map to a negative location and manually draw from or interact with the Deck, so it makes debugging the module much more difficult. So you may want to start development with the Deck on the map, and move it out of the way later.

Thank you all for the assistance. I’m resigned to using the deck “as is” without a mask. I’m all about nice aesthetics but I can live with the way it is. I have a functioning draw pile that I can customize for individual missions so that’s good.

Now I’m having trouble with my plan for creating an auto-draw button for the RE deck. I tried copying the procedure to do this from the hit marker decks in the same module but couldn’t quite get it to work. This is the situation:

There is a rumored enemy marker on the main map. It’s within LOS in open terrain of one of my units so it’s time to draw from the RE deck to determine if it’s a real unit or just bad intel. Ideally I would right click on the RE unit and choose “Draw RE” from the menu. A random piece would be drawn from the RE draw deck and placed on the hex where the RE unit is. As an extra bonus it would be nice if it would also delete the original RE unit but I’m not sure if that’s possible.

I had it kind of working where it drew a piece from the RE deck but then it disappeared into the void instead of making it to the main board. It’s strange because I went over all the elements that the original CoH:AtB module used to do the same thing with the hit marker pool. I’ve looked again and again at every involved element and I don’t see what I could be missing.

  • The RE unit Prototype has Set Global Property trait to gather the x and y coordinates on the map.
    -The RE unit has a Global Key Command trait to draw a single piece from the RE deck
  • The RE unit has a Trigger Action that performs the x/y coordinate commands, plus the RE draw command (in that order)
  • I made sure any unit/marker type that could be included in the DE draw deck had a Send to Location trait that pointed to the main map and the given x/y coordinates

I feel like i’m asking a lot. Maybe there is another module that someone could point me to that has similar mechanics. Thanks again.

That all sounds correct; we would have to see the actual traits to figure out where you’re going wrong. First, remember that everything in VASSAL is case sensitive; if you call a Global Property Xcoordinate (for example), you can’t try to refer to it later as xCoordinate or xcoordinate or XCoordinate, for example.

And by the way, to delete the original RE unit after drawing the replacement, it’s as simple as adding a Delete trait to the RE unit and triggering it as the last action in that Trigger Action you’re already using.

Edit: one step you didn’t mention: are you sending a Global Key Command (GKC) to the freshly-drawn unit to trigger the Send to Location (that would be the next step in the Trigger Action, before an optional Delete)?

I don’t think I am sending that command because I didn’t see it anywhere in the hit marker Trigger Action sequence yet that one still works. I was wondering how that was possible. I’ll give it a shot.

I got it working! ! I had to dig around a bit and I’m not sure I could do it again if you asked me to create it from scratch, but it’s working. Thanks for the help, all

2 Likes