LuaTile

A single "square" on the map.

class LuaTile - sort
collides_with(layer) → boolean What type of things can collide with this tile?
to_be_deconstructed() → 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.
name :: string [R] Prototype name of this tile.
prototype :: LuaTilePrototype [R]
position :: Position [R] The position this tile references.
hidden_tile :: string [R] The name of the LuaTilePrototype hidden under this tile or nil if there is no hidden tile.
surface :: LuaSurface [R] The surface this tile is on.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
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() → boolean

Is this tile marked for deconstruction?

order_deconstruction(force, player) → LuaEntity

Orders deconstruction of this tile by the given force.

Parameters
force :: ForceIdentification: The force whose robots are supposed to do the deconstruction.
player :: PlayerIdentification (optional): The player to set the last_user to if any.
Return value
The deconstructible tile proxy created if any or nil.
cancel_deconstruction(force, player)

Cancels deconstruction if it is scheduled, does nothing otherwise.

Parameters
force :: ForceIdentification: The force who did the deconstruction order.
player :: PlayerIdentification (optional): The player to set the last_user to if any.
name :: string [Read-only]

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

prototype :: LuaTilePrototype [Read-only]

position :: Position [Read-only]

The position this tile references.

hidden_tile :: string [Read-only]

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

surface :: LuaSurface [Read-only]

The surface this tile is on.