Factorio API Docs

1.1.69 <>

Class LuaTile

A single "square" on the map.

collides_with(layer)
boolean

What type of things can collide with this tile?


boolean

Is this tile marked for deconstruction?


order_deconstruction(force, player?)
LuaEntity?

Orders deconstruction of this tile by the given force.


cancel_deconstruction(force, player?)

Cancels deconstruction if it is scheduled, does nothing otherwise.


has_tile_ghost(force?)
boolean

Does this tile have any tile ghosts on it.


get_tile_ghosts(force?)
→ array[LuaTile]

Gets all tile ghosts on this tile.


help()
string

All methods and properties that this object supports.


:: string
[R]

Prototype name of this tile.



[R]

The position this tile references.


:: string?
[R]

The name of the LuaTilePrototype hidden under this tile, if any.


[R]

The surface this tile is on.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Methods

collides_with(layer) → boolean

What type of things can collide with this tile?

Parameters

Example

Check if the character would collide with a tile

game.player.print(tostring(game.player.surface.get_tile(1, 1).collides_with("player-layer")))

to_be_deconstructed(force?) → boolean

Is this tile marked for deconstruction?

Parameters

force

The force who did the deconstruction order.


order_deconstruction(force, player?) → LuaEntity?

Orders deconstruction of this tile by the given force.

Parameters

force

The force whose robots are supposed to do the deconstruction.


player

The player to set the last_user to if any.

Return values

:: LuaEntity?

The deconstructible tile proxy created, if any.

Raised events

instantly

Raised if the tile was successfully marked for deconstruction.


cancel_deconstruction(force, player?)

Cancels deconstruction if it is scheduled, does nothing otherwise.

Parameters

force

The force who did the deconstruction order.


player

The player to set the last_user to if any.

Raised events

instantly

Raised if the tile's deconstruction was successfully cancelled.


has_tile_ghost(force?) → boolean

Does this tile have any tile ghosts on it.

Parameters

force

Check for tile ghosts of this force.


get_tile_ghosts(force?) → array[LuaTile]

Gets all tile ghosts on this tile.

Parameters

force

Get tile ghosts of this force.


help() → string

All methods and properties that this object supports.

Attributes

name :: string [Read]

Prototype name of this tile. E.g. "sand-3" or "grass-2".


prototype :: LuaTilePrototype [Read]


position :: TilePosition [Read]

The position this tile references.


hidden_tile :: string? [Read]

The name of the LuaTilePrototype hidden under this tile, if any. During normal gameplay, only non-mineable tiles can become hidden. This can however be circumvented with LuaSurface::set_hidden_tile.


surface :: LuaSurface [Read]

The surface this tile is on.


valid :: boolean [Read]

Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.


object_name :: string [Read]

The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.

|<

Classes

Events

Concepts

Defines

Builtin types

>|