Problem Accessing Pieces That Are Covered by Larger Pieces

I am fairly new to Vassal module development, and am having a problem.

Basically I have game pieces that have transparent areas. When moving the pieces around the board, if a player moves a small piece near a large piece, the small piece becomes covered by the large piece. Now this is not a problem visually, because the transparency allows players to see what is happening just fine.

The problem arises when the player with the small pieces wants to move hos pieces again. Clicking anywhere near them selects the larger piece. The only way to get to the small pieces is to move the large piece temporarily out of the way, move the smaller pieces, then return the larger piece. This is not a good solution though because moving pieces out of turn can cause problems with game play.

I have a very basic graphical example of what is happening…

The green thing is a large unit, the area near the barrel is transparent. The black square is the actual border of the graphic. The area under the barrel is transparent and allows the smaller blue units to end up underneath the larger unit. Once they get there any clicking automatically selects the green unit, and the green unit must be moved to select the blues.

So, hopefully that is a clear explanation of what is going on. As I said earlier I am pretty new to Vassal mod editing, so any advice would be appreciated.

On Jun 19, 2008, at 9:11 PM, cww256 wrote:

You might want to look at using “game piece layers” and putting the
smaller pieces in a higher layer. That way they won’t end up
underneath the big pieces. They will be on top instead, and thus easy
to select.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thanks for the quick reply. I am not entirely sure that your solution would work for me though.

If I understand how “game piece layers” work, it means that certain sets of pieces could be marked with a particular tag. An easy example would be some units marked as “air” and some units marked as “ground”.

A relationship between air and ground units easily solved by game piece layers, because air units are always above ground units, i.e they have a constant relative relationship to each other. Unfortunately, within my module there is no distinct difference between units, so I would have to create various arbitrary relationships that would have no consistency.

I am not quite sure that I can just say that ALL small units are “above” all large units. I may be way off here though, due to me lack of understanding of the Vassal engine.

Another thing to point out, is that the game does not place units on top of each other, it is just the transparent area of the pieces that is causing problems.

If there was some way to add a menu option that was something like “send to back” that would be a perfect solution. Is that possible? If I had two “game piece layers” for arbitrary level levels of the battlefield like “Above” and “Below” could I dynamically order individual pieces to jump from layer to layer?

If this is possible to do with game piece layers I think it would be a solution, but I cant seem to figure out how to do it. :confused:

Ahh, Occam’s Razor… :wink:

It seems that the non-rectangular game piece property is going to be a perfect solution.

Hi,

Sounds like you have found the solution to your problem. When building Vassal, there is often more than way to approach a problem. For your interest, I have answered some of your questions below

Regards,
Brent.

Yes, but the tag can be a Dynamic (ie changeable) property.

Yes, you can add a menu command the executes one of the Arrow keys. Down-arrow sends a unit to the bottom of the current stack,

Yes, by using a Dynamic Property for the Game Piece Layer property, you can use Menu Commands to change the value of the property which will cause the unit to change layers.

You can also add a Game Piece Layer Control which can turn layers on and off (i.e. hide all units on them), or rotate the layers to change which layer is currently on top.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Jun 20, 2008, at 2:34 AM, Brent Easton wrote:

I’m guessing that this would not help with the original problem, since
I don’t think the units were stacked (in which case the standard stack
manipulation commands would work), but rather that the larger pieces
overlapped the smaller ones that were in nearby locations.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Jun 20, 2008, at 12:19 AM, cww256 wrote:

Whether this would work depends, of course, on the behavior that you
want to have.

But sometimes the solution used in Vassal doesn’t have to have an
analog in the actual game. I may be done simply to make the interface
and interactions work better.

Unless you need the larger pieces to sometimes cover the smaller ones,
it would seem that this may work as a general solution. Being above
is just meant in a drawing and selection order sense.

But I see you have found a solution with non-rectangular pieces.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thanks for the replies.

The non-rectangular property was a perfect solution to my problem as it was not truly a stacking problem in the first place, but more of a graphical one.