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:Auto Teleporting and Chat Based Teleporting"

From Roll20 Wiki

Jump to: navigation, search
(Created page with "Author: Josh <br> The intention of this script is to allow the DM to teleport one or all characters to a location based on a token placed on the DM layer of the map. To activa...")
 
 
(10 intermediate revisions by one user not shown)
Line 1: Line 1:
Author: Josh <br>
+
{{script overview
The intention of this script is to allow the DM to teleport one or all characters to a location based on a token placed on the DM layer of the map. To activate the script, type "!Teleport " and add the name of the teleport location (must not contrain spaces) and then the name of the party member to teleport there. They must be seperated by commas.
+
|name=Auto Teleporting and Chat Based Teleporting
If you want all to teleport, type all. ie. !Teleport teleport01, all - teleports all players to teleport01
+
|author={{user profile|84478|Josh}}
 +
|version=1.3
 +
|lastmodified=2013-06-10}}
  
AUTOTELEPORTING: This feature allows you to place a token on One square (for example stairs) and it will auto move a token to the linked location and back again should you choose. Linked locations need to be tokens placed on the GMLayer.
+
'''Auto Teleporting and Chat Based Teleporting''' allows the GM to teleport one or more characters to a location based on a token placed on the GM layer of the map. Manual teleportation is achieved with the API command <code>!Teleport</code>. Automatic teleportation is toggled with <code>!AUTOTELEPORTER</code>. Both commands are GM-only.
Naming conventions:
+
* Two way doors: XXXXXXXX2A, XXXXXXXXX2B
+
* Three way dooes: XXXXXXXX3A, XXXXXXXXX3B, XXXXXXXXX3C
+
* (in the case of one way doors, dont create a 3C)
+
* This system can handle up to 9 way doors (9I max).  
+
  
===Code===
+
=== Syntax ===
https://gist.github.com/DarokinB/5750390
+
{{syntaxbox top|formal=true|Auto Teleporting and Chat Based Teleporting}}
 +
{{API command|Teleport}} {{API parameter|name=target}}, {{API parameter|name=characters}}<br>
 +
{{API command|AUTOTELEPORTER}}
 +
{{Formal API command|
 +
{{token|S}} {{rarr}} {{API command|Teleport}} {{token|target}}, {{token|characterList|-}}
 +
{{token|target}} {{rarr}} {{string|-}}
 +
{{token|characterList}} {{rarr}} {{token|character}}{{token|characters|-}}
 +
{{token|character}} {{rarr}} {{string|-}}
 +
{{token|characters}} {{rarr}} {{epsilon}}
 +
{{token|characters}} {{rarr}} , {{token|characterList|-}}
 +
}}
 +
{{syntaxbox end}}
 +
 
 +
{{param description top}}
 +
{{param description|name=target|value=The name of an object on the GM layer used as the teleport target location. }}
 +
{{param description|name=characters|value=A comma-separated list of character names to teleport.}}
 +
{{param description bottom}}
 +
 
 +
=== Installation ===
 +
There are two configuration variables near the top of the script. You may alter them to customize the script functionality:
 +
 
 +
* '''Teleporter.AUTOTELEPORTER''' &ndash; The default state of the auto teleportation behavior. Use <code>true</code> or <code>false</code>. The autoteleporter state will not persist between sessions, so you should set this value to the state you intend to use most often.
 +
* '''Teleporter.GMName''' &ndash; Set to the display name of the user with permission to use the teleportation commands.
 +
 
 +
==== Manual Teleport Setup ====
 +
In order to teleport a token somewhere, you must have a named object on the GM layer. The object's name will be used as the first parameter to the <code>!Teleport</code> API command.
 +
 
 +
==== Automatic Teleport Setup ====
 +
In order to automatically teleport tokens, you must have objects on the GM layer with a specific naming scheme. Each object's name should end with a number in the range <nowiki>[2, 9]</nowiki> followed by a capital letter in the range <nowiki>[A, I]</nowiki>. Linked teleporters need to have identical names, with the exception of the capital letter at the end, which should be unique among the set of otherwise-identical objects.
 +
 
 +
The number in the object's name indicates how many teleporters exist in the sequence. The letter in the object's name indicates what position in the sequence the object is located at. For example, a three-teleporter sequence might be named "stair3A", "stair3B", and "stair3C". Automatically teleporting tokens will loops through the sequence as they step on the squares that the objects are located on.
 +
 
 +
You can also create one-directional teleporters by having an incomplete sequence. If you have "stair3A" and "stair3B" but there is no object on the GM layer named "stair3C", tokens will teleport from A to B, but will not teleport from B to anywhere else.
 +
 
 +
=== Changelog ===
 +
{{changelog version|1.3|2013-06-10|* Release}}

Latest revision as of 17:29, 13 January 2015

API ScriptAuthor: Josh
Version: 1.3
Last Modified: 2013-06-10
Code: Auto Teleporting and Chat Based Teleporting
Dependencies: None
Conflicts: None

Auto Teleporting and Chat Based Teleporting allows the GM to teleport one or more characters to a location based on a token placed on the GM layer of the map. Manual teleportation is achieved with the API command !Teleport. Automatic teleportation is toggled with !AUTOTELEPORTER. Both commands are GM-only.

Contents

[edit] Syntax

!Teleport <target>, <characters>
!AUTOTELEPORTER
Formally:

S → !Teleport target, characterList
targetstring
characterListcharactercharacters
characterstring
characters → ε
characters → , characterList

Parameter Values
target The name of an object on the GM layer used as the teleport target location.
characters A comma-separated list of character names to teleport.

[edit] Installation

There are two configuration variables near the top of the script. You may alter them to customize the script functionality:

  • Teleporter.AUTOTELEPORTER – The default state of the auto teleportation behavior. Use true or false. The autoteleporter state will not persist between sessions, so you should set this value to the state you intend to use most often.
  • Teleporter.GMName – Set to the display name of the user with permission to use the teleportation commands.

[edit] Manual Teleport Setup

In order to teleport a token somewhere, you must have a named object on the GM layer. The object's name will be used as the first parameter to the !Teleport API command.

[edit] Automatic Teleport Setup

In order to automatically teleport tokens, you must have objects on the GM layer with a specific naming scheme. Each object's name should end with a number in the range [2, 9] followed by a capital letter in the range [A, I]. Linked teleporters need to have identical names, with the exception of the capital letter at the end, which should be unique among the set of otherwise-identical objects.

The number in the object's name indicates how many teleporters exist in the sequence. The letter in the object's name indicates what position in the sequence the object is located at. For example, a three-teleporter sequence might be named "stair3A", "stair3B", and "stair3C". Automatically teleporting tokens will loops through the sequence as they step on the squares that the objects are located on.

You can also create one-directional teleporters by having an incomplete sequence. If you have "stair3A" and "stair3B" but there is no object on the GM layer named "stair3C", tokens will teleport from A to B, but will not teleport from B to anywhere else.

[edit] Changelog

v1.3 (2013-06-10)

  • Release