Automatic card hiding on boards

Hey guys!
I wonder if there is simple recepy for this situation:
I have card decks for two sides. I want them to be hidden from opponent, unless they are dragged to special board, where they would be automatically unhidden.

I am working with NDZ on solving this problem, and I would like to provide more details.

This is my first time creating a module, so I do not fully understand all the nuances.

There are two sides, each with their own decks from which to build a naval task force using cards. The decks are in private windows. At some point one side will detect another (based on counter movement on the main map), and then the detected side will reveal his cards to the other. For that I use another window (called Detection and visible to both players) upon which combat also takes place using missile and aircraft counters to represent attacks. The counters are visible to both sides, but the ship cards are not.

I tried using a mask for the cards, but that did not show up on the Detection board, either. I tried using “Player Hand” windows for the players and detection, but the results were the same.

I can’t remember where I saw it, but I think the cards have an ownership trait assigned when they are drawn from the deck. If so, is there a way to change that when they are dragged to another window? I’m assuming this is the problem.

1 Like

I’m fairly new myself, and you may be trying this, but in the Map Window properties of your Detection window you can have a Key Command or Named Key Command applied to all pieces ending their movement there. With this you should be able to turn off an Invisible trait or unmask a Mask trait.

For additional details on how to apply a Key Command or Named Key Command to pieces ending movement on a map check out this trick: https://vassalengine.org/wiki/How_to_calculate_total_of_numeric_Property_of_all_pieces_in_particular_location/state. It’s doing a different thing, counting a property of pieces, but it shows how to get the action started using the Key Command or Named Key Command issued by the map.

I hope this is helpful and pointing you in the right direction.

1 Like

If you have a trigger below the mask trait in the trait list, it can activate the “flip” command on the mask trait. Mask itself, and everything above it, can only be activated by the “owner”.

1 Like

I tried the above suggestions, but I also tried using manual key commands (CTRL-M, CTRL-I) with respective card traits and nothing works. I even created another map window (public) for the card decks to start in. That allowed both players to see the decks, but when a player draws a card to move to the other public window (Detection) it is no longer visible to the other player.

Edit: I even tried drawing the cards from the public decks and dropping them in the same window. The other player cannot see the drawn cards. I can toggle the mask/invisiblity traits, but there is no effect on the other player’s ability to see the card.

I don’t know if it matters, but I have the decks set to draw cards face up, with no player restrictions.

I tried the module using the Retire button (hot seat mode). Everything works as intended, especially with the Detection board showing all the cards placed upon it regardless of player. It still seems that player cards are not visible to other players while playing an on-line game.

There are numerous modules using cards that have this working. You must be getting something very basic wrong. Instead of guessing what that might be, why not look at just about any other card game module to see how it is done?

Or post screenshots of your mask trait, the trait list, and the trigger to unmask?

Here are some screenshots, as requested.

This is the trait list for the card prototype.

This is the mask for the prototype.

This is the trigger action called MakeVisible.

This is the public map where the cards for detected task forces will be deposited so the opposing player may view them.

Oddly enough, the module works fine if I have each player perform a “Refresh Counters”. After that, everything that is supposed to be public works as intended. Cards appear and disappear from the public maps by just dropping/dragging.

That all looks fine.

Does the module start from a saved setup? If so, any changes you make in the editor will not be reflected in the saved setup unless you refresh it.

No, I don’t think I use a saved setup. I do have some at start stacks for checkboxes (little red squares that can be toggled on and off). Besides that, no counters or cards start on any of the maps. I take it that’s what you mean.

I mean what are now called “pre-defined setups” that you can select to load scenarios. They are essentially just saved game files, and do not update automatically.

I see what you are saying. No, there are no pre-defined setups.

The User’s Guide mentions syncronizing live server games to keep the counter positions up-to-date. Is that the same thing as doing a Tools|Counter Refresh?

No, those are different things. Synchronizing to an online opponent is how connected players ensure the game state is in agreement (if a connectivity interruption occurred). Counter refresh is how you make pieces in a saved game update themselves to whatever newer data might be in the buildfile’s configurations for them.