Skip to content

Entities

Touched edited this page Dec 10, 2017 · 2 revisions

Entities

Entities are objects that appear at a specific position on a map. There are a few different types of entities, but there are a few properties that are common to all of them.

Identifiers

All entities have unique identifiers. entity identifiers share the same format as resource identifiers, but they only need to be unique within the context of the map they are on.

You can use entity identifiers to refer to an entity on a map, which is useful for moving an NPC in a script or specifying the target of a warp.

Coordinates

All entities have a set of coordinates which describe the position of the entity. The x coordinate specifies the horizontal position of the entity, while the y coordinate specifies its vertical position. The z coordinate specifies the height of the entity, with the values corresponding to the values in a height map.

Warps

When the player steps on a block that has a warp entity on it, they will be transported to a different map using the warping behaviour of that block. There are two types of warp entities: normal and dynamic.

Normal

A normal warp links to a specific warp on a map. When warping, the player will be transported to the target warp on the target map.

Dynamic

A dynamic warp links to a specific warp. The exact target of this warp must be set in a script using the setdynamicwarp command. This can be useful for building elevators or ferries.

Interactables

An interactable entity is a script that runs a script when the player interacts with it by pressing A. Interactables are usually used for signposts, but can be for anything that the player can examine.

Triggers

A trigger entity runs a script when player steps on it. The script is conditional - it is only run when the condition variable matches the value specified in the condition. The script will usually change the value of this variable after the event is complete so that the trigger does not run repeatedly.

Objects

An object entity is the only entity type that is visible in game (i.e. they have a sprite). They are usually used for NPCs such as people and Pokémon, but can also be used for inanimate objects such as berry trees and vehicles.

Behavior

Objects can be set to have an idle behavior. When the object is not locked, it will run its behavior.

Boundary Box

Objects have a rectangular bounding box. If the object is set to wander around with a behavior, then the object will not leave the region specified by the bounding box.

Clone this wiki locally