A single "square" on the map.
stringunknownfalsePrototype name of this tile. E.g. "sand-3" or "grass-2".
LuaTilePrototypeunknownfalseTilePositionunknownfalseThe position this tile references.
stringunknowntrueThe 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.
stringunknowntrueThe 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.
LuaSurfaceunknownfalseThe surface this tile is on.
booleanunknownfalseIs 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.
stringunknownfalseThe 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.
LuaTile.collides_with(layer: CollisionLayerID) -> boolean
tile.collides_with(layer)
takes_table: falsetable_optional: falseWhat type of things can collide with this tile?
layer: CollisionLayerIDbooleanLuaTile.to_be_deconstructed(force?: ForceID) -> boolean
tile.to_be_deconstructed()
takes_table: falsetable_optional: falseIs this tile marked for deconstruction?
force?: ForceID — The force whose robots are supposed to do the deconstruction. If not given, checks if to be deconstructed by any force.booleanLuaTile.order_deconstruction(force: ForceID, player?: PlayerIdentification) -> LuaEntity?
tile.order_deconstruction(force, player)
takes_table: falsetable_optional: falseOrders deconstruction of this tile by the given force.
force: ForceID — The force whose robots are supposed to do the deconstruction.player?: PlayerIdentification — The player to set the last_user to if any.LuaEntity? — The deconstructible tile proxy created, if any.LuaTile.cancel_deconstruction(force: ForceID, player?: PlayerIdentification)
tile.cancel_deconstruction(force, player)
takes_table: falsetable_optional: falseCancels deconstruction if it is scheduled, does nothing otherwise.
force: ForceID — The force who did the deconstruction order.player?: PlayerIdentification — The player to set the last_user to if any.LuaTile.has_tile_ghost(force?: ForceID) -> boolean
tile.has_tile_ghost()
takes_table: falsetable_optional: falseDoes this tile have any tile ghosts on it.
force?: ForceID — Check for tile ghosts of this force.booleanLuaTile.get_tile_ghosts(force?: ForceID) -> Array<LuaEntity>
tile.get_tile_ghosts()
takes_table: falsetable_optional: falseGets all tile ghosts on this tile.
force?: ForceID — Get tile ghosts of this force.Array<LuaEntity> — The tile ghosts.