Masked Unit Rotation

I working on an AH 1914 VASSAL module. In the original game, the back, hidden side, of the pieces showed “defensive lines” on the top and an arrow on the bottom. I want to use layers to show the decrease and increase in unit values as they take losses and reinforcement so I thought I’d use masking to show the hidden side of the counters. The pieces need to rotate to show which hex sides they are defending.

I got it to work fine for the side that does the masking, see “Allied View” below. But when I switch to the German player, the masking only works as desired as long as the top of the unit is pointed to the top. The rotated pieces don’t show the masked side, they show the display view. See “German View”.

Anyone know if I can keep the masked side when rotating and if so, how do I do it? :slight_smile:

Thanks,

Jim

I read where I had to have the “Can Rotate” as the last trait and obviously after the “Mask” trait. I had alreay done that.

I just added the “Text Label” trait between the “Mask” and “Can Rotate”. If I actually add a text label, even just a space, everything works like I want. If I don’t actually have any text or spaces, it doesn’t work. :confused:

Jim

Hi Jim,

Potential bugs can only be investigated if you supply a link to your module and a log or save file of a game situation demonstrating the problem.

Regards,
Brent.

On 11/07/2009 at 11:40 AM jimpyle wrote:


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

Post generated using Mail2Forum (mail2forum.com)

Hi Brent,

Here’s where you can find a copy of the module.

mediafire.com/download.php?umzzkzmdi0i

Thanks for your help.

Jim

Hi Jim,

Thanks for the link to the module and the detailed description on how to generate the error.

The way you have specified your traits is correct.

It turns out to be a bug in the way ‘Can Rotate’ draws pieces when you change sides without restarting the game. You will find that if you save the game as allies, then close the game, then change your password, then load the saved game as germans, the pieces will display correctly.

Joel, I have created bug 2821853 for this and assigned it over to you. I’ve done some investigation and tried to fix, but couldn’t get it to work.

The problem appears to be in GamePieceOpImpl.isChanged(). It does not take into account that the current Player’s side may have changed, thus affecting how he views the piece. A GamePieceOpImpl is only used when the angle of rotation is not 0, thus explaining the initial symptom. I thought saving the side when the GamePieceOpImpl is created and checking this in isChanged() would fix the problem, but it seems to be something deeper in the Op caching.

B.

On 11/07/2009 at 6:45 PM jimpyle wrote:


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

Post generated using Mail2Forum (mail2forum.com)

Thanks for the help, Brent!

Jim

We believe we’ve fixed this bug in the current 3.5.6 development build. Please try VASSAL-3.5.6-SNAPSHOT-26b3c7d or later: vassalengine.org/builds/