RPTools

Personal tools
From MapToolDoc

movedOverPoints

movedOverPoints() Function

Introduced in version 1.3.b75

This function can be used to check if a token has moved through a shape that is defined by an array of cell coordinates (formatted like the one received from getLastPath() or the onTokenMove-events macro.args).


movedOverPoints returns a json array with coordinates of all cells that have been a) in the defined shape and b) traversed by the token.

Usage

  1. <!-- lets define a shape -->
  2.  
  3. [h: jsonArray = json.append("",
  4.     json.set("", "x",   0, "y",   0),
  5.     json.set("", "x",   0, "y", 100),
  6.     json.set("", "x", 100, "y", 100),
  7.     json.set("", "x",   0, "y", 100)
  8. )]
  9. <!-- check if token in context has moved through that shape -->
  10. [r: movedOverPoints(jsonArray)]


 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
 This article needs: lastPath-format specified, define/explain return value, examples