Distance between units

Does anybody know if there is a way/trick to check distance between two counters in a given map/board in general or, specifically, in a hex grid?

This would be for in/out-of range determination purposes… like checking if a tank with range 3 is able to fire on a certain target.

Thanks.

There is a range/LOS thread tool.
There is also a zone highlighter.

On Thu, Jun 28, 2012 at 4:00 AM, barbanera barbanera@fantafoot.com wrote:

Does anybody know if there is a way/trick to check distance between two
counters in a given map/board in general or, specifically, in a hex
grid?

This would be for in/out-of range determination purposes… like checking
if a tank with range 3 is able to fire on a certain target.

Thanks.

_____________**
Read this topic online here:
vassalengine.org/**forum/vie … 3#**p34963<Distance between units
_____________**
messages mailing list
messages@vassalengine.org
vassalengine.org/**mailman/listinfo/messageshttp://www.vassalengine.org/mailman/listinfo/messages

Yes, I had tried the LOS tool. But I am really looking at some behind the scene calculation (not initiated by a user dragging a LOS). If that LOS tool could be invoked by some hotkey… passing on start X,Y (or hex name) and end X,Y (or hex name) or even better start piece name and end piece name… and if it would then publish in some global property the range result…

What about area of effect?
That could be used to highlight a radius.

On Thu, Jun 28, 2012 at 10:44 AM, barbanera barbanera@fantafoot.com wrote:

Yes, I had tried the LOS tool. But I am really looking at some behind
the scene calculation (not initiated by a user dragging a LOS). If that
LOS tool could be invoked by some hotkey… passing on start X,Y (or hex
name) and end X,Y (or hex name) or even better start piece name and end
piece name… and if it would then publish in some global property the
range result…

_____________**
Read this topic online here:
vassalengine.org/**forum/vie … 3#**p34973<Distance between units - #3 by barbanera

_____________**
messages mailing list
messages@vassalengine.org
vassalengine.org/**mailman/listinfo/messageshttp://www.vassalengine.org/mailman/listinfo/messages

Yes, I use area of effect. But still… just aesthetics (and I wish it would not extend beyond the actual hex grid when the piece is close to the borders) and not the behind the scenes calculation I was hoping for.

In practice I have an hex map with, say, 3 pieces on it: red, yellow (which are allies) and black. By pressing on some button I am rolling dice for all 3 units to determine result of the red vs black and yellow vs black battles. This is easy and works fine.

However, I wish the button could know about the actual distance of red and yellow from black, to avoid rolling the relative dice if out of range (e.g. rolling only for red if yellow is too far from black).

I guess I could try to store the positions of red, yellow and black every time they end their movement on the map and using Pythagoras with a Calculated Expression… But how to build one which will do it? I tried something like sqrt((yellowX-blackX)^2+(yellowY-blackY)^2) but getting errors. Hopefully, some documentation for Calculated Expressions will be available soon.

Ok, problem solved by using Pythagoras.

Power of Vassal 3.2.0 and its support of Beanshell stuff!