My First Question - Layers

Hello! Quite intrigued with Vassal and decided to take the plunge and make a game with it. Picking it up slowly and have the basics down but I have a question regarding layers.

Say you have a car at 0,0 facing right and its next move will be 10 hexes. It must travel the full 10 hexes but it can turn so there is a range of possible end locations. For simplicity sake, I’ll just say that the end locations can be anywhere from 10,-10 to 10,10.

I figured out how to have a layer pop-up so that part is done. The overlay would have the possible end locations highlighted but here is the problem. When the player decides where to put the car, he physically has to move it but the overlay moves with the piece. This is a problem as it would be very easy to lose the end location.

How can you have a layer appear at the piece but then not be affixed to it?

Hope I explained that clearly…

Thanks in advance!

Could you give more details on how you’re accomplishing this? Are you using an Area of Effect trait, or a Layer trait, or is your overlay a separate game piece?

Hello DrN,

If you are referring to my initial pop-up overlay, it’s done using transparent PNG images pre-sized to the particular need. Ie, the play does a CTRL-R and the layer pops-up. It’s an illusion that the move areas are being highlighted as really, it’s just a big picture. This will work if you are using hexes or an “open” board.

The 3rd step will be to use a speed variable to auto load the correct overlay. So, if the car is moving 10 then when the player presses CTRL-R, the “10” overlay pops-up. If the player reduces speed to 8, then when they press CTRL-R, the “8” overlay pops-up. I see that variables are used so this should be doable…just haven’t looked into it yet.

But, I am sill stuck at step 2…the automatic placing of a static overlay relative to the selected piece, but not having that overlay anchored to that piece so you can move the piece without moving the overlay.

Hope that helps…

You should be able to disable stacking on the map under Stacking Options. This should prevent the car and overlay from sticking to each other. Also, add Game Piece Layers to the map window (if you haven’t done so already). Call it something like MapLayers and then include Overlay and Car in the list. The highest item in the list is the lowest layer on the board.

On your cards, add the marker trait

MapLayers = Car

On the overlays, add the marker trait

MapLayers = Overlay

This will insure that the overlay is under the car and on a separate layer so you should be able to control them independently.

Thanks again DrN. I think that will work!

I came to the conclusion that maybe the default way layers work will be good enough for now so…

…if it’s not, I will revisit the thread in the future.

Thanks again!