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?