LuaTile
A single "square" on the map.
What type of things can collide with this tile?
Is this tile marked for deconstruction?
Orders deconstruction of this tile by the given force.
Cancels deconstruction if it is scheduled, does nothing otherwise.
The name of the LuaTilePrototype hidden under this tile or nil
if there is no hidden tile.
The surface this tile is on.
The class name of this object.
Cancels deconstruction if it is scheduled, does nothing otherwise.
What type of things can collide with this tile?
The name of the LuaTilePrototype hidden under this tile or nil
if there is no hidden tile.
The class name of this object.
Orders deconstruction of this tile by the given force.
The surface this tile is on.
Is this tile marked for deconstruction?
collides_with
(layer)
→ boolean
What type of things can collide with this tile?
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.
The force whose robots are supposed to do the deconstruction.
The player to set the last_user to if any.
The deconstructible tile proxy created if any or nil
.
cancel_deconstruction
(force,
player)
Cancels deconstruction if it is scheduled, does nothing otherwise.
The force who did the deconstruction order.
The player to set the last_user to if any.
help
()
→ string
All methods and properties that this object supports.
name
:: string
[Read]
Prototype name of this tile. E.g. "sand-3"
or "grass-2"
.
prototype
:: LuaTilePrototype
[Read]
position
:: Position
[Read]
The position this tile references.
hidden_tile
:: string
[Read]
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]
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.