Object Functions

If you are unsure how to use these object functions, check out the objects tutorial.

Any object function ending with [&triggers] may have an optional string of game triggers appended to them to execute alongside the function. See Triggers for more information.

xy
xy(x,y)

Offsets the display position of the object.

x (number)

Horizontal offset in pixels.

y (number)

Vertical offset in pixels.

solid
solid([type])

Makes the tile solid. Give a specific direction to customize which edge of the tile is solid.

type (direction)

Options: up, down, left, right, all, race, 0

Default: all

msg
[name.]msg([text])[&triggers]

Displays a textbox message after interacting with the tile.

name (string)

If a name is given with a dot separator, this object function operates like a property attached to an entity.

text (string)

Default: Empty textbox

answer
Answer=answer([text])[&triggers]

Defines the response to specified answers. Use this code after specifying answer options with the &answers trigger.

Answer (string)

Answer given by the player, such as “Yes” or “No.” If multiple answers have the same name, you may differentiate them using #n, where n is a number.

text (string)

Textbox response to the player’s answer.

Default: No textbox

Examples
msg(Take the fruit?)&answers=Yes,No
Yes=answer(You took the fruit.)
No=answer(You left the fruit.)

msg(Do you love me?)&answers=Yes,Yes
Yes#1=answer(Good.)
Yes#2=answer(Great.)
prints
prints(sprite[,frames[,speed[,fade[,directional]]]])

Draws footprints when the player walks offtile.

sprite (sprite sheet)

Footprint sprite sheet.

frames (number)

Number of frames in the sprite sheet.

speed (number)

Speed of the animation.

fade (number)

Time to fade in milliseconds.

directional (0/1)

Based on direction?

ledge
ledge(direction[,jump_height[,distance]])

Creates a ledge that can be hopped over in one direction.

direction (direction)

Direction to jump.

jump_height (number)

Height to jump in pixels.

distance (number)

Distance to jump in pixels. Should be in increments of 16.

spawn
spawn(id,direction[,move])

Creates a spawn point. Use on entrances, exits, or other spawn points.

id (number | string)

A spawn ID number that is unique to the map. This ID can be used to warp players to this spawn point. Alternatively, one of the following strings can be given to indicate a special type of spawn point.

Options: heal, cave, safari, fly

direction (direction)

Direction the player faces when spawning here.

move (0/1)

Move one tile in the aforementioned direction?

warp
warp(map,spawn)[&triggers]

Warps the player to a spawn point.

map (number)

Map ID to warp to.

spawn (number)

Spawn point ID to warp to.

triggers

door
door(sprite,map,spawn)[&triggers]

Creates a door object that animates when the user walks through it.

sprite (sprite sheet)

Door sprite sheet.

map (number)

Map ID to warp to.

spawn (number)

Spawn point ID to warp to.

execute
execute(triggers)

Executes game triggers immediately when the map loads. To make the triggers tile specific, use if ontile before this code. See ontile.

See the Triggers reference list for a list of triggers to use.

triggers (string)

String of triggers to execute. The first trigger should not start with an ampersand, but all chained triggers should.

sprite
[name=]sprite(image[,depth[,x,y,width,height[,unsynced]]])

Draws a sprite on the tile. This function is able to “crop” a sprite out of the given sprite sheet or tileset by using the four positional parameters parameters. The coordinates of the top-left corner of the sprite you want to draw should be given to the x and y parameters, and the width and height of the sprite should be given to the width and height parameters.

name (string)

Name of the sprite to refer to it elsewhere.

image (sprite sheet | tileset)

Sprite source, which could be a large tileset or an uploaded sprite sheet.

depth (depth)

Depth of the sprite.

x (number)

The x-position of the sprite in the image source.

y (number)

The y-position of the sprite in the image source.

width (number)

Width of the sprite in the image source.

height (number)

Height of the sprite in the image source.

unsynced (0/1)

Meaningless.

animation
[name=]animation(image[,depth[,x,y,width,height[,frames[,speed[,loop[,unsynced]]]]]])

Draws an animated sprite on the tile. Very similar to sprite(), but multiple frames are ripped from the image source to create an animation. All animation frames should be the same size, and they should be stored sequentially and horizontally in their sprite sheet. Each frame has an area of width x height pixels, and the overall width of the image source should be at least width x frames.

name (string)

Name of the animation to refer to it elsewhere.

depth (depth)

Depth of the sprite.

x (number)

The x-position of the first frame’s top-left corner in the image source.

y (number)

The y-position of the first frame’s top-left corner in the image source.

width (number)

Width of a single frame.

height (number)

Height of a single frame.

frames (number)

Number of frames.

speed (number)

Speed of the animation in frames per second.

loop (number | loop)

Number of times to loop the animation. Use loop to loop indefinitely.

unsynced (0/1)

Should the animation be unsynced with other animations of the same type?

Default: 0

npc
[name=]npc(skin[,direction[,path]])

Spawns an NPC (non-playable character) on the tile.

name (string)

Name of the NPC to refer to it elsewhere. It is heavily recommended to use %random%, rather than your own name, as much as possible.

skin (skin)

Skin ID number, which is the NPC’s overworld sprite.

direction (direction)

The NPC’s starting direction.

path (area)

The NPC’s path boundary. The NPC will wander around this area randomly.

glow
[name=]glow(radius,color[,flicker])

Creates a circular glow effect around the tile.

name (string)

Name of the glow to refer to it elsewhere.

radius (number)

Radius of the glow in pixels.

color (rgba)

Color of the glow.

flicker (unit interval)

Strength of the flicker, where 1 is full flicker and 0 is no flicker.

slide
slide([direction])

Causes the player to slide in the direction indicated until they hit a solid wall or warp.

direction (direction | stop)

Direction to slide the player in. Use stop to use this tile to stop a player if they are sliding.

Default: Player will slide in the direction they were facing

spin
spin([direction])

Causes the player to spin in the direction indicated until they hit a solid wall or warp.

direction (direction | stop)

Direction to spin the player in. Use stop to use this tile to stop a player if they are sliding.

Default: Player will spin in the direction they were facing

item
item(id[,amount[,sprite]])

Spawns an overworld item or Pokémon. If a Pokémon is spawned, it will be given to the player, not battled.

id (number | string | pokémon)

ID of the object to spawn. This can be an item ID number, an item name, or a Pokémon Generation String.

amount (number)

Number of items to give.

sprite (sprite sheet | hidden)

Item sprite sheet. Use hidden to make this item invisible.

Default: Region sprite

encounter
encounter(type)

type (string)

Allows encounters of the given type to pop up on this tile. Encounters are created and named for each map.

surf
surf([direction])

Allows the player to begin surfing here with the move “Surf.”

direction (direction)

Direction to begin surfing in.

Default: Surf from any direction

cut
cut([encounter_list[,sprite]])[&triggers]

Creates a tree that can be cut down with the move “Cut.”

encounter_list (string)

Encounter list to use when player cuts down the object.

sprite (sprite sheet)

Sprite that displays as the object to be cut.

Default: Region sprite

strength
strength([sprite][,slide])[&triggers]

Creates a heavy object that can be pushed with the move “Strength.”

sprite (sprite sheet)

Sprite that displays as the object to be pushed.

Default: Region sprite

slide (0/1)

Slide in one direction on touch?

Default: 0

rocksmash
rocksmash([encounter_list[,sprite]])[&triggers]

Creates an object that may be destroyed with the move “Rock Smash.”

encounter_list (string)

Encounter list to use when player smashes the object.

sprite (sprite sheet)

Sprite that displays as the object to be smashed.

Default: Region sprite

heal
heal(sprite,ball_width,ball_height[,ball_offset_x,ball_offset_y[,ball_margin_x,ball_margin_y]])

Heals the player’s party and creates a healing animation like the one used in a Pokémon Center.

sprite (sprite sheet)

Healing sprite sheet. Poké Balls must be in the lower left-hand corner. Machine must be in the upper left-hand corner.

ball_width (number)

Width of the individual ball sprite in pixels.

ball_height (number)

Height of the individual ball sprite in pixels.

ball_offset_x (number)

Number of pixels to displace the drawing of the Poké Ball sprites in the x-direction.

Default: 0

ball_offset_y (number)

Number of pixels to displace the drawing of the Poké Ball sprites in the y-direction.

Default: 0

ball_margin_x (number)

The number of pixels to draw between the Poké Balls in the x-direction.

Default: 0 (touching)

ball_margin_y (number)

The number of pixels to draw between the Poké Balls in the y-direction.

Default: 0 (touching)

height
height(height)

Creates an invisible wall with the specified height. If short enough, the wall can be jumped over.

height (number)

Height in pixels the player must jump to cross the tile.

moveto
moveto(x,y[,direction])

Moves the player to the given coordinates by taking the straight-line path.

x (number)

X-coordinate of the tile to move to.

y (number)

Y-coordinate of the tile to move to.

direction (direction)

The direction the player should face while moving.

Default: The direction the player entered the tile facing

grass
grass(image,frames,speed[,overlay_sprite[,loop]])[&triggers]

Creates an animation and overlay over the player while they are on the tile.

image (sprite sheet)

Sprite sheet with overlay animation. Frames should be evenly spaced horizontally.

frames (number)

Number of frames in the animation sprite sheet.

speed (number)

Speed of the animation in frames per second.

overlay_sprite (sprite sheet)

Single static sprite to overlay over player.

loop (loop)

Use loop to loop the animation indefinitely.

ripple
ripple(animation,frames,speed[,loop])

Creates an animation over the player while they are on the tile.

image (sprite sheet)

Sprite sheet with overlay animation. Frames should be evenly spaced horizontally.

frames (number)

Number of frames in the animation sprite sheet.

speed (number)

Speed of the animation in frames per second.

loop (loop)

Use loop to loop the animation indefinitely.