Factorio Prototype DocsVersion 1.1.107

FluidPrototype - 'fluid' Example code

A fluid.

Inherits from PrototypeBase

Properties

icons optional :: array[IconData]

Can't be an empty array.

Can't be an empty array.

icon optional :: FileName

Path to the icon file. [...]

Path to the icon file. [...]

icon_size optional :: SpriteSizeType

The size of the square icon, in pixels. [...]

The size of the square icon, in pixels. [...]

icon_mipmaps optional :: IconMipMapType

Icons of reduced size will be used at decreased scale.

Icons of reduced size will be used at decreased scale.

default_temperature :: double

Also the minimum temperature of the fluid. [...]

Also the minimum temperature of the fluid. [...]

base_color :: Color

Used by bars that show the fluid color, like the flamethrower turret fill bar in the tooltip, or the fill bar for the fluid wagon tooltip; and for the pipe windows and storage tank fill gauges.

Used by bars that show the fluid color, like the flamethrower turret fill bar in the tooltip, or the fill bar for the fluid wagon tooltip; and for the pipe windows and storage tank fill gauges.

flow_color :: Color

Used only for pipe windows or storage tank fill gauges.

Used only for pipe windows or storage tank fill gauges.

max_temperature optional :: double
heat_capacity optional :: Energy

Joule needed to heat 1 Unit by 1 °C.

Joule needed to heat 1 Unit by 1 °C.

fuel_value optional :: Energy
emissions_multiplier optional :: double

Scales pollution generated when the fluid is consumed.

Scales pollution generated when the fluid is consumed.

subgroup optional :: ItemSubGroupID

The name of the subgroup of this fluid. [...]

The name of the subgroup of this fluid. [...]

gas_temperature optional :: double

Above this temperature the gas_flow animation is used to display the fluid inside storage tanks and pipes.

Above this temperature the gas_flow animation is used to display the fluid inside storage tanks and pipes.

hidden optional :: bool

Hides the fluid from the signal selection screen.

Hides the fluid from the signal selection screen.

auto_barrel optional :: bool

Whether the fluid should be included in the barrel recipes automatically generated by the base mod. [...]

Whether the fluid should be included in the barrel recipes automatically generated by the base mod. [...]

Inherited from PrototypeBase
type :: string

Specifies the kind of prototype this is. [...]

Specifies the kind of prototype this is. [...]

name :: string

Unique textual identification of the prototype. [...]

Unique textual identification of the prototype. [...]

order optional :: Order

Used to order prototypes in inventory, recipes and GUIs. [...]

Used to order prototypes in inventory, recipes and GUIs. [...]

localised_name optional :: LocalisedString

Overwrites the name set in the locale file. [...]

Overwrites the name set in the locale file. [...]

localised_description optional :: LocalisedString

Overwrites the description set in the locale file. [...]

Overwrites the description set in the locale file. [...]

Properties

icons :: array[IconData] optional

Can't be an empty array.

icon :: FileName optional

Path to the icon file.

Mandatory if icons is not defined.

icon_size :: SpriteSizeType optional

The size of the square icon, in pixels. E.g. 32 for a 32px by 32px icon.

Mandatory if icons is not defined, or if icon_size is not specified for all instances of icons.

icon_mipmaps :: IconMipMapType optional

Default: 0

Icons of reduced size will be used at decreased scale.

default_temperature :: double

Also the minimum temperature of the fluid. Has to be lower than max_temperature.

base_color :: Color

Used by bars that show the fluid color, like the flamethrower turret fill bar in the tooltip, or the fill bar for the fluid wagon tooltip; and for the pipe windows and storage tank fill gauges.

flow_color :: Color

Used only for pipe windows or storage tank fill gauges.

max_temperature :: double optional

Default: value of default_temperature

heat_capacity :: Energy optional

Default: "1KJ"

Joule needed to heat 1 Unit by 1 °C.

Example

heat_capacity = "0.2KJ"

fuel_value :: Energy optional

Default: "0J"

Example

fuel_value = "3MJ"

emissions_multiplier :: double optional

Default: 1.0

Scales pollution generated when the fluid is consumed.

subgroup :: ItemSubGroupID optional

Default: "fluid"

The name of the subgroup of this fluid. The value of this property may not be an empty string. It either has to be nil, or a non-empty string.

gas_temperature :: double optional

Default: max value of double

Above this temperature the gas_flow animation is used to display the fluid inside storage tanks and pipes.

hidden :: bool optional

Default: false

Hides the fluid from the signal selection screen.

auto_barrel :: bool optional

Default: true

Whether the fluid should be included in the barrel recipes automatically generated by the base mod.

This property is not read by the game engine itself, but the base mod's data-updates.lua file. This means it is discarded by the game engine after loading finishes.

Example

{
  type = "fluid",
  name = "water",
  default_temperature = 15,
  max_temperature = 100,
  heat_capacity = "0.2KJ",
  base_color = { r = 0, g = 0.34, b = 0.6 },
  flow_color = { r = 0.7, g = 0.7, b = 0.7 },
  icon = "__base__/graphics/icons/fluid/water.png",
  icon_size = 64,
  icon_mipmaps = 4,
  order = "a[fluid]-a[water]"
}

Prototypes

Types