Prototype/Fluid: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎Mandatory properties: added descriptions to the color properties)
m (→‎Mandatory properties: default_temperature description)
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Mandatory properties ==
{{Prototype parent|PrototypeBase}}
Inherits all properties from [[Prototype]].
A fluid.


=== icon ===
{{Prototype TOC|fluid}}
'''Type''': [[Types/FileName]]


=== default_temperature ===
== Mandatory properties ==
'''Type''': [[Types/uint]]
Inherits all properties from [[PrototypeBase]].


Also the minimum temperature of the fluid.
{{Prototype property|icons, icon, icon_size (IconSpecification)|[[Types/IconSpecification|IconSpecification]]}}


=== max_temperature ===
{{Prototype property|default_temperature|[[Types/double|double]]}}
'''Type''': [[Types/uint]]
Also the minimum temperature of the fluid. Has to be lower than <code>max_temperature</code>.


=== base_color ===
{{Prototype property|max_temperature|[[Types/double|double]]}}
'''Type''': [[Types/color]]


{{Prototype property|base_color|[[Types/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 fluidwagon 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 fluidwagon tooltip; and for the pipe windows and storage tank fill gauges.


=== flow_color ===
{{Prototype property|flow_color|[[Types/Color|Color]]}}
'''Type''': [[Types/color]]
 
Used only for pipe windows or storage tank fill gauges.
Used only for pipe windows or storage tank fill gauges.


=== pressure_to_speed_ratio ===
== Optional properties ==
'''Type''': [[Types/double]]


=== flow_to_energy_ratio ===
{{Prototype property|heat_capacity|[[Types/Energy|Energy]]|"1KJ"|optional=true}}
'''Type''': [[Types/double]]
Joule needed to heat 1 Unit by 1 °C.


== Optional properties ==
{{Prototype property|fuel_value|[[Types/Energy|Energy]]|"0J"|optional=true}}


=== heat_capacity ===
{{Prototype property|emissions_multiplier|[[Types/double|double]]|1.0|optional=true}}
'''Type''': [[Types/EnergyAmount]]
Scales pollution generated when the fluid is consumed.


Joule needed to heat 1 Unit by 1 °C.
{{Prototype property|subgroup|[[Types/string|string]]|"fluid"|optional=true}}
The value of this property may not be an empty string. It either has to be nil, or a non-empty string.


=== gas_temperature ===
{{Prototype property|gas_temperature|[[Types/double|double]]|max value of double|optional=true}}
'''Type''': [[Types/uint]]
Above this temperature the <code>gas_flow</code> animation is used to display the fluid inside storage tanks and pipes.


=== auto_barrel ===
{{Prototype property|hidden|[[Types/bool|bool]]|false|optional=true}}
'''Type''': [[Types/bool]]
Hides the fluid from the signal selection screen.


Whether the fluid should be included in the barrel recipes automatically generated in data-updates.lua in the base mod.
== Custom properties ==
The base mod reads the following property in data-updates.lua to determine if the fluid should be barreled. The property itself is not read by the C++ part of the game which means that it is discarded by the game when loading finishes.
* auto_barrel - [[Types/bool|bool]] - Optional, defaults to true. Whether the fluid should be included in the barrel recipes automatically generated in data-updates.lua in the base mod.


== Example ==
== Example ==
<syntaxhighlight lang="lua">{
<syntaxhighlight lang="lua"> {
     type = "fluid",
     type = "fluid",
     name = "water",
     name = "water",
Line 54: Line 53:
     flow_color = {r=0.7, g=0.7, b=0.7},
     flow_color = {r=0.7, g=0.7, b=0.7},
     icon = "__base__/graphics/icons/fluid/water.png",
     icon = "__base__/graphics/icons/fluid/water.png",
    icon_size = 32,
     order = "a[fluid]-a[water]",
     order = "a[fluid]-a[water]",
     pressure_to_speed_ratio = 0.4,
     pressure_to_speed_ratio = 0.4,
     flow_to_energy_ratio = 0.59
     flow_to_energy_ratio = 0.59
   },</syntaxhighlight>
   }</syntaxhighlight>

Revision as of 17:09, 3 March 2020

Prototype definitions » PrototypeBase » Prototype/Fluid


A fluid.


Prototype/Fluid — fluid
base_color::Color
default_temperature::double
flow_color::Color
icons, icon, icon_size (IconSpecification)::IconSpecification
emissions_multiplier::double (optional)
fuel_value::Energy (optional)
gas_temperature::double (optional)
heat_capacity::Energy (optional)
hidden::bool (optional)
max_temperature::double (optional)
subgroup::string (optional)
Inherited from PrototypeBase
name::string
type::string
localised_description::LocalisedString (optional)
localised_name::LocalisedString (optional)
order::Order (optional)

Mandatory properties

Inherits all properties from PrototypeBase.

icons, icon, icon_size (IconSpecification)

Type: IconSpecification

default_temperature

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

max_temperature

Type: double

base_color

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

flow_color

Type: Color
Used only for pipe windows or storage tank fill gauges.

Optional properties

heat_capacity

Type: Energy
Default: "1KJ"
Joule needed to heat 1 Unit by 1 °C.

fuel_value

Type: Energy
Default: "0J"

emissions_multiplier

Type: double
Default: 1.0
Scales pollution generated when the fluid is consumed.

subgroup

Type: string
Default: "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

Type: double
Default: max value of double
Above this temperature the gas_flow animation is used to display the fluid inside storage tanks and pipes.

hidden

Type: bool
Default: false
Hides the fluid from the signal selection screen.

Custom properties

The base mod reads the following property in data-updates.lua to determine if the fluid should be barreled. The property itself is not read by the C++ part of the game which means that it is discarded by the game when loading finishes.

  • auto_barrel - bool - Optional, defaults to true. Whether the fluid should be included in the barrel recipes automatically generated in data-updates.lua in the base mod.

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 = 32,
    order = "a[fluid]-a[water]",
    pressure_to_speed_ratio = 0.4,
    flow_to_energy_ratio = 0.59
  }