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

Difference between revisions of "Script:Slide Tokens"

From Roll20 Wiki

Jump to: navigation, search
m
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
{{script overview
+
#Redirect[[Script:Token_Mod]]
|name=Slide Tokens
+
<!-- Don't delete redirect, help center links to this page even though API have been removed, redirect to closest equivalent -->
|author={{user profile|235259|Brian}}
+
|version=1.2
+
|lastmodified=2016-04-09
+
|dependencies={{api repository link|IsGM}}, {{api repository link|splitArgs}}}}
+
 
+
'''Slide Tokens''' allows for moving tokens around the map with an API command, hitting waypoints as though the token had been dragged and the Q had been hit during the movement.
+
<div style="clear:both"></div>
+
 
+
=== Syntax ===
+
{{syntaxbox top|formal=true|Slide Tokens}}
+
{{API command|movetok}} {{API parameter|name=args}}<br>
+
{{API command|mode}} {{API parameter|name=mode|optional=true}}
+
{{Formal API command|
+
{{token|S}} {{rarr}} {{API command|movetok}} {{token|movelistargs|-}}
+
{{token|S}} {{rarr}} {{API command|mode}} {{token|mode|-}}
+
{{token|mode}} {{rarr}} {{epsilon}}
+
{{token|mode}} {{rarr}} {{string|-}}
+
{{token|movelistargs}} {{rarr}} {{token|move}} {{token|movelist|-}}
+
{{token|move}} {{rarr}} {{token|direction}}{{token|coordinates|-}}
+
{{token|movelist}} {{rarr}} {{epsilon}}
+
{{token|movelist}} {{rarr}} {{token|move}} {{token|movelist|-}}
+
{{token|direction}} {{rarr}} {{epsilon}}
+
{{token|direction}} {{rarr}} {{string}}:<br>
+
{{token|coordinates}} {{rarr}} {{float|-}}
+
{{token|coordinates}} {{rarr}} {{float}},{{float}}
+
}}
+
{{syntaxbox end}}
+
 
+
{{param description top}}
+
{{param description|name=mode|value=Optional. Set the coordinate mode for the <code>!movetok</code> command. If this parameter is an invalid value or omitted, the current mode will be whispered back. There are three valid values, each of which has several aliases (all case insensitive):
+
* SQUARES (s, sq, square): coordinates will be in terms of grid squares
+
* UNITS (u, un, unit): coordinates will be in terms of the distance measurement units (if the page scale is 5 and the grid is 1 unit, a coordinate value of 2.5 will be half a grid square)
+
* ABSOLUTE (a, abs): coordinates will be in terms of pixels (70 pixels is 1 unit, so if the grid size is 1 unit, 70px will be 1 square)}}
+
{{param description|name=args|value=A space-separated list of position arguments. Each argument is in the form <code>[''direction'':]''coordinate''[,''coordinate'']</code>.
+
 
+
 
+
Each ''coordinate'' is a number (which may be fractional or negative), and the second one is optional. ''direction'' is optional (default: "top-left"), and may be one of nine values (with aliases):
+
* absolute (a)
+
* left (l, x)
+
* top (t, y)
+
* right (r)
+
* bottom (b)
+
* top-left (tl, xy)
+
* top-right (tr)
+
* bottom-left (bl)
+
* bottom-right (br)
+
 
+
 
+
If ''direction'' is "absolute", the coordinates will be treated as absolute coordinates on the map, with <code>(0,0)</code> being the top-left corner and all points on the map being positive values. All other directions are relative to the token.
+
 
+
The directions "top", "right", "bottom", and "left" will all ignore the second ''coordinate'' if it is supplied. All of the other directions will treat the second ''coordinate'' as 0 if it is not supplied.
+
 
+
A positive ''coordinate'' given for left directions will move the token to the right, and a positive ''coordinate'' given for top directions will move the token down; this may be unintuitive, and so using the "x" and "y" aliases is recommended. The right and bottom directions will move the token in the opposite direction to left and top if given the same ''coordinate'' values.}}
+
{{param description bottom}}
+
 
+
The <code>!mode</code> command may only be executed by a GM, but <code>!movetok</code> may be used by anyone. However, <code>!movetok</code> will only work with tokens you can select, meaning you must have control over it or be a GM.
+
 
+
=== Notes ===
+
As of version 1.0, the path displayed to everyone showing the waypoints the token moves is shrunk to the size of one unit (70x70 px, or one grid square with default settings) and move to the top-left corner of the GM layer for manual cleanup. A future version will remove these leftover paths automatically, as that ability is currently in testing on the development server.
+
 
+
=== Changelog ===
+
{{changelog version|1.2|2016-04-09|* Fix crash when invalid direction/no arguments supplied to !movetok
+
* Update globalconfig support}}
+
{{changelog version|1.1|2016-03-09|* Update for one-click install}}
+
{{changelog version|1.0|2015-01-08|* Release}}
+

Latest revision as of 20:39, 20 September 2021

  1. RedirectScript:Token_Mod