Types/FluidBox: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(fixed types, added default values for optional things)
(Removed old prototype docs)
 
(24 intermediate revisions by 9 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/types/FluidBox.html https://lua-api.factorio.com/latest/types/FluidBox.html]


Used to set the fluid amount an entity can hold, as well as the connection points for pipes leading into and out of the entity.
</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>
 
== Properties ==
=== base_area ===
'''Type''': [[Types/double]]
 
A base area of 1 will hold 100 units of water, 2 will hold 200, etc...
 
=== height ===
'''Type''': [[Types/double]]
 
Optional, default 1.  
 
=== base_level ===
'''Type''': [[Types/double]]
 
Optional, default 0.
 
=== pipe_covers ===
'''Type''': Map of [[Types/string]] -> [[Types/Sprite]]
 
The pictures to show when another fluid box connects to this one. Should look like this:
 
<pre>
pipe_covers = {
  north = {
      ... sprite layers go here ...
  },
  south = {
      ... sprite layers go here ...
  },
  east = {
      ... sprite layers go here ...
  },
  west = {
      ... sprite layers go here ...
  }
}
</pre>
 
=== pipe_connections ===
 
=== production_type ===
'''Type''': [[Types/string]]
 
Possible values:
* input
* input-output
* output
 
=== filter ===
'''Type''': [[Types/string]]
 
<span style="color:#ff0000">
''Added in 0.16'' </span>
 
Optional. Can be used to specify which fluid is allowed to enter this fluid box. [https://forums.factorio.com/viewtopic.php?f=28&t=46302]
 
<syntaxhighlight lang="lua">filter = "steam"</syntaxhighlight>
 
=== minimum_temperature ===
'''Type''': [[Types/double]]
 
Optional. The minimum temperature allowed into the fluidbox.
 
<syntaxhighlight lang="lua">minimum_temperature = 100.0</syntaxhighlight>
 
=== maximum_temperature ===
'''Type''': [[Types/double]]
 
Optional. The maximum temperature allowed into the fluidbox.
 
<syntaxhighlight lang="lua">maximum_temperature = 1000.0</syntaxhighlight>
 
== Example ==
 
<syntaxhighlight lang="lua">fluid_box =
    {
      base_area = 1,
      height = 2,
      base_level = -1,
      pipe_covers = pipecoverspictures(),
      pipe_connections =
      {
        {type = "input-output", position = {-2, 0.5}},
        {type = "input-output", position = {2, 0.5}}
      },
      production_type = "input-output"
    },
</syntaxhighlight>

Latest revision as of 14:32, 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/types/FluidBox.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.