Where sendto $CurrentZone$ is insufficient to snap to grid

In various modules where a regular grid hasn’t been an option, I have used zones and a send to $CurrentZone$ trait triggered by the map key command as a way to have drag and drop pieces snap into position.

In my current module, I’m thinking about getting the same to work with what is just a square grid, but I’m pretty sure I can’t use a regular square grid because there are several discrete square grids and because of the irregular pieces shapes I’m working with.

So, I have a square grid, which is actually made of individually defined square zones.

I have pieces, which vary in size from a single square to eight squares.

Any piece whose centre coincides with the centre of a square is simple and would send to $CurrentZone$ without any further tinkering.

A square piece 4 square zones in size presumably requires additional tiny zones on each intersection of the grid, and each square zone to be further divided into 4. The four closest sub-zones, and the intersection zone, would all send the piece to the centre of the intersection zone. This means I’d also need tiny zones at the centre of each square to provide a destination for the pieces that formerly worked with sendto $CurrentZone$ now that each square is carved up into four.

Then I’m left with a piece whose centre does not coincide with the centre of a square zone or the intersections - it’s halfway along a square zone edge. I guess I’ll need a tiny zone halfway along each of the square zone edges, and the sendto command would trigger to send the piece to the nearest vertical square edge when the piece has one of two facings, or the nearest horizontal edge for the other two. I haven’t figured out the specifics of this, but I assume I could get it working with some generic calculations to find the “nearest” edge zone.

So, it should be apparent that this is a massive amount of faff for a minor improvement in user experience, and all because I’m not aware of any easier way to have complex shapes fit to simple grids on a board. Is there one? An easier way to do this?

This is an area that Vassal does not handle well (Pieces that are larger than the grid size), so I am not surprised you are having problems. You are heading down the rabbit hole and getting to the stuffy, squeezy part. I’ve not heard of anyone trying something like this before.

I would consider not using zones at all, that just sounds like hard work. I would try just using straight Send To Locations with a predefined offset for each counter that will adjust so that the center is in the correct location. I would use the Advanced X/Y Offset options uo move the piece to the correct grid square, and the X Position/Y Position to encode the offset to move the piece into position.

In the attached image, the grid size is hard-coded as 100x100. The Dynamic properties X and Y hold the Grid X, Y you want to send the piece to and the X Position, Y Position hold the appropriate Offset you need to shift the piece to get it line up correctly.

Have no idea how this will interact with your other counters, but it should work for Does Not Stack pieces. You could still have stacking pieces snapping to a standard Rectangular grid on top of these.

Ah, that sounds like a much better way to do things, thanks!

I would just need different sendto commands and triggers for each of 4 facings for the irregular pieces, or maybe facing-dependent {A?B:C} entries for the X and Y positions.

This has now gone from something too fiddly to bother with to something that might actually be worth doing…