Placing a Random Card At Start

This is a noob question I think. I’m guessing there is a simple obvious answer to this that I am missing somehow.

I want to place a random token, which will be a card from a deck, on the board as an at start stack.

I want the token to be randomly chosen from the deck.

All I can figure out how to do is place a specific predefined card within an at start stack. Is there a function to choose a random card from the deck and then place it on the board at start?

With Vassal 3.1 to do this you need a player to click somewhere. The click (e.g. on a “setup” button somewhere on your maps) will need to fire a global key command to issue a send to location or move fixed distance on the deck where your cards are. Make sure limit is set at first card in deck, so that the first card will be randomly selected and put wherever you need it.

With Vassal 3.2 I think I read somewhere you can have this kind of initial setups done automatically for you when first starting a game, but I don’t know the specifics. Or maybe it was a feature request for Vassal 4 …

Thanks for the info - I think I understand that - I also noticed that it seems the module for Quarriors! does this same thing that you described - I’m wondering if I can adapt it to a situation where I have multiple boards - there would have to be more than one setup button it seems - is that right?

I guess it depends on what you mean by multiple boards. I have seen 2 different uses of the multiple board setups:

MULTIPLE BOARDS TO BUILD A COMPLEX BUT FIXED SETUP: e.g. in my module (Marvel Heroes) the main map uses multiple boards preset in an 5x4 array of boards (or something of the sort, don’t remember the actual number and it’s impossible to check without having to rebuild it all by trial and error…) so that players always see the same end result in front of them (it appears as a single map but it’s actually a puzzle of many maps, each with different zones and grids). I made sure my various setup buttons were placed in specific spots/boards via at-start-stacks at the appropriate location in the appropriate board.

MULTIPLE BOARDS TO BUILD A SIMPLE (1 board) BUT PLAYER CHOSEN SETUP: e.g. in Smallworld where the game host originally picks the board corresponding to the number of players expected. If this is your case then you need to make sure your setup button shows up on any/all boards after one has been chosen. Just use an at-start-stack at some coordinates used by all boards?

Create a region point on the board where you want to place the random token (use Irregular Grid options). For this example, call the Region point PlaceHere

All the tokens in the deck need to have a Send to Location trait that will send the token to PlaceHere. For this example, let’s say you use CTRL A to commit this action.

Have some sort of Global Key Command triggered to send a command to the deck to retrieve one token from the deck. The GKC would look something like this:

Global Key Command
Command Name - (What you want on a right-click menu if you’re triggering that way)
Keyboard Command - ALT A (or any key you want)
Global Key Command - CTRL A (the command that will trigger the Send to Location trait in the tokens)
Matching Properties - CurrentMap = (name of map the token deck is on) && DeckName = (name of the token deck)
Within a Deck, apply to - 1 piece

This will retrieve one token at random (if the deck is set to always shuffle) and place on Region Point PlaceHere.

Thanks for that - It’s funny that you mention Small World because the module I am working on is Small World Underground

I don’t have time right now to try that out but I wanted to say thanks for the help :slight_smile:

I just saw this and realized I never replied about how it worked out for me - it worked great and thanks again for the help.

I’m not following these instructions and getting confused on how to apply it to setting up a game in Bios Megafauna.

I have a main draw deck, that cards are to be drawn from and moved to 4 other decks and while some parts I understand, I’m not getting the entire process correctly.

I can set a global key command.
I can set a keystroke for each card in a deck to move to location X or deck x.
But somewhere in the middle I’m not sure how to designate it to ‘only’ apply to the main deck and how to I trigger 4-5 other global key commands.

I’d mostly like to see a game that uses this to setup multiple decks of cards with a single click. Do you have any suggestions on a module I could look at?

In the property match expression of the GCK, you’d add DeckName = insert your deck name here in order to restrict the GCK’s scope to just the cards in the deck you intend to draw from. This will be considerably simpler if that target deck is set to Reshuffle = Always.

If you then want to subsequently fire a bunch of other commands, you can do it via a Multi-Action button in the toolbar.

If you can lay out a more complete description of what you’re intending to implement, I can provide more information or possibly point you to something that does what you’re looking for.

Thanks. I’ll toy with that.

That works great. Thanks…

ok, part two… tiles for Bios-Megafauna setup. Draw a tile and put it in the site with lowest climax in a row.
A: (Jet Stream 1, Jet Stream 2…)
B: Setup a global command to draw a card and activate a trigger in the card-> (trigger for each jet stream location…
b1- Trigger conditionally triggers if the matching Global property is the lowest, and moves the card to that site.
b2- Update the global property to the value of the card that was just played at the site.
b3- ?

Repeat 21 times… (and have a separate series of tests for each type of type drawn from the same location)…

I’ll tinker with this. I think I can figure it out, but I can’t figure out how to send a card that was previously drawn, to the discard pile since I’d need to trigger that card again. Except ‘almost’ every card has an individual climax number, so I might find a command for… wow. I’m going to need lots of global keyboard commands.

JoelCFC25… Thanks again. I’ve found a way to make it work. It was quite a Rube Goldberg mechanism. So I deleted it started over, and found a more elegant way to make it work… I’m still re-writing the code.