Create account / Log in

unmasking cards when playing from hand

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

unmasking cards when playing from hand

Postby Deebs » January 9th, 2008, 8:33 am

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.
Deebs
 
Posts: 8
Joined: January 9th, 2008, 12:06 am

Postby Ikarus » January 9th, 2008, 4:54 pm

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.
Ikarus
 
Posts: 20
Joined: January 4th, 2008, 10:46 pm

unmasking cards when playing from hand

Postby Tim M » January 9th, 2008, 5:58 pm

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 (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1823
Joined: December 8th, 2007, 12:22 pm
Location: Earth

unmasking cards when playing from hand

Postby Tim M » January 9th, 2008, 6:01 pm

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 (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1823
Joined: December 8th, 2007, 12:22 pm
Location: Earth

unmasking cards when playing from hand

Postby Tim M » January 9th, 2008, 6:27 pm

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 (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1823
Joined: December 8th, 2007, 12:22 pm
Location: Earth

unmasking cards when playing from hand

Postby Brent Easton » January 9th, 2008, 9:05 pm

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 (http://www.mail2forum.com)
User avatar
Brent Easton
 
Posts: 3257
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: unmasking cards when playing from hand

Postby Ikarus » January 9th, 2008, 11:05 pm

Tim M wrote: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 (http://www.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.
Ikarus
 
Posts: 20
Joined: January 4th, 2008, 10:46 pm

solved

Postby Deebs » January 10th, 2008, 12:52 pm

Thanks for the reply Tim!

It works like a charm!
Deebs
 
Posts: 8
Joined: January 9th, 2008, 12:06 am

new question...

Postby Deebs » January 10th, 2008, 2:25 pm

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.
Deebs
 
Posts: 8
Joined: January 9th, 2008, 12:06 am

Re: unmasking cards when playing from hand

Postby Tim M » January 11th, 2008, 3:25 am

Brent Easton wrote:Sounds like this will make a great How-To (nudge, nudge, wink, wink...)


Know what I mean, know what I mean :)

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

http://www.vassalengine.org/wiki/doku.php?id=how_to:card_mask
User avatar
Tim M
 
Posts: 1823
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby Tim M » January 11th, 2008, 3:32 am

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.
User avatar
Tim M
 
Posts: 1823
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: unmasking cards when playing from hand

Postby Ikarus » January 11th, 2008, 5:00 pm

Tim M wrote:
Brent Easton wrote:Sounds like this will make a great How-To (nudge, nudge, wink, wink...)


Know what I mean, know what I mean :)

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

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


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?
Ikarus
 
Posts: 20
Joined: January 4th, 2008, 10:46 pm

unmasking cards when playing from hand

Postby Tim M » January 11th, 2008, 5:27 pm

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 :)


----- 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:
Brent Easton wrote:
Sounds like this will make a great How-To (nudge, nudge, wink, wink...)



Know what I mean, know what I mean :)

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

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


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 (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1823
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby Deebs » January 11th, 2008, 6:15 pm

thanks, I'll try the double flip.
Deebs
 
Posts: 8
Joined: January 9th, 2008, 12:06 am

Postby Ikarus » January 12th, 2008, 4:01 pm

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.
Ikarus
 
Posts: 20
Joined: January 4th, 2008, 10:46 pm

Next

Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests