Prototype/StorageTank: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Removed old prototype docs)
 
(9 intermediate revisions by 3 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/StorageTankPrototype.html https://lua-api.factorio.com/latest/prototypes/StorageTankPrototype.html]
Prototype type: '''storage-tank'''


A [[storage tank]]. Based on [[Prototype/EntityWithHealth]].
</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 ==
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].
 
=== fluid_box ===
'''Type''': [[Types/FluidBox]]
 
=== window_bounding_box ===
'''Type''': [[Types/BoundingBox]]
 
=== pictures ===
'''Type''': [[Types/table]]
 
Table with the following mandatory members:
* picture - [[Types/Sprite4Way]]
* window_background - [[Types/Sprite]]
* fluid_background - [[Types/Sprite]]
* flow_sprite - [[Types/Sprite]]
* gas_flow - [[Types/Animation]]
 
=== flow_length_in_ticks ===
'''Type''': [[Types/uint32]]
 
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 <code>((game.tick % flow_length_in_ticks) ÷ flow_length_in_ticks) × (flow_sprite.width - 32)</code>. 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:
<pre>
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):
  [      { }]
</pre>
 
== Optional properties ==
 
=== two_direction_only ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
=== circuit_wire_max_distance ===
'''Type''': [[Types/double]]
 
'''Default''': 0
 
=== draw_copper_wires ===
'''Type''': [[Types/bool]]
 
'''Default''': true
 
=== draw_circuit_wires ===
'''Type''': [[Types/bool]]
 
'''Default''': true
 
=== circuit_wire_connection_points ===
'''Type''': [[Types/table]] of [[Types/WireConnectionPoint]]
 
Mandatory if circuit_wire_max_distance  > 0.
 
=== circuit_connector_sprites ===
'''Type''': [[Types/table]] of [[Types/CircuitConnectorSprites]]
 
Mandatory if circuit_wire_max_distance  > 0.

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/StorageTankPrototype.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.