GKC range field

A GKC has a range field, and I don’t understand how it works. The documentation is a bit sparse. I saw another post where the poster had a hex grid, and the answer seemed to say it was in hexes. I just have plain pixels, so I guessed the range was a pixel radius from the center of the calling piece. I assumed other pieces intersecting the defined circle would get the message, For range=0, it worked if the receiver was exactly stacked. So is range measured from the caller’s center or what? And what are the units. If no grid is defined, is it pixels from somewhere?

In a Global Key Command, the range calculation depends on whether the board of the originating piece defines a grid or not. If the board defines a grid, then the range is specified in the grid units, otherwise, the range is given in pixels.

Note, it is only the boards grid that is taken into account - grids in zones on the board are not considered.

Thus, if the originating piece is in a zone with a defined grid, but there’s no grid defined on the mother board, then the range will be calculated in pixels - not in grid coordinates which would seem to be the intent.

The call-stack is - roughly -

  1. VASSAL.counters.GlobalCommand#passesPropertyFastMatch
  2. VASSAL.build.module.index.IndexManager#getPieces
  3. VASSAL.build.module.index.VassalMapPieceIndex#getPieces
  4. VASSAL.build.module.Map#getMaxPixelsPerRangeUnit
  5. VASSAL.build.module.map.boardPicker.Board#getGrid
  6. VASSAL.build.module.map.boardPicker.board.MapGrid#getMaxPixelsPerRangeUnit

In 4 above, the Map should probably first search for a Zone near point and grab any grid defined in that zone, and only of no zone is found, look for a board. @Cattlesquat & @Brent_Easton can you check to see if the code works as intended?

Yours,
Christian

Thank you for responding.

All I am really interested in is pixels, and I’d rather not have zones or grids get in my way. For sake of this conversation, I’m going to consider no zones, no grids, so I think my units are pixels.

I have a card laying on my Main Map, not in a zone or a grid. If it issues a GKC, from where is the range measured? Center of card? Edge? Then who is affected? Every other piece within range of the caller’s center? Does the target have to be within this range? My tests suggest some or all of this is not true.