[messages] [Developers] LOS and some help

relvar99 spencer.lee.olson at gmail.com
Fri Mar 20 14:15:28 CET 2015


Thanks for the reply.  You are correct, LOS_Thread does not store
anything, and hexes do not "exist" is VASSAL.  I guess what I was trying
to point out is this; in the LOS_Thread class, the mouse dragged event
handler gets a String for the localizedLocationName for the point on the
map (after determining SNAP or not) of the current coordinates of the
mouse event, then checks to see if that string value is currently in a
list of values and is not the "anchor" string.  If so, then add it to a
list.  Of course, as you drag the mouse all over the map, regardless of
whether or not the line drawn between the anchor and the arrow (the
start and end points of your LOS) actually crosses the list of strings
(whose values represent the localized location names on the map), the
report output of the LOS_Thread includes ALL of those localized names. 
This is easy to verify, drag your mouse around a map, and when you have
defined your anchor and arrow, the thread reports all of those "areas". 
I would not classify it as a bug per se, but the output is not
particularly helpful.   For instance; checking the LOS between two
locations on a map, that does have a hex grid defined (Last Chance for
Victory...) reports this 

spencer Checked LOS from __N27.36__ to __N27.37__

However, here is the report for the same LOS check between the same two
"locations", but when I checked the LOS I dragged my mouse "all over the
map" so to speak ...

spencer Checked LOS from __N27.36__ to N28.35, N28.34, N28.33, N28.32,
N27.32, N27.31, N26.30, N26.29, N26.28, N25.29, N25.28, offboard,
N25.27, N26.27, N27.27, N28.27, N28.26, N28.25, N27.26, N27.25, N26.25,
N26.26, N27.28, N28.28, N28.29, N29.30, N29.31, N29.32, N30.32, N30.33,
N30.34, N30.35, N30.36, N30.37, N30.38, N30.39, N30.40, N30.41, N30.42,
N29.43, N29.44, N28.43, N28.44, N27.44, N26.43, N26.42, N25.42, N25.41,
N25.40, N26.40, N26.39, N27.39, N26.38, N26.37, N25.37, N25.36, N26.36,
N26.35, N26.34, N26.33, N26.32, N26.31, N26.41, N27.41, N27.42, N28.41,
N28.40, N27.40, N27.38, N27.33, N28.36, N28.37, N28.38, N29.39, N29.40,
N29.41, N29.42, N27.43, N29.37, N29.36, N29.35, N29.34, N27.30, N25.31,
N27.34, __N27.37__

You see the final anchor and arrow (the bolded above) are the same, but
there is considerably more "work" involved in the later.  This is really
kind of a red herring however I think.  What I am hoping to accomplish
is given a line drawn between the anchor and the arrow, what are all of
the locations on the map that such a line crosses.  In my case, all of
the locations crossed by the line from the center point of one location
(the anchor) to the center point of another location (the arrow). I have
been using The Devil's Cauldron as a reference for trying to accomplish
this, but the LOS check in that game does not care about the intervening
areas on the map between anchor and arrow, just the overall range (the
distance between the two). 

As I work through this I am amazed at how much effort went into VASSAL,
and I am truly humbled by the contributors to this effort, both past and
present.  I had NO idea just how much went into this engine.  So kudos !
And to all those helpful on these forums as well!

Regards,
Spencer

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=48311#p48311


More information about the messages mailing list