Almost there...

Hi guys!

Okay, my first module is almost ready to go. Apart from some cosmetic stuff, I have only one major hurdle left to leap. Hopefully, some of you veterans can help me out, here. I need to:

  • Have Vassal draw a random ‘Type A’ card, and place it face-down in a certain place on the board (there’s a thread around here where this is described, but I need it to tie into the other things, so:)
  • Have Vassal draw a random ‘Type B’ card, turn it CW 90 degrees, and place it face-up in a certain place on the board (similar procedure to the above, but listed here for the same reason)
  • Have Vassal draw a random ‘Type B’ or ‘Type C’ card, turn it CW 90 degrees, and place it face-down in a certain place on the board. And, finally:
  • Have all three actions performed with the touch of one button

All cards (Type A, B, and C) come from the same deck. The major problem I could possibly foresee is if Vassal tries to draw the same ‘Type B’ card for both steps 2 and 3. Could that happen? Also it’d be great if the button to perform this action could be in the toolbar (though I’m cool if it can’t), was accessible only to the owner of the deck in question, and could only be pressed once per game (it would be even better if all this would just automatically happen at the start of a game, but I hear that’s not possible).

Any help you gents can offer will be gratefully accepted! :slight_smile:

Well, aside from a philosophical question about why not just have players
do this manually, I will give some thoughts.

On Tue, Dec 20, 2011 at 2:05 PM, ijthompson ijor808@hotmail.com wrote:

I need to:

  • Have Vassal draw a random ‘Type A’ card, and place it face-down in a
    certain place on the board (there’s a thread around here where this is
    described, but I need it to tie into the other things, so:)

OK. The way I would approach this is to have a deck of ‘A’ cards, set to
shuffle and just draw the top one.

I’m pretty sure this can be automated.

  • Have Vassal draw a random ‘Type B’ card, turn it CW 90 degrees, and
    place it face-up in a certain place on the board (similar procedure to
    the above, but listed here for the same reason)

Similarly with a deck of ‘B’ cards. The flipping and rotation can also be
done by sending multiple commands to the card.

  • Have Vassal draw a random ‘Type B’ or ‘Type C’ card, and place
    it face-down in a certain place on the board.

Here I would start with a separate deck of ‘C’ cards, move them onto the
‘B’ deck after you have drawn one of the type B cards in the previous
action. Then just do the same thing, but from the combined deck of ‘B’ and
‘C’ cards. It will pick one of them. Since you already removed the earlier
B card from the deck it can’t get chosen again.

You should be able to automate moving all of deck ‘C’ to the deck ‘B’
location, along with this action.

And, finally:

  • Have all three actions performed with the touch of one button

Should be possible. I’ll defer to the automation experts on exactly how to
arrange it all. I would expect that this could be done by firing off
various key commands.

There is IIRC a feature request in for a game start ‘event’ which could
trigger actions. I don’t, however, recall when that is likely to appear. In
particular, I can’t remember if that is one of the things slated for the
v3.2 release or not.

Thank you for the quick response! You’re way ahead of me, though. Here’s my things:

I’m pouring over the documentation, but can’t seem to find how to make Vassal draw a card, at all. Link?

Me too, but… specifics? I’m really new to this whole ‘automation’ business.

Since all of the cards in question (A, B, and C) come from the same draw deck (which includes many other types of cards), I’d really like to avoid having a bunch of separate decks all over the table if I can. Could the same results be achieved by giving the cards in question ‘Marker’ traits of A, B, and C?

I’ve read about that, as well. Would love to see it. 8)

First off, I’m not an expert in any of this, since I haven’t actually done
any designs like that. But I understand the general approach.

On Wed, Dec 21, 2011 at 3:36 PM, ijthompson ijor808@hotmail.com wrote:

[This message has been edited.]

Thank you for the quick response! You’re way ahead of me, though. Here’s
my things:

“tar” wrote:

The way I would approach this is to have a deck of ‘A’ cards, set to
shuffle and just draw the top one.

I’m pouring over the documentation, but can’t seem to find how to make
Vassal draw a card, at all. Link?

I would try looking at sending a card to a location.
And then using a Deck Global Key Command. Look at p. 69 of the Designer’s
Guide

vassalengine.org/mediawiki/i … erguide.pd
and also p. 70, “Placing Random Pieces on a Board”.

That also suggests how you could do filtering, which roughly follows what
you outlined below.

Since all of the cards in question (A, B, and C) come from the same draw

deck (which includes many other types of cards), I’d really like to
avoid having a bunch of separate decks all over the table if I can.
Could the same results be achieved by giving the cards in question
‘Marker’ traits of A, B, and C?

See the Designer’s Guide (p 71) for a procedure on how to have a deck draw cards automatically. It’s for dealing random cards to a set of locations but you can easily modify the number of cards dealt or the number of locations.

Basically, the idea is to set a Send to Location trait on each card in a deck, set the deck to random, then create a GKC that triggers the STL trait on cards in the deck.

What you want is possible. The main problems you’re facing is the card selection process. If you want to draw a single Type A, B, & C card, you don’t want them combined into a single deck. The reason is, if you set up a trigger to draw one card of Type A from a deck, for example, Vassal will look at one card and if it isn’t a Type A, nothing will happen. So you would have to set up triggers to pull out and regroup the various types into their own decks if you want to get a specific type.

I do this all the time and it’s fairly easy to do once you’re familiar with the how to manipulate decks. If you’d like, you can send me the module and I’ll incorporate what you want. This should get you familiar with the process.

Ah, thank you for the response, Dr. Nostromo!

I’ve been trying to incorporate your methods from another thread here on page one (‘More Deck-Dealing Challenges’), and I’m having some success - the main difficulty (at this point) being that I can’t seem to get the GKC to fire without having an actual button that must be pressed.

I will get my info and module together, and quite happily send it your way! :slight_smile:

Using a button would be fine. If it’s a one time thing, just add a command for the button to delete itself once it triggers the cards.