Prototype/Tile: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Changed links going to the redirect Prototype to go to PrototypeBase.)
(Removed old prototype docs)
Tag: Replaced
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Basics ==
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/prototypes/TilePrototype.html https://lua-api.factorio.com/latest/prototypes/TilePrototype.html]
Prototype type: '''tile'''


Extends [[PrototypeBase]]. A [[tile]]. Only 255 instances of this prototype may be defined.
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
== Mandatory properties ==
Inherits all properties from [[PrototypeBase]].
 
=== collision_mask ===
'''Type''': [[Types/CollisionMask]]
 
=== layer ===
'''Type''': [[Types/uint8]]
 
Specifies transition drawing priority.
 
=== variants ===
'''Type''': [[Types/Transitions]]
 
Graphics for this tile. This has extra properties besides the properties from [[Types/Transitions]]:
 
==== main ====
'''Type''': [[Types/table]] of [[Types/Animation]]
 
Mandatory. Array of [[Types/Animation]]s with the following extra properties:
 
* size - [[Types/uint32]] - Mandatory. - Only powers of 2 from 1 to 128 can be used. Square size of the tile arrangement this animation is used for. Used to calculate the <code>width</code> and <code>height</code> of the animation which cannot be set directly. (width or height) = size * 32 / scale.
* probability - [[Types/double]] - Optional. - Default: 1.0 - Probability of 1x1 (size = 1) version of tile must be 1.
* weights - [[Types/table]] of [[Types/double]] - Optional. - Array of [[Types/double]].
 
==== material_background ====
'''Type''': [[Types/Animation]]
 
Optional. Width and height are given by the game, setting them will not have an effect. Width and height are calculated from the expected size (32) and the scale. So, for HR tiles at a size of 64x64, the scale needs to be 0.5.
 
=== map_color ===
'''Type''': [[Types/Color]]
 
== Optional properties ==
 
=== transition_overlay_layer_offset ===
'''Type''': [[Types/uint8]]
 
'''Default''': 0
 
=== layer_group ===
'''Type''': [[Types/string]]
 
'''Default''': "water" if <code>draw_in_water_layer</code> is true, else "ground"
 
One of "zero", "water", "water-overlay", "ground" and "top".
 
=== draw_in_water_layer ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
=== transition_merges_with_tile ===
'''Type''': [[Types/string]]
 
Name of a tile.
 
=== tint ===
'''Type''': [[Types/Color]]
 
'''Default''': White ({1,1,1,1})
 
=== walking_sound ===
'''Type''': [[Types/Sound]]
 
=== build_sound ===
'''Type''': [[Types/Sound]]
 
=== mined_sound ===
'''Type''': [[Types/Sound]]
 
=== walking_speed_modifier ===
'''Type''': [[Types/double]]
 
'''Default''': 1
 
=== vehicle_friction_modifier ===
'''Type''': [[Types/double]]
 
'''Default''': 1
 
=== decorative_removal_probability ===
'''Type''': [[Types/float]]
 
'''Default''': 1.0
 
=== allowed_neighbors ===
'''Type''': [[Types/table]] of [[Types/string]]
 
'''Default''': All tiles
 
Array of tile names that are allowed next to this one.
 
=== needs_correction ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
=== minable ===
'''Type''': [[Types/MinableProperties]]
 
If you want the tile to not be minable, don't specify the minable property.
 
=== next_direction ===
'''Type''': [[Types/string]]
 
Name of a tile.
 
=== can_be_part_of_blueprint ===
'''Type''': [[Types/bool]]
 
'''Default''': true
 
=== pollution_absorption_per_second ===
'''Type''': [[Types/double]]
 
Emissions per second. Use negative value if pollution is consumed/removed instead of produced. Preferred over using <code>ageing</code>.
 
Mandatory if <code>ageing</code> does not exist.
 
=== ageing ===
'''Type''': [[Types/double]]
 
Emissions per tick. Does the same thing as <code>pollution_absorption_per_second </code> but will be removed at some point.
 
=== transitions ===
'''Type''': [[Types/table]] of [[Types/Transitions]]
 
Extra transitions. Array of [[Types/Transitions]]. Each [[Types/Transitions]] needs the extra mandatory property <code>to_tiles</code>, which is a [[Types/string]] which is the name of a tile.
 
=== transitions_between_transitions ===
'''Type''': [[Types/table]] of [[Types/Transitions]]
 
Array of [[Types/Transitions]]. Each [[Types/Transitions]] needs the extra mandatory properties <code>transition_group1</code> and<code>transition_group2</code> , which are of  [[Types/uint8]].
 
=== autoplace ===
'''Type''': [[Types/AutoplaceSpecification]]

Latest revision as of 14:33, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/prototypes/TilePrototype.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.