Snap to Grid

I am working on a module for Gheos, which is a tile-laying game using triangluar tiles. Maybe I’m just being retarded, but I cannot figure out how to make the pieces snap to each other. I would prefer to use a deck, as opposed to a stack, but whatever way I can make it work. Is there a way to make an isosceles triangular grid on my board without plotting every single intersect? Alternatively, is there a function that will just make one piece snap to another, and can I define the snapping points? Or am I just missing something simple because I’m working on this at 4 in the morning?

Thanks for any ideas.

-v

I don’t work with the hex grid feature very often but I believe you can have it automatically set up grid points for corners and edges. So, in theory, you could overlay a hex grid onto a graphic using a triangular grid and work it out that way. There is no way to have Vassal simply create a triangular grid.

You could also use the Irregular Grid feature and manually plot all your region points.

As far as the other problem, create a Prototype for all your tiles and use the “Does Not Stack” feature to set stacking attributes. You’re Map Window should also have a Stacking Options trait.

*********** REPLY SEPARATOR ***********

On 3/06/2009 at 3:49 AM d4rkr00m wrote:

If the triangles where equilateral, the snap points will all line up and you should be able to use an appropriate sized rectangular grid (with the the grid display turned off).

This should also work for isosceles triangles if the snap point is at exactly half the height of the triangle.

If you want a snap-point that is not at the mid-point, it will be trickier, but possible. There are two ways it could be done.

B.


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

Post generated using Mail2Forum (mail2forum.com)

The snap-to points of a triangular grid, where snapping is to the triangle center, is identical to a Rectangular grid of an appropriate size. Try drawing it out. If you draw the triangles on the map and turn the grid display off, VASSAL doesn’t care what shape your pieces are.

B.


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

Post generated using Mail2Forum (mail2forum.com)

On Jun 3, 2009, at 3:49 AM, d4rkr00m wrote:

Well, a hex grid also happens to be a grid of points that are the
vertices of equilateral triangles.

Unfortunately, there doesn’t seem to be a way to just display the
center dots of a grid without the lines.
(This should be an RFE: Allow center dot display independently of
grid lines)

So just use a hex grid and you get a triangular grid as well. You
would have to create the actual view of the grid locations (dots or
triangular lines) using an image program, but you should be able to
fit the grid to it.

I got this insight when looking at the Crayon Rail games (Empire
Builder, Eurorails, etc.)


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

Post generated using Mail2Forum (mail2forum.com)

A rectangle will not work as these are equilateral triangles. ie 2 of them make a diamond, not a square. 6 of them DO make a hexagon, however.

I think the problem is my snap-to point. I believe it is in the center of the image, NOT the center of the triangle. I seem to remember there is a way to change the snap points on a card or piece. Can somebody remind me of where/how I can do this?

Thnx guys.

-v

Yes, but do not get confused between the shape of the grid and the shape of the counters. If you carefully draw out a set of triangular counters and mark all of the snap-to points, you will find that they all line up in a set of horizontal and vetical lines. Create a Rectangular grid based on these lines and you will have all the snap-to points you need.

You can adjust the position of a Layer relative to the centre of the counter of the counter by an offset. You can use this to offset the apparent snap position.


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

Post generated using Mail2Forum (mail2forum.com)