Send-to-grid location: (x,y) offsets are ignored

I’m implementing a send-to-grid-location. I’m concerned with only one row of a rectangular grid, and the grid numbering of that row is A00, A01, A02, etc. I want to deal out a row of cards, so I’d like to implement something like {“A0”+index) where index is an incrementing global property. I notice that that the grid target is not a bean shell field, so I can’t do what I thought. Instead I decided to use the (x,y) offsets. I would send to A00, set the x-width to the grid cell width (e.g. 200 pixels), and the x-multiplier to “index,” which I would increment after each send.

This did not work. All cards went to A00 no matter what I did. Vassal seemed to ignore the (x,y) offsets entirely. I thought maybe “snap to grid” or stacking might be interfering, but no, that didn’t matter. To check my sanity, I changed send-to-grid-location to send-to-pixel location with the (x,y) offsets, and this worked as expected.

So it appears that the (x,y) offset are ignored with send-to-grid location. I can avoid the problem by using send-to-pixel location, which I did, but the problem makes send-to-grid-location kind of useless.

Hmm. For some reason Offsets have been specifically disabled for the ‘G’ option. I can’t’ think of any reason for this.

I have added an issue Enable Offset options to work with the Grid option in SendToLocation · Issue #10505 · vassalengine/vassal · GitHub and will get if fixed for the next beta.

Try the VASSAL-3.6.0-SNAPSHOT-bf20143-10505_STL_offset build.

Is it possible that offsets were disabled because they mess up snap-to-grid?

I don’t think so, the snapping happens after the target destination is calculated on all send types.

You’ve made a bad assumption there–the grid target field may not have the Calculation button that normally indicates a BeanShell field, but it will accept a BeanShell argument–I just tested this in 3.5.8, and creating a Rectangular Grid with the same numbering you are using (but with multiple columns and rows), using a destination grid location of (for example) {"G0"+"9"} worked just fine, sending the piece to G09.