Help required for noob

Hi all. Noob here.

I am just playing around with module design. I have some questions that I hope to find help with. Hopefully somebody will be able to help me either with an small example mod or explaining what I should do.

  1. I have 3 stacks of cards labelled Stack A, Stack B and Stack C. I can take the top card of any stack and add to the board. However, I can also replace cards from the board and back to the appropriate stack. How can I prevent cards from being returned to the wrong stacks? (i.e. a card belonging to stack A being placed in Stack C by accident)

  2. I want to create a solitaire game that has a deck of 100 cards. At the beginning of the game I want to randomly set up four columns of 10 cards (going downwards and overlapping each other slightly, so you can see each card in the stack) and a separate stock pile. How can I do this?

Thanks for any advice.

Give each card a Return to Deck (RTD) trait (or a Prototype trait with the RTD trait in the prototype).

Menu Text = Send to Deck
Menu command = CTRL R (or any hot key you want)
uncheck “Chose destination deck at game time” and this will allow you to select which deck the card should go to.

Then a player can right-click a card, select Send to Deck and the card will go to the deck designated in the RTD trait.

You can use multiple RTD traits on one card if there is more than one deck that the card could be set to, as well. Just make sure to give each one a unique Menu Command hot key.

I can throw a sample together this morning for this concept. Check back later today.

Here’s a sample for you. It has a stack of 100 cards. Click the Deal button and it deals out 4 stacks of 10 cards each.

Just change .zip to .vmod on the attached file and load it into Vassal.

Thanks for the response.

The stacks example is great, but how can I get each individual card to overlap, so each of the 4 stacks are vertically aligned and overlapping one another (so you can see the card underneath the previous one? each stack should look like this:

Once again, many thanks, I appreciate it.

Here’s a sample that does that. This one is going to require some explanation.

In the previous example, I used empty decks and the RTD trait to send cards to those decks. For the display you want, that won’t work.

I removed the empty decks and placed Region Points on the map (look under Main Map [Map Window] - [Map Boards] - Main Board [Board] - [Irregular Grid]). These represent the points the cards will be sent to.

There’s a quirk in the Vassal editor that I need to point out or you’ll probably never find out how I made the cards cascade. If you go into the properties of [Game Piece Prototype Definitions] - Card Common [Definition], you’ll notice the Send to Location traits used to send the cards to the region point. Near the bottom you’ll see an unchecked box called Advance Options. If you check this box, the offset options will appear. So, keep in mind that if you use offset options and save the trait, the next time you open it, the Advanced Options box will not be checked but the offset commands are still there and operational.

You’ll note that I have the cards set to offset by 20y times $CardCount$. The CardCount is a Global Property that I included. This keeps track of where to place the card. For example, if the CardCount = 5, the card will move to the Region Point and then drop 20y * 5 or 100y

If you look at the Main Map properties, you’ll note that I’ve set the map to fire a CTRL 0 (zero) to a piece that is moved to this map. The CardCommon Prototype has 2 Trigger Action traits that are set to fire on a CTRL 0. One is set to fire if the CardCount < 10 and one is set to fire if the CardCount = 10. This sends a command to a Set Global Property trait that will either increase the CardCount by 1 or reset it back to 1.

Thanks for that example. Exactly what I was looking for!

Thanks for the example, it has helped a great deal.

I also created a discard space for card discards. When a player right clicks on a card (from any of the 4 stacks) he can select ‘Discard’ from the menu to send a card to the discard space. Now, in a similar vein, is there any way to position the cards so that any time a player sends a card to the discard space, they are ‘ribbon spread’ in the discard stack (going across, instead of down)?

Here is a basic example of what the layout would look like (ignore the values of the cards, they will all be different). The discard space could also be much longer:

Here’s what you would do:

Create a Global Property called
DiscardCount
Initial value = 0
numeric
Range = 0 to 100 (assuming there’s a total of 100 cards)

Create a Region Point on the map which will be the center point of the first card that’s discarded. Let’s call it DiscardPile

In the card prototype, add the following traits (Note that a list of traits is executed from the bottom up so you would list them in the prototype in reverse order than shown here)

Trigger Action
Menu Command = Discard
Keystroke = ALT E (or whatever you like)
Perform these keystrokes
ALT F
ALT G

Send to Location
Keyboard Command = ALT F
Destination = Region on Selected Map
Map = Main Map (or use the Select button to select the map where you placed the DiscardPile Region Point)
Region Name = DiscardPile
Advanced Options
X offset = 20
times = $DiscardCount$

Set Global Property
Global Property Name = DiscardCount
numeric
Range = 0 to 100 (or same as DiscardCount Global Property)
Key Command section
Menu Command = (blank)
Key Command = ALT G
Type = Increment numeric value
New Value = 1

When you right-click a card and select Discard, this process will send the card to the DiscardPile Region Point and increase the DiscardCount by 1. This will cause the next card, and each subsequent card, to move 20x to the right of the last card.

Worked great. Thanks.