Home

LuaTile

A single "square" on the map.

Attributes

name

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

prototype

position

The position this tile references.

hidden_tile

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

During normal gameplay, only non-mineable or foundation tiles can become hidden. This can however be circumvented with LuaSurface::set_hidden_tile.

double_hidden_tile

The name of the LuaTilePrototype double hidden under this tile or nil if there is no double hidden tile.

During normal gameplay, only non-mineable tiles can become double hidden. This can however be circumvented with LuaSurface::set_double_hidden_tile.

surface

The surface this tile is on.

valid

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

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.

Methods

collides_with

LuaTile.collides_with(layer: CollisionLayerID) -> boolean

Call As

tile.collides_with(layer)

Call Convention

What type of things can collide with this tile?

Parameters

Returns

to_be_deconstructed

LuaTile.to_be_deconstructed(force?: ForceID) -> boolean

Call As

tile.to_be_deconstructed()

Call Convention

Is this tile marked for deconstruction?

Parameters

Returns

order_deconstruction

LuaTile.order_deconstruction(force: ForceID, player?: PlayerIdentification) -> LuaEntity?

Call As

tile.order_deconstruction(force, player)

Call Convention

Orders deconstruction of this tile by the given force.

Parameters

Returns

cancel_deconstruction

LuaTile.cancel_deconstruction(force: ForceID, player?: PlayerIdentification)

Call As

tile.cancel_deconstruction(force, player)

Call Convention

Cancels deconstruction if it is scheduled, does nothing otherwise.

Parameters

has_tile_ghost

LuaTile.has_tile_ghost(force?: ForceID) -> boolean

Call As

tile.has_tile_ghost()

Call Convention

Does this tile have any tile ghosts on it.

Parameters

Returns

get_tile_ghosts

LuaTile.get_tile_ghosts(force?: ForceID) -> Array<LuaEntity>

Call As

tile.get_tile_ghosts()

Call Convention

Gets all tile ghosts on this tile.

Parameters

Returns