Prototype/StorageTank: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Set prototype parent)
(Converted to SMW format)
Line 1: Line 1:
{{Prototype parent|Prototype/EntityWithHealth}}
{{Prototype parent|Prototype/EntityWithHealth}}
A [[storage tank]].


== Basics ==
{{Prototype TOC|storage-tank}}
Prototype type: '''storage-tank'''
 
A [[storage tank]]. Based on [[Prototype/EntityWithHealth]].


== Mandatory properties ==
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].


=== fluid_box ===
{{Prototype property|fluid_box|[[Types/FluidBox|FluidBox]]}}
'''Type''': [[Types/FluidBox]]


=== window_bounding_box ===
{{Prototype property|window_bounding_box|[[Types/BoundingBox|BoundingBox]]}}
'''Type''': [[Types/BoundingBox]]
 
=== pictures ===
'''Type''': [[Types/table]]


{{Prototype property|pictures|[[Types/table|table]]||optional=true}}
Table with the following mandatory members:
Table with the following mandatory members:
* picture - [[Types/Sprite4Way]]
* picture - [[Types/Sprite4Way|Sprite4Way]]
* window_background - [[Types/Sprite]]
* window_background - [[Types/Sprite|Sprite]]
* fluid_background - [[Types/Sprite]]
* fluid_background - [[Types/Sprite|Sprite]]
* flow_sprite - [[Types/Sprite]]
* flow_sprite - [[Types/Sprite|Sprite]]
* gas_flow - [[Types/Animation]]
* gas_flow - [[Types/Animation|Animation]]
 
=== flow_length_in_ticks ===
'''Type''': [[Types/uint32]]


{{Prototype property|flow_length_in_ticks|[[Types/uint32|uint32]]}}
Must be positive.
Must be positive.


Line 52: Line 44:
== Optional properties ==
== Optional properties ==


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


=== circuit_wire_max_distance ===
{{Prototype property|circuit_wire_max_distance|[[Types/double|double]]|0|optional=true}}
'''Type''': [[Types/double]]


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


=== draw_copper_wires ===
{{Prototype property|draw_circuit_wires|[[Types/bool|bool]]|true|optional=true}}
'''Type''': [[Types/bool]]
 
'''Default''': true
 
=== draw_circuit_wires ===
'''Type''': [[Types/bool]]
 
'''Default''': true
 
=== circuit_wire_connection_points ===
'''Type''': [[Types/table]] of [[Types/WireConnectionPoint]]


{{Prototype property|circuit_wire_connection_points|[[Types/table|table]] of [[Types/WireConnectionPoint|WireConnectionPoint]]|optional=true}}
Mandatory if circuit_wire_max_distance  > 0.
Mandatory if circuit_wire_max_distance  > 0.


=== circuit_connector_sprites ===
{{Prototype property|circuit_connector_sprites|[[Types/table|table]] of [[Types/CircuitConnectorSprites|CircuitConnectorSprites]]|optional=true}}
'''Type''': [[Types/table]] of [[Types/CircuitConnectorSprites]]
 
Mandatory if circuit_wire_max_distance  > 0.
Mandatory if circuit_wire_max_distance  > 0.


=== scale_info_icons ===
{{Prototype property|scale_info_icons|[[Types/bool|bool]]|true|optional=true}}
'''Type''': [[Types/bool]]
 
'''Default''': true
 
If the icons of fluids shown in alt-mode should be scaled to the storage tank's size.
If the icons of fluids shown in alt-mode should be scaled to the storage tank's size.

Revision as of 17:17, 5 August 2019

Template:Prototype parent A storage tank.

Template:Prototype TOC

Mandatory properties

This prototype inherits all the properties from Prototype/EntityWithHealth.

Template:Prototype property

Template:Prototype property

Template:Prototype property Table with the following mandatory members:

Template:Prototype property Must be positive.

Used for determining the x position inside the flow_sprite when drawing the storage tank. Does not affect gameplay.

The x position of the sprite will be ((game.tick % flow_length_in_ticks) ÷ flow_length_in_ticks) × (flow_sprite.width - 32). This means, that over flow_length_in_ticks ticks, the part of the flow_sprite that is drawn in-game is incrementally moved from most-left to most-right inside the actual sprite, that part always has a width of 32px. After flow_length_in_ticks, the part of the flow_sprite that is drawn will start from the left again.

Diagram:

Example state:
  [  { }     ]
  [] <- flow_sprite
  {} <- the part that is drawn in-game, width is 32px

This means:
State at (tick % flow_length_in_ticks) == 0:
  [{ }       ]
State at (tick % flow_length_in_ticks) == (flow_length_in_ticks ÷ 2):
  [    { }   ]
State at (tick % flow_length_in_ticks) == (flow_length_in_ticks - 1):
  [       { }]

Optional properties

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property Mandatory if circuit_wire_max_distance > 0.

Template:Prototype property Mandatory if circuit_wire_max_distance > 0.

Template:Prototype property If the icons of fluids shown in alt-mode should be scaled to the storage tank's size.