Prototype/Fluid: Difference between revisions
(→Mandatory properties: added descriptions to the color properties) |
(0.16) |
||
Line 4: | Line 4: | ||
=== icon === | === icon === | ||
'''Type''': [[Types/FileName]] | '''Type''': [[Types/FileName]] | ||
=== icon_size === | |||
'''Type''': [[Types/uint]] | |||
The size of the square icon, in pixels, e.g. 32 for a 32px by 32px icon. | |||
=== default_temperature === | === default_temperature === | ||
'''Type''': [[Types/ | '''Type''': [[Types/double]] | ||
Also the minimum temperature of the fluid. | Also the minimum temperature of the fluid. | ||
=== max_temperature === | === max_temperature === | ||
'''Type''': [[Types/ | '''Type''': [[Types/double]] | ||
=== base_color === | === base_color === | ||
'''Type''': [[Types/ | '''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. | 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 === | === flow_color === | ||
'''Type''': [[Types/ | '''Type''': [[Types/Color]] | ||
Used only for pipe windows or storage tank fill gauges. | Used only for pipe windows or storage tank fill gauges. | ||
Line 28: | Line 33: | ||
=== flow_to_energy_ratio === | === flow_to_energy_ratio === | ||
'''Type''': [[Types/double]] | '''Type''': [[Types/double]] | ||
Flow to energy ratio can't be negative. | |||
== Optional properties == | == Optional properties == | ||
=== heat_capacity === | === heat_capacity === | ||
'''Type''': [[Types/ | '''Type''': [[Types/Energy]] | ||
'''Default''': "1KJ" | |||
Joule needed to heat 1 Unit by 1 °C. | Joule needed to heat 1 Unit by 1 °C. | ||
=== fuel_value === | |||
'''Type''': [[Types/Energy]] | |||
'''Default''': "0J" | |||
=== emissions_multiplier === | |||
'''Type''': [[Types/double]] | |||
'''Default''': 1.0 | |||
Scales pollution generated when the fluid is consumed. | |||
=== gas_temperature === | === gas_temperature === | ||
'''Type''': [[Types/ | '''Type''': [[Types/double]] | ||
'''Default''': max value of double (1.7976931348623158e+308) | |||
=== max_push_amount === | |||
'''Type''': [[Types/double]] | |||
'''Default''': 1 | |||
When two fluids interact how much of it can be pushed at most. | |||
=== ratio_to_push === | |||
'''Type''': [[Types/double]] | |||
'''Default''': 2.1 | |||
How much more height must one fluid have to push the other. | |||
=== auto_barrel === | === auto_barrel === | ||
Line 44: | Line 81: | ||
Whether the fluid should be included in the barrel recipes automatically generated in data-updates.lua in the base mod. | Whether the fluid should be included in the barrel recipes automatically generated in data-updates.lua in the base mod. | ||
== Differing defaults == | |||
=== subgroup === | |||
:''See [[Prototype#subgroup]]'' | |||
'''Default''': "fluid" | |||
The value of this property may not be an empty string. It either has to be nil, or a non-empty string. | |||
== Example == | == Example == | ||
<syntaxhighlight lang="lua">{ | <syntaxhighlight lang="lua"> { | ||
type = "fluid", | type = "fluid", | ||
name = "water", | name = "water", | ||
Line 54: | Line 98: | ||
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> |
Revision as of 12:01, 8 May 2018
Mandatory properties
Inherits all properties from Prototype.
icon
Type: Types/FileName
icon_size
Type: Types/uint
The size of the square icon, in pixels, e.g. 32 for a 32px by 32px icon.
default_temperature
Type: Types/double
Also the minimum temperature of the fluid.
max_temperature
Type: Types/double
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
Flow to energy ratio can't be negative.
Optional properties
heat_capacity
Type: Types/Energy
Default: "1KJ"
Joule needed to heat 1 Unit by 1 °C.
fuel_value
Type: Types/Energy
Default: "0J"
emissions_multiplier
Type: Types/double
Default: 1.0
Scales pollution generated when the fluid is consumed.
gas_temperature
Type: Types/double
Default: max value of double (1.7976931348623158e+308)
max_push_amount
Type: Types/double
Default: 1
When two fluids interact how much of it can be pushed at most.
ratio_to_push
Type: Types/double
Default: 2.1
How much more height must one fluid have to push the other.
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.
Differing defaults
subgroup
Default: "fluid"
The value of this property may not be an empty string. It either has to be nil, or a non-empty string.
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
}