1.14.04 - Teletransporter

A teletransporter is a detector that sends the hero to another place when he walks on it.

This type of map entity can be declared in the map data file. It can also be created dynamically with map:create_teletransporter().

Overview

A teletransporter can send the hero to one of the following kind of places.

Teletransporters can have any size, but like all entities, their width and height must be multiples of 8 pixels. The minimum size if 16x16 pixels (the size of the hero).

Note
You can also teletransport the hero explicitly with hero:teleport().

Methods inherited from map entity

Teletransporters are particular map entities. Therefore, they inherit all methods from the type map entity.

See Methods of all entity types to know these methods.

Methods of the type teletransporter

The following methods are specific to teletransporters.

teletransporter:get_sound()

Returns the sound to be played when the hero uses this teletransporter.

teletransporter:set_sound(sound_id)

Sets the sound to be played when the hero uses this teletransporter.

teletransporter:get_transition()

Returns the style of transition to play when the hero uses this teletransporter.

teletransporter:set_transition(transition_style)

Sets the style of transition to play when the hero uses this teletransporter.

teletransporter:get_destination_map()

Returns the id of the destination map of this teletransporter.

teletransporter:set_destination_map(map_id)

Sets the destination map of this teletransporter.

teletransporter:get_destination_name()

Returns the name of the destination place on the destination map.

teletransporter:set_destination_name(destination_name)

Sets the destination place on the destination map.

Events inherited from map entity

Events are callback methods automatically called by the engine if you define them.

Teletransporters are particular map entities. Therefore, they inherit all events from the type map entity.

See Events of all entity types to know these events.

Events of the type teletransporter

The following events are specific to teletransporters.

teletransporter:on_activated()

Called when the user takes this teletransporter, just before the map closing transition starts.