Teleporter

The Teleporter is a travel mechanism from the Mechanic / the Steampunker for . When two Teleporters are wired together with a triggering mechanism, they can exchange players, NPCs, and most enemies between them. Teleporting is always instantaneous, has no load time or cooldown, no Mana or coin cost, and no limit on distance.
Unlike most furniture, Teleporters are foreground objects. They consist of three inseparable blocks which, like all block types, can individually be shaped with a hammer or actuated.
== Usage ==
The two Teleporters to be transported between must be placed on a surface of solid blocks or platforms and connected by Wire, along with a trigger mechanism, such as a Switch or Pressure Plate. When the trigger is activated, all players, all NPCs, and most enemies touching the 3×3-tile area above it are instantly transported to the other Teleporter. A character standing a maximum of three tile heights above the Teleporter can still be transported, and burying a Teleporter two tiles deep can still transport players walking on the surface. Similarly, placing an actuated, flattened (hammered to half-height) Teleporter on platforms and standing one tile below the platforms will also transport the player. Entities retain their location relative to the Teleporter within the 3×3 area when teleporting. For instance, players using a Teleporter two tiles above its surface will arrive two tiles above the surface of the destination Teleporter. See the gallery below for example images.
Teleporting is always two-way: when a connection is activated, both ends will exchange all players, NPCs, and enemies that are at least partially occupying any square of the 3×3-tile rectangle. Players should keep this in mind when constructing Teleporter paths, as enemies could unintentionally be brought into a base, for example.
=== Limitations ===
* On the , the distance that entities can be teleported is limited. Similarly, wires connecting two Teleporters can only transmit a signal up to 2,000 tiles away.
** On all other versions (), there is no limit on wire lengths or distance between Teleporters. 
* Teleporters will not transport worms, bosses, other enemies that travel through blocks, critters, liquids, dropped items, projectiles (which includes pets and light pets as well as Boulders and ), any enemy from the event, or placed furniture.
* A Teleporter will not work if it is placed in front of natural Lihzahrd Brick Walls and Plantera has not yet been defeated.
== Notes ==
* A single Teleporter can be wired to multiple destinations. With access to only a single wire color, each end of a Teleporter pad can be wired to one destination each, for a total of two possible destinations (each must have its own triggering mechanism). Using all four wire colors, each end of the Teleporter can be wired to four destinations each, for a total of eight possible destinations (two red, two blue, two green, and two yellow).
** On the , which only have three wire colors, each end of the Teleporter can be wired to three destinations each, for a total of six possible destinations (two red, two blue, and two green).
** With more than one Teleporter, the number of possible destinations from one spot becomes even larger. Seven Teleporters, for example, can facilitate a total of 36 different destinations. See the gallery below for example setups.
* The three blocks composing the Teleporter can be shaped using a hammer. This does not affect the Teleporter's function, except that the 3×3 area to be teleported and the position of the teleported entity are both relative to the Teleporter's surface, i.e. if the Teleporter is flattened to half blocks, they will both move down half a block (if the three blocks are different shapes, the height is determined by the first block encountered in the algorithm described below). Note that pressure plates can only be placed on full blocks.
* Other blocks or furniture can be placed on Teleporters. These will not be teleported, nor will they "block" teleportation of entities above them, as long as the entities are still within the 3×3 area of effect.
* If three or more Teleporters are connected with the same colored wire, a player (or NPC or enemy) will be teleported to whichever is farthest. This distance is measured in the most direct wire distance, not physical distance (a wire looping around takes more space than a direct straight connection). This distance is also measured from the triggering mechanism (Switch, Pressure Plate, etc.), not the entity being teleported. With multiple triggers, certain Teleporter combinations may thus result in failure to teleport.
* Teleporting releases all hooks.
* Unlike most forms of player movement, Teleporters are server-sided. This means that they are not instantaneous in Multiplayer worlds.
== Algorithms determining destination Teleporter ==
When a wire network (single color) with more than two Teleporters is activated, an algorithm determines which pair will activate. This algorithm was rather naive prior to the 1.2.3 update and was improved afterward. Both versions are described below.
Both algorithms are (i.e., their result can be predicted ahead of time), so a fixed wiring layout will always activate the same Teleporters. Therefore, the wiring layout can be designed to target the desired Teleporter.
=== Present ===
* Starting from the tile of the trigger mechanism (e.g. Switch or Pressure Plate), the length of the wire to each Teleporter is measured (using a variant of ).
* The Teleporter closest to the source (in terms of total wiring route length) and the Teleporter farthest away are each activated. All other Teleporters remain inactive, even if a player is standing there.
* When the wiring lengths are exactly the same, the direction of the wiring connection is considered (closest to furthest; first to last): down, up, right, left.
* This allows selection of different destination pads on the same wire, by using different activations sources that each have different furthest pads. (Requires careful attention to wire lengths.)
=== Prior to 1.2.3 ===
* Starting from the tile of the trigger mechanism, the network is explored one tile at a time; moving to an adjacent unexplored wire if one is available, otherwise (in other words, performing a ).
* When there is a choice of adjacent wires to explore, the first one to explore is the tile to the left, then right, then up, then down.
* The order in which the Teleporters on the network are first encountered is kept track of (in other words, they are ordered by preorder).
* The first and last Teleporter in this order are activated. All other Teleporters remain inactive.
== Tips ==
* A Pressure Plate can be placed directly on top of a Teleporter as the triggering mechanism, along with a short Wire connection, to allow activation by simply walking onto it.
* If a Pressure Plate is placed to the left or right of the center and then alternated on the connecting Teleporter, the player can walk back and forth between locations without instantly triggering the destination plate.
*Teleporters will not work if you link them to another teleporter using a wire consisting of multiple wire colors
* Teleporters will work if the player is riding a Minecart, allowing discontinuous track systems to be connected easily (e.g. to bypass an obstacle). The above two points still apply, though with Pressure Plate Tracks.
* Teleporters can be used to create entrances into sealed bases. If Pressure Plates are used, those that can only be activated by players (gray, brown, blue) should be used, to ensure that enemies cannot inadvertently activate them and teleport inside.
* Teleporters with Pressure Plate triggers can be useful in boss arenas, as they enable instantaneous dodging by moving to a remote location. A player can jump between them continuously while firing ranged or magic weapons.
* Teleporting at night to a destination at least one screen away will cause NPCs that have not moved into their assigned housing to instantly do so.
* Teleporters can be used to place furniture mid-air that usually require a surface under them. Stack two Teleporters, place the furniture on the upper Teleporter, and then break the lower Teleporter. The lower Teleporter breaking will deconstruct the upper Teleporter, but the furniture on top will not deconstruct. This can be handy for creative aesthetic building, such as placing things atop the column statue. Note that placing any block next to the "floating" furniture will break it.
** The same "floating" effect can be achieved legitimately by using Echo Blocks, which are bought from the Cyborg when he is in a Graveyard.
== Trivia ==
* The when activating a Teleporter is shared with the Magic/Ice Mirror's.
== Gallery ==
File:Teleporter-Multi-Choice-Basics.mp4|Two-minute video guide to creating a basic four-destination Teleporter system using .
File:Teleporter-Multi-Choice-Overview.png|Basic four-destination Teleporter system from the video.
File:28 different Teleporter destinations setup.png|Transfer to 28 different locations via 6 Teleporters.
File:28 different Teleporter destinations setup (detailed).png|Transfer to 28 different locations via 5 Teleporters. One is unused.
File:36 different Teleporter destinations setup.png|Transfer to 36 different locations via 7 Teleporters. Three are unused. The two Teleporters at the top are hammered to half-height.
=== Relative location ===
The following images demonstrate the "relative-location-retaining" property of Teleporters described above.
File:Teleporter relative location (normal).png
File:Teleporter relative location (left).png
File:Teleporter relative locations (right).gif
File:Teleporter relative location (above).png
File:Teleporter relative location (below).png
== See also ==
* Guide:Teleporter network
== History ==