Types/FluidBox: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(fixed types, added default values for optional things)
(0.16)
Line 1: Line 1:
== Basics ==
== Basics ==
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.


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.
== Mandatory properties ==
 
=== pipe_connections ===
'''Type''': [[Types/table]] of [[Types/PipeConnectionDefinition]]
 
Max number of members is 255.
 
== Optional properties ==


== Properties ==
=== base_area ===
=== base_area ===
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]
'''Default''': 1


A base area of 1 will hold 100 units of water, 2 will hold 200, etc...
A base area of 1 will hold 100 units of water, 2 will hold 200, etc...


=== height ===
Must be greater than 0.
'''Type''': [[Types/double]]
 
Optional, default 1.  


=== base_level ===
=== base_level ===
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]


Optional, default 0.
'''Default''': 0


=== pipe_covers ===
=== height ===
'''Type''': Map of [[Types/string]] -> [[Types/Sprite]]
'''Type''': [[Types/double]]


The pictures to show when another fluid box connects to this one. Should look like this:
'''Default''': 1


<pre>
Must be greater than 0.
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 ===
=== filter ===
'''Type''': [[Types/string]]


=== production_type ===
Can be used to specify which fluid is allowed to enter this fluid box. [https://forums.factorio.com/viewtopic.php?f=28&t=46302]
'''Type''': [[Types/string]]


Possible values:
=== render_layer ===
* input
'''Type''': [[Types/RenderLayer]]
* input-output
* output


=== filter ===
'''Default''': "object"
'''Type''': [[Types/string]]


<span style="color:#ff0000">
=== pipe_covers ===
''Added in 0.16'' </span>
'''Type''': [[Types/Sprite4Way]]


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]
The pictures to show when another fluid box connects to this one.


<syntaxhighlight lang="lua">filter = "steam"</syntaxhighlight>
=== pipe_picture ===
'''Type''': [[Types/Sprite4Way]]


=== minimum_temperature ===
=== minimum_temperature ===
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]


Optional. The minimum temperature allowed into the fluidbox.
The minimum temperature allowed into the fluidbox.


<syntaxhighlight lang="lua">minimum_temperature = 100.0</syntaxhighlight>
<syntaxhighlight lang="lua">minimum_temperature = 100.0</syntaxhighlight>
Line 71: Line 60:
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]


Optional. The maximum temperature allowed into the fluidbox.
The maximum temperature allowed into the fluidbox.


<syntaxhighlight lang="lua">maximum_temperature = 1000.0</syntaxhighlight>
<syntaxhighlight lang="lua">maximum_temperature = 1000.0</syntaxhighlight>
=== production_type ===
'''Type''': [[Types/string]]
'''Default''': "None"
Possible values:
* "None"
* "input"
* "input-output"
* "output"
=== secondary_draw_order ===
'''Type''': [[Types/int8]]
'''Default''': 1
Set the secondary draw order for all orientations.
=== secondary_draw_orders ===
'''Type''': [[Types/table]] of [[Types/int8]]
'''Default''': {north = 1, east = 1, south = 1, west = 1}
Set the secondary draw order for each orientation.


== Example ==
== Example ==

Revision as of 21:20, 28 May 2018

Basics

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.

Mandatory properties

pipe_connections

Type: Types/table of Types/PipeConnectionDefinition

Max number of members is 255.

Optional properties

base_area

Type: Types/double

Default: 1

A base area of 1 will hold 100 units of water, 2 will hold 200, etc...

Must be greater than 0.

base_level

Type: Types/double

Default: 0

height

Type: Types/double

Default: 1

Must be greater than 0.

filter

Type: Types/string

Can be used to specify which fluid is allowed to enter this fluid box. [1]

render_layer

Type: Types/RenderLayer

Default: "object"

pipe_covers

Type: Types/Sprite4Way

The pictures to show when another fluid box connects to this one.

pipe_picture

Type: Types/Sprite4Way

minimum_temperature

Type: Types/double

The minimum temperature allowed into the fluidbox.

minimum_temperature = 100.0

maximum_temperature

Type: Types/double

The maximum temperature allowed into the fluidbox.

maximum_temperature = 1000.0

production_type

Type: Types/string

Default: "None"

Possible values:

  • "None"
  • "input"
  • "input-output"
  • "output"

secondary_draw_order

Type: Types/int8

Default: 1

Set the secondary draw order for all orientations.

secondary_draw_orders

Type: Types/table of Types/int8

Default: {north = 1, east = 1, south = 1, west = 1}

Set the secondary draw order for each orientation.

Example

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"
    },