Create account / Log in

Stacking in Player's Hands

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Stacking in Player's Hands

Postby Ikarus » January 9th, 2008, 5:01 pm

From what I experienced, cards in a player's hand can't be stacked as usual (i.e. one card behind the other) but they always appear next to each other. Is there an option that I could have overlooked to enable normal stacking in player's hands?

Also it would be cool to be able to assign a stacking trait that controls how a specific card stacks, e. g. to have one card stick out of a stack of cards. Or might it be possible to have two (or more) cards on the same level stacked upon another card?
Ikarus
 
Posts: 20
Joined: January 4th, 2008, 10:46 pm

Stacking in Player's Hands

Postby rk » January 10th, 2008, 1:36 am

From what I experienced, cards in a player's hand can't be stacked as usual ( i.e. one card behind the other) but they always appear next to each other. Is there an option that I could have overlooked to enable normal stacking in player's hands?

You can do this. First, delete the Stacking Options component in the Player Hand. Then, right-click on the Player Hand and choose "Add Imported Class" Enter " VASSAL.build.module.map.StackMetrics" This will add default stacking behavior to the Player Hand.

rk

Post generated using Mail2Forum (http://www.mail2forum.com)
rk
Site Admin
 
Posts: 536
Joined: October 21st, 2007, 3:31 am

Postby Ikarus » January 10th, 2008, 10:50 am

Thanks, that works... mostly. The thing is that with the imported class specified by you I can neither expand stacks nor select specific cards from a stack so that when cards are stacked I can't "unstack" them.
If these stacking option are supposed to be the same as those of the main map window then I don't get why it doesn't work in the player's hand because in the main map windows it does work that way (expanding cards plus selecting unique cards from a stack when expanded).
Ikarus
 
Posts: 20
Joined: January 4th, 2008, 10:46 pm

Postby Ikarus » January 12th, 2008, 6:11 pm

Ok, I think I solved my own problem. I'll post it here since it hasn't been adressed in this thread yet.

What you (however has this problem besides me) need to do is to implement the class "VASSAL.build.module.map.StackExpander", but when you try to do this the way described above in this thread, you get the error-message "Class must implement the Configurable interface" and to get around that you just have to open the buildFile of your module and add the line "<VASSAL>" below your stackmetrics for the player hand. Done.
Ikarus
 
Posts: 20
Joined: January 4th, 2008, 10:46 pm


Return to Module Design

Who is online

Users browsing this forum: marcR and 5 guests