Prototype/Tile: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎variants: add note that tint has no effect)
(to_tiles is an array, formatting)
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Basics ==
{{Prototype parent|PrototypeBase}}
Extends [[Prototype]].
A [[tile]]. Only 255 instances of this prototype may be defined.
 
{{Prototype TOC|tile}}
 
== Mandatory properties ==
== Mandatory properties ==
Inherits all properties from [[Prototype]].
Inherits all properties from [[PrototypeBase]].
 
=== collision_mask ===
'''Type''': [[Types/CollisionMask]]


=== layer ===
{{Prototype property|collision_mask|[[Types/CollisionMask|CollisionMask]]}}
'''Type''': [[Types/uint8]]


{{Prototype property|layer|[[Types/uint8|uint8]]}}
Specifies transition drawing priority.
Specifies transition drawing priority.


=== variants ===
{{Prototype property|variants|[[Types/TileTransitions|TileTransitions]]}}
'''Type''': [[Types/Transitions]]
Graphics for this tile. This has extra properties besides the properties from [[Types/TileTransitions|TileTransitions]]:


Graphics for this tile. The Tint attribute has have no effect when used in any sub elements of the variant. This has extra properties besides the properties from [[Types/Transitions]]:
* main - [[Types/table|table]] of [[Types/TileSprite|TileSprite]] - Mandatory. Array of [[Types/TileSprite|TileSprite]]s with the following extra properties:
** size - [[Types/uint32|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|double]] - Optional. - Default: 1.0 - Probability of 1x1 (size = 1) version of tile must be 1.
** weights - [[Types/table|table]] of [[Types/double|double]] - Optional. - Array of [[Types/double|double]].
* material_background - [[Types/TileSprite|TileSprite]] - 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.


==== main ====
{{Prototype property|map_color|[[Types/Color|Color]]}}
'''Type''': [[Types/table]] of [[Types/Animation]]


Mandatory. Array of [[Types/Animation]]s with the following extra properties:
{{Prototype property|pollution_absorption_per_second|[[Types/double|double]]}}
Emissions absorbed per second by this tile. Use a negative value if pollution is created instead of removed.


===== size =====
== Optional properties ==
: '''Type''': [[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.
{{Prototype property|transition_overlay_layer_offset|[[Types/uint8|uint8]]|0|optional=true}}


===== probability =====
{{Prototype property|layer_group|[[Types/string|string]]|"water" if <code>draw_in_water_layer</code> is true, else "ground"|optional=true}}
: '''Type''': [[Types/double]]
One of "zero", "water", "water-overlay", "ground" and "top".


: '''Default''': 1
{{Prototype property|draw_in_water_layer|[[Types/bool|bool]]|false|optional=true}}
Used only for the <code>layer_group</code> default, see above.


: Optional. Probability of 1x1 (size = 1) version of tile must be 1.
{{Prototype property|transition_merges_with_tile|[[Types/string|string]]|optional=true}}
Name of a tile.


===== weights =====
{{Prototype property|effect_color|[[Types/Color|Color]]|<nowiki>{r=1, g=1, b=1, a=1} (white)</nowiki>|optional=true}}
: '''Type''': [[Types/table]] of [[Types/double]]


: Optional. Array of [[Types/double]].
{{Prototype property|tint|[[Types/Color|Color]]|<nowiki>{r=1, g=1, b=1, a=1} (white)</nowiki>|optional=true}}


==== material_background ====
{{Prototype property|walking_sound|[[Types/Sound|Sound]]|optional=true}}
'''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.
{{Prototype property|build_sound|[[Types/table|table]]|optional=true}}
Either one [[Types/Sound|Sound]] or a table with the following optional key/value pairs:
* small - [[Types/Sound|Sound]]
* medium - [[Types/Sound|Sound]]
* large - [[Types/Sound|Sound]]


=== walking_sound ===
If the [[Types/Sound|Sound]] is provided directly, it is loaded as the "small" build sound.
'''Type''': [[Types/Sound]]


=== map_color ===
{{Prototype property|mined_sound|[[Types/Sound|Sound]]|optional=true}}
'''Type''': [[Types/Color]]


=== ageing ===
{{Prototype property|walking_speed_modifier|[[Types/double|double]]|1|optional=true}}
'''Type''': [[Types/double]]


Emissions per tick. Use negative value if pollution is consumed/removed instead of produced.
{{Prototype property|vehicle_friction_modifier|[[Types/double|double]]|1|optional=true}}


== Optional properties ==
{{Prototype property|decorative_removal_probability|[[Types/float|float]]|0.0|optional=true}}


=== transition_overlay_layer_offset ===
{{Prototype property|allowed_neighbors|[[Types/table|table]] of [[Types/string|string]]|All tiles|optional=true}}
'''Type''': [[Types/uint8]]
Array of tile names that are allowed next to this one.


'''Default''': 0
{{Prototype property|needs_correction|[[Types/bool|bool]]|false|optional=true}}


=== draw_in_water_layer ===
{{Prototype property|minable|[[Types/MinableProperties|MinableProperties]]|optional=true}}
'''Type''': [[Types/bool]]
If you want the tile to not be mineable, don't specify the minable property. Only non-mineable tiles become hidden tiles when placing mineable tiles on top of them.
 
'''Default''': false
 
=== transition_merges_with_tile ===
'''Type''': [[Types/string]]


{{Prototype property|next_direction|[[Types/string|string]]|optional=true}}
Name of a tile.
Name of a tile.


=== build_sound ===
{{Prototype property|can_be_part_of_blueprint|[[Types/bool|bool]]|true|optional=true}}
'''Type''': [[Types/Sound]]


=== mined_sound ===
{{Prototype property|effect|[[Types/string|string]]|optional=true}}
'''Type''': [[Types/Sound]]
Name of a [[Prototype/TileEffect]].


=== walking_speed_modifier ===
{{Prototype property|trigger_effect|[[Types/TriggerEffect|TriggerEffect]]|optional=true}}
'''Type''': [[Types/double]]
Called by [[Types/InvokeTileEffectTriggerEffectItem|InvokeTileEffectTriggerEffectItem]].


'''Default''': 1
{{Prototype property|scorch_mark_color|[[Types/Color|Color]]|optional=true}}


=== vehicle_friction_modifier ===
{{Prototype property|check_collision_with_entities|[[Types/bool|bool]]|false|optional=true}}
'''Type''': [[Types/double]]
If set to true, the game will check for collisions with entities before building or mining the tile. If entities are in the way it is not possible to mine/build the tile.


'''Default''': 1
{{Prototype property|icons, icon, icon_size (IconSpecification)|[[Types/IconSpecification|IconSpecification]]|optional=true}}
If this is not set, the <code>material_background</code> in <code>variants</code> is used as the icon.


=== decorative_removal_probability ===
{{Prototype property|effect_color_secondary|[[Types/Color|Color]]|optional=true}}
'''Type''': [[Types/float]]
Used by the [[pollution]] shader.
 
'''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 ===
{{Prototype property|effect_is_opaque|[[Types/bool|bool]]|<code>effect_color</code> alpha >= 1|optional=true}}
'''Type''': [[Types/bool]]


'''Default''': true
{{Prototype property|transitions|[[Types/table|table]] of [[Types/TileTransitions|TileTransitions]]|optional=true}}
Extra transitions. Array of [[Types/TileTransitions|TileTransitions]].


=== transitions ===
Each [[Types/TileTransitions|TileTransitions]] needs the extra mandatory property <code>to_tiles</code>, which is a [[Types/table|table]] (array) of [[Types/string|string]] which is the name of a tile.<br>
'''Type''': [[Types/table]] of [[Types/Transitions]]
Furthermore, each [[Types/TileTransitions|TileTransitions]] needs the extra mandatory property <code>transition_group</code> which is a [[Types/uint8|uint8]].


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.
{{Prototype property|transitions_between_transitions|[[Types/table|table]] of [[Types/TileTransitions|TileTransitions]]|optional=true}}
Array of [[Types/TileTransitions|TileTransitions]].


=== transitions_between_transitions ===
Each [[Types/TileTransitions|TileTransitions]] needs the extra mandatory properties <code>transition_group1</code> and <code>transition_group2</code>, which are of [[Types/uint8|uint8]].
'''Type''': [[Types/table]] of [[Types/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.
{{Prototype property|autoplace|[[Types/AutoplaceSpecification|AutoplaceSpecification]]|optional=true}}


=== autoplace ===
{{Prototype property|placeable_by|[[Types/ItemToPlace|ItemToPlace]] or [[Types/table|table]] of [[Types/ItemToPlace|ItemToPlace]]|optional=true}}
'''Type''': [[Types/AutoplaceSpecification]]

Latest revision as of 16:42, 17 June 2022

Prototype definitions » PrototypeBase » Prototype/Tile


A tile. Only 255 instances of this prototype may be defined.


Prototype/Tile — tile
collision_mask::CollisionMask
layer::uint8
map_color::Color
pollution_absorption_per_second::double
variants::TileTransitions
allowed_neighbors::table of string (optional)
autoplace::AutoplaceSpecification (optional)
build_sound::table (optional)
can_be_part_of_blueprint::bool (optional)
check_collision_with_entities::bool (optional)
decorative_removal_probability::float (optional)
draw_in_water_layer::bool (optional)
effect::string (optional)
effect_color::Color (optional)
effect_color_secondary::Color (optional)
effect_is_opaque::bool (optional)
icons, icon, icon_size (IconSpecification)::IconSpecification (optional)
layer_group::string (optional)
minable::MinableProperties (optional)
mined_sound::Sound (optional)
needs_correction::bool (optional)
next_direction::string (optional)
placeable_by::ItemToPlace or table of ItemToPlace (optional)
scorch_mark_color::Color (optional)
tint::Color (optional)
transition_merges_with_tile::string (optional)
transition_overlay_layer_offset::uint8 (optional)
transitions::table of TileTransitions (optional)
transitions_between_transitions::table of TileTransitions (optional)
trigger_effect::TriggerEffect (optional)
vehicle_friction_modifier::double (optional)
walking_sound::Sound (optional)
walking_speed_modifier::double (optional)
Inherited from PrototypeBase
name::string
type::string
localised_description::LocalisedString (optional)
localised_name::LocalisedString (optional)
order::Order (optional)

Mandatory properties

Inherits all properties from PrototypeBase.

collision_mask

Type: CollisionMask

layer

Type: uint8
Specifies transition drawing priority.

variants

Type: TileTransitions
Graphics for this tile. This has extra properties besides the properties from TileTransitions:

  • main - table of TileSprite - Mandatory. Array of TileSprites with the following extra properties:
    • size - 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 width and height of the animation which cannot be set directly. (width or height) = size * 32 / scale.
    • probability - double - Optional. - Default: 1.0 - Probability of 1x1 (size = 1) version of tile must be 1.
    • weights - table of double - Optional. - Array of double.
  • material_background - TileSprite - 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: Color

pollution_absorption_per_second

Type: double
Emissions absorbed per second by this tile. Use a negative value if pollution is created instead of removed.

Optional properties

transition_overlay_layer_offset

Type: uint8
Default: 0

layer_group

Type: string
Default: "water" if draw_in_water_layer is true, else "ground"
One of "zero", "water", "water-overlay", "ground" and "top".

draw_in_water_layer

Type: bool
Default: false
Used only for the layer_group default, see above.

transition_merges_with_tile

Type: string
Name of a tile.

effect_color

Type: Color
Default: {r=1, g=1, b=1, a=1} (white)

tint

Type: Color
Default: {r=1, g=1, b=1, a=1} (white)

walking_sound

Type: Sound

build_sound

Type: table
Either one Sound or a table with the following optional key/value pairs:

If the Sound is provided directly, it is loaded as the "small" build sound.

mined_sound

Type: Sound

walking_speed_modifier

Type: double
Default: 1

vehicle_friction_modifier

Type: double
Default: 1

decorative_removal_probability

Type: float
Default: 0.0

allowed_neighbors

Type: table of string
Default: All tiles
Array of tile names that are allowed next to this one.

needs_correction

Type: bool
Default: false

minable

Type: MinableProperties
If you want the tile to not be mineable, don't specify the minable property. Only non-mineable tiles become hidden tiles when placing mineable tiles on top of them.

next_direction

Type: string
Name of a tile.

can_be_part_of_blueprint

Type: bool
Default: true

effect

Type: string
Name of a Prototype/TileEffect.

trigger_effect

Type: TriggerEffect
Called by InvokeTileEffectTriggerEffectItem.

scorch_mark_color

Type: Color

check_collision_with_entities

Type: bool
Default: false
If set to true, the game will check for collisions with entities before building or mining the tile. If entities are in the way it is not possible to mine/build the tile.

icons, icon, icon_size (IconSpecification)

Type: IconSpecification
If this is not set, the material_background in variants is used as the icon.

effect_color_secondary

Type: Color
Used by the pollution shader.

effect_is_opaque

Type: bool

transitions

Type: table of TileTransitions
Extra transitions. Array of TileTransitions.

Each TileTransitions needs the extra mandatory property to_tiles, which is a table (array) of string which is the name of a tile.
Furthermore, each TileTransitions needs the extra mandatory property transition_group which is a uint8.

transitions_between_transitions

Type: table of TileTransitions
Array of TileTransitions.

Each TileTransitions needs the extra mandatory properties transition_group1 and transition_group2, which are of uint8.

autoplace

Type: AutoplaceSpecification

placeable_by

Type: ItemToPlace or table of ItemToPlace