Prototype/Fluid: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎Mandatory properties: added descriptions to the color properties)
(Removed old prototype docs)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Mandatory properties ==
<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/prototypes/FluidPrototype.html https://lua-api.factorio.com/latest/prototypes/FluidPrototype.html]
Inherits all properties from [[Prototype]].


=== icon ===
</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>
'''Type''': [[Types/FileName]]
 
=== default_temperature ===
'''Type''': [[Types/uint]]
 
Also the minimum temperature of the fluid.
 
=== max_temperature ===
'''Type''': [[Types/uint]]
 
=== base_color ===
'''Type''': [[Types/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''': [[Types/color]]
 
Used only for pipe windows or storage tank fill gauges.
 
=== pressure_to_speed_ratio ===
'''Type''': [[Types/double]]
 
=== flow_to_energy_ratio ===
'''Type''': [[Types/double]]
 
== Optional properties ==
 
=== heat_capacity ===
'''Type''': [[Types/EnergyAmount]]
 
Joule needed to heat 1 Unit by 1 °C.
 
=== gas_temperature ===
'''Type''': [[Types/uint]]
 
=== auto_barrel ===
'''Type''': [[Types/bool]]
 
Whether the fluid should be included in the barrel recipes automatically generated in data-updates.lua in the base mod.
 
== Example ==
<syntaxhighlight lang="lua">{
    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",
    order = "a[fluid]-a[water]",
    pressure_to_speed_ratio = 0.4,
    flow_to_energy_ratio = 0.59
  },</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/prototypes/FluidPrototype.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.