1.14.05 - Destination

A destination is a possible arrival place for teletransporters.

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

Overview

Destinations may either have a sprite or be invisible. They may also have a direction: in this case, the hero takes that direction when arriving on the destination. Otherwise, the hero keeps his current direction.

The size of a destination is the one of the hero (16x16 pixels).

Methods inherited from map entity

Destinations 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 destination

destination:get_starting_location_mode()

Returns whether this destination updates the starting location of the player when arriving on it. If yes, when the player restarts his game, he will restart at this destination. The default value is "when_world_changes".

destination:set_starting_location_mode(mode)

Sets whether this destination updates the starting location of the player when arriving on it. If yes, when the player restarts his game, he will restart at this destination. The default value is "when world changes".

Events inherited from map entity

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

Destinations 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 destination

The following events are specific to destinations.

destination:on_activated()

Called when the hero arrives on this destination.

The map opening transition is about to start at this point.

He may come from a teletransporter, from hero:teleport() or from the saved starting location.