Prototype/StorageTank: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Updated styling of prototype doc migration note)
(Removed old prototype docs)
 
Line 2: Line 2:


</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>
</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>
{{Prototype parent|Prototype/EntityWithOwner}}
A [[storage tank]].
{{Prototype TOC|storage-tank}}
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/EntityWithOwner]].
{{Prototype property|fluid_box|[[Types/FluidBox|FluidBox]]}}
{{Prototype property|window_bounding_box|[[Types/BoundingBox|BoundingBox]]}}
The location of the window showing the contents. Note that for window_background the width and height are determined by the sprite and window_bounding_box only determines the drawing location. For fluid_background the width is determined by the sprite and the height and drawing location are determined by window_bounding_box.
{{Prototype property|pictures|[[Types/table|table]]}}
Table with the following mandatory members:
* picture - [[Types/Sprite4Way|Sprite4Way]]
* window_background - [[Types/Sprite|Sprite]]
* fluid_background - [[Types/Sprite|Sprite]]
* flow_sprite - [[Types/Sprite|Sprite]]
* gas_flow - [[Types/Animation|Animation]]
{{Prototype property|flow_length_in_ticks|[[Types/uint32|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 ==
{{Prototype property|two_direction_only|[[Types/bool|bool]]|false|optional=true}}
{{Prototype property|circuit_wire_max_distance|[[Types/double|double]]|0|optional=true}}
{{Prototype property|draw_copper_wires|[[Types/bool|bool]]|true|optional=true}}
{{Prototype property|draw_circuit_wires|[[Types/bool|bool]]|true|optional=true}}
{{Prototype property|circuit_wire_connection_points|[[Types/table|table]] of [[Types/WireConnectionPoint|WireConnectionPoint]]|optional=true}}
Mandatory if circuit_wire_max_distance  > 0.
{{Prototype property|circuit_connector_sprites|[[Types/table|table]] of [[Types/CircuitConnectorSprites|CircuitConnectorSprites]]|optional=true}}
Mandatory if circuit_wire_max_distance  > 0.
{{Prototype property|scale_info_icons|[[Types/bool|bool]]|true|optional=true}}
If the icons of fluids shown in alt-mode should be scaled to the storage tank's size.

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.