
I'm wondering if anyone has set up a way to have an API calculate move costs as a token/character is moved, based on the terrain it traverses? The path of waypoints is saved in a token's lastmove property: Of course, through an API script, I can easily retrieve the start point and waypoints using , i.e. token.get("lastmove"): =================== Trace Move of Selected Units :
729.9856198446025,1059.3532451882934,714.3863388523724,981.3874173640249,751.9856198446025,914.4215895397566,789.5849008368327,847.4557617154883,827.1841818290628,780.48993389122,902.3827438135231,780.48993389122,939.9820248057533,847.4557617154883,1015.1805867902136,847.4557617154883,1090.379148774674,847.4557617154883 Units: 1 -------------------------- So I'd like to be able to evaluate each of these hexes (or squares) for move costs to make sure the 12 points available to the token above will allow the full move. I figure I have a number of options to determine the move cost for each hex/square: Evaluating the graphics in the Map & Background inside the grid hex/square; Referring to a table of some sort, somewhere, that details terrain move costs; Having some notes in the GM layer for each hex/square, though that might make it pretty cluttered from the GM's point of view; Instead of plotting waypoints, I could have the players move one or groups of tokens one hex at a time; or a combination of the above or possibly some other suggestion? Evaluation and calculation of move costs would be done in an on("change:graphic", function(obj, prev) event. I guess it would be complicated to define the area of the hex a unit finds itself in. I believe some have done some work in this area. I'd also need to take into account linear obstacles like rivers and hill contours being crossed, I guess. Wondering if anything like this has been done or if this is something I should just leave to the players? My original intent was to have my players plot out their move using the freehand or polygon/line tool to show where their tokens are going. Thanks in advance for any thoughts, -- Tim