Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Script:Token Path

From Roll20 Wiki

Revision as of 06:02, 31 May 2015 by manveti (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
API ScriptAuthor: manveti
Version: 0.1
Last Modified: 2015-05-30
Code: TokenPath
Dependencies: None
Conflicts: None

TokenPath continuously tracks the movement of the token at the top of the turn tracker, automatically computing the token's shortest path. Waypoints can be placed to tweak the generated path as the user desires.

Usage

No special user action is required. Whenever the token at the top of the turn tracker moves, its path is automatically updated. The path is automatically cleared when the turn changes. Tokens moving when it is not their turn do not generate paths.

The pips which display a token's path are controlled by the same user(s) as the token in question. When a pip is moved, it creates a waypoint, and the path is automatically updated to pass through that waypoint. Waypoints are ordered, so creating a new waypoint B by dragging a pip between existing waypoints A and C will create a path that passes through A, then B, then C. Deleting a waypoint will cause the path to be recomputed without that waypoint.

Pips display distance based on the page settings (although they are not updated retroactively if the page settings are changed while a path is visible). Note that each step of the path will be fully into a square, so all travel will be along the eight cardinal and ordinal directions. However, when a page is configured to use Euclidean distance, the ruler tool does not follow this restriction, and can draw a direct line between any two squares. As a result, the ruler tool may report a different distance from that reported on the pips when Euclidean distance is in use.

Changelog

v0.1 (2015-05-30)

  • Initial release