Factorio API Docs

1.1.50 <>

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.


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 or nil if there is no hidden tile.


[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 () → boolean

Is this tile marked for deconstruction?


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
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

The force who did the deconstruction order.


player
Optional

The player to set the last_user to if any.


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 :: 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.

|<

Classes

Events

Concepts

Defines

Builtin types

>|