unmasking cards when playing from hand

Hi,

I found in a previous thread and from looking at other modules how I could use ‘Mask’ to hide the cards in a players hand from other players.

However, I would like the cards to automatically flip over so that they become face up when they are played from hand on the map board. How can I achieve this?

Thanks in advance for any help. I’m new to Vassal and don’t have much programming background.

Hi,
unfortunately I don’t have an answer to your question, I also don’t want to take over your thread but I have a similar problem:

How can I change the ‘mask’ command so that it only either masks or unmasks a card. Currently it always just changes the ‘mask’ status from masked to unmasked or vice versa.
What I want to achieve is, that cards are always face up when they end their movement in a certain window, even if they already were face up in the first place.

Give all the cards a trigger action and set the trigger properties to
CurrentMap = ‘mapblah’ && ObscuredToOthers = true

This will always force the cards to be face up on the specific map

Post generated using Mail2Forum (mail2forum.com)

Same thing I just replied to for Ikarus. Give all the cards a trigger action
that will automatically flip the cards over when placed on the specific map
except in this case you want your properties to be:
CurrentMap = ‘blah’ && ObscuredToOthers = true

Post generated using Mail2Forum (mail2forum.com)

Forgot to mention:

In both cases, in the map that the cards go to, you need to set a key
command in the Map properties (labeled ‘apply key command to units that move
on this map’ or something like that). This key has to match the same key you
give the trigger action to make it automatic.

Will put together a demo mod this evening if still unsure

Post generated using Mail2Forum (mail2forum.com)

Sounds like this will make a great How-To (nudge, nudge, wink, wink…)

*********** REPLY SEPARATOR ***********

On 9/01/2008 at 12:27 PM Tim McCaron wrote:

[quote]
Forgot to mention:

In both cases, in the map that the cards go to, you need to set a key
command in the Map properties (labeled ‘apply key command to units that
move
on this map’ or something like that). This key has to match the same key
you
give the trigger action to make it automatic.

Will put together a demo mod this evening if still unsure

Post generated using Mail2Forum (mail2forum.com)

That trigger thingy works like a charm, thanks.

Although I have two minor follow-up problems:

  1. When I move a piece that is already face up to a map that turns pieces face up, the trigger shouldnt work (which is correct for the context-menu entry because it is greyed out) but I still get the report, that the face up card is getting turned face up.

  2. When I move a face down card from a players hand to the deck which is on the main board, where cards normally get turned face up, the game thinks it should turn the card face up and reports the contents which is not intended. So what is the easiest way to discern between the deck and the rest of the board for purposes of turning cards face up and/or reporting?

Thanks again in advance.

Thanks for the reply Tim!

It works like a charm!

Hi again, I’ve got a new question.

In my game there are several player hands and a game board. Each card has two trigger actions (‘Show’ & ‘Hide’). When a card is moved to the game board (map) it triggers ‘Show’:

When properties match: ObscuredToOthers = true —> perform a keystroke that unmasks the card

When a card is moved to a player’s hand (hand) it triggers ‘Hide’:

When properties match: ObscuredToOthers = false —> perform a keystroke that masks the card

This works fine, but I wan’t to make it possible to steal cards from other players. I’ve made the Hands visible to all players and they belong to each player. So any player can see all hands and can take cards from other players hands. However, the owner of the card doesn’t change so it is still masked for the player who took it and visible for the other player. I would like to change the owner of the card so that it becomes masked to the old owner and visible to the new one.

In other words, when a card is moved to a hand I would like to trigger an effect that changes the owner of the card.

I already have an idea how to solve it, but need help with the details:

-For each hand I need a key command that is run when a card is moved to the hand.
-This key command evokes a trigger action defined for the card
-the trigger action runs two key commands
-1) it masks the card if it is unmasked (so that cards drawn from the table are masked)
-2) it runs a short line that says something like OwningPlayer = Player 2

So basically I want to know, where do I write the last line that I want executed and what is the property name for the owning player?

Thanks in advance again and I hope I made myself understood in this far too long explanation.

Know what I mean, know what I mean :slight_smile:

I hear ya :slight_smile: Ok I put something up for it Brent, please edit if you feel necessary - my explaining of things is never very good :slight_smile:

http://www.vassalengine.org/wiki/doku.php?id=how_to:card_mask

Deebs,

Ownership is a little bit different. I seem to recall I tried to make a work around for this once but do not remember if it was successful or not.

What I would suggest try doing is that when the player steals the card from the owning player and places it in his hand have it perform an automatic sequence just like the card flip, to reveal the card and then unreveal it. This may transfer the ownership to the stealing player as they were the last to handle the card when it unreveals itself again.

Nice how-to, but is it really necessary for the trigger action to require the property “CurrentMap = MainMap”? Isn’t this taken care of by setting the command to run when a card ends its movement on the MainMap?

My problem remains that the trigger action gets reported, even though the action didn’t really happen because the properties for the trigger didn’t match. Is there a way to change this?

It’s not really necessary, but it helps define in knowing exactly the ‘where’, ‘when’ or ‘why’ property you are doing something with a trigger (in the example this would be the ‘where’ case) whenever you come back and need to troubleshoot your mod later on down the road if it is applicable.

With one map window in the mod it’s not too useful I agree, but if you had several map windows and the card only reveals on one map it is useful because it tells you ‘where’. You dont have to go searching all through your map windows properties looking for the keystroke that caused the trigger to occur. Of course if the card were to always be revealed on all your maps you wouldn’t use this property at all :slight_smile:

----- Original Message ----
From: Ikarus messages@forums.vassalengine.org
To: messages@forums.vassalengine.org
Sent: Friday, January 11, 2008 11:00:29 AM
Subject: [Module Design]Re: unmasking cards when playing from hand

Tim M wrote:

Nice how-to, but is it really necessary for the trigger action to require the property “CurrentMap = MainMap”? Isn’t this taken care of by setting the command to run when a card ends its movement on the MainMap?

My problem remains that the trigger action gets reported, even though the action didn’t really happen because the properties for the trigger didn’t match. Is there a way to change this?


Messages mailing list
Messages@forums.vassalengine.org (Messages@forums.vassalengine.org)
http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org

Post generated using Mail2Forum (mail2forum.com)

thanks, I’ll try the double flip.

Another thing: can I also exclude properties so that the trigger action only works when a certain property doesn’t match or can I require that only one of several properties have to match? For example if I have several maps and I just want the trigger to not work on one of the maps.

Yes, To exclude a specific map you would use the property CurrentMap != blah

You can use the following operators to resolve properties

= equals
!= not equal to
&& and
|| or
| or (another one but slightly different - don’t remember why)

< less than (numeric only)

<= less than or equal to (numeric only)

Post generated using Mail2Forum (mail2forum.com)

Awesome, thanks once again.