Types/EnergySource: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (→‎smoke: note on type)
m (→‎input_flow_limit: small clarification)
 
(32 intermediate revisions by 5 users not shown)
Line 4: Line 4:
'''Type''': [[Types/string]]
'''Type''': [[Types/string]]


Only valid values are "electric", "burner" or "heat", it specifies the type of the energy source to be used.
Mandatory. Only valid values are "electric", "burner", "heat", "fluid" or "void", it specifies the type of the energy source to be used.
=== emissions ===
 
=== emissions_per_minute ===
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]


'''Default''': 0
'''Default''': 0


The pollution an entity emits is ''emissions'' times the energy consumption in kW. (This gives you the number that is shown in the entiy tooltip.)
Optional. The pollution an entity emits per minute at full energy consumption. <code>emissions_per_minute</code> is exactly the value that is shown in the entity tooltip.


=== render_no_power_icon ===
=== render_no_power_icon ===
Line 17: Line 18:
'''Default''': true
'''Default''': true


Whether to render the [[File:Electricity-icon-red.png|50px]] icon on the entity if it is low on power. Also applies to [[File:Fuel-icon-red.png|50px]] when using a burner energy source.
Optional. Whether to render the [[File:Electricity-icon-red.png|50px]] icon on the entity if it is low on power. Also applies to [[File:Fuel-icon-red.png|50px]] when using a burner energy source.


=== render_no_network_icon ===
=== render_no_network_icon ===
Line 24: Line 25:
'''Default''': true
'''Default''': true


Whether to render the [[File:Electricity-icon-unplugged.png|50px]] icon on the entity if it is not connected to a electric network.
Optional. Whether to render the [[File:Electricity-icon-unplugged.png|50px]] icon on the entity if it is not connected to a electric network.


== Electric energy source ==
== Electric energy source ==
Line 30: Line 31:
'''Type''': [[Types/Energy]]
'''Type''': [[Types/Energy]]


How much power the entity holds.
Optional. How much energy the entity holds.
 
=== usage_priority ===
=== usage_priority ===
'''Type''': [[Types/ElectricUsagePriority]]
'''Type''': [[Types/ElectricUsagePriority]]
Mandatory.
=== input_flow_limit ===
=== input_flow_limit ===
'''Type''': [[Types/Energy]]
'''Type''': [[Types/Energy]]


'''Default''': 0
'''Default''': max double
 
Optional. The rate at which energy can be taken, from the network, to refill the energy buffer. 0 means no transfer.


How fast the energy can flow into the entity. 0 means no limit.
=== output_flow_limit ===
=== output_flow_limit ===
'''Type''': [[Types/Energy]]
'''Type''': [[Types/Energy]]


'''Default''': 0
'''Default''': max double


How fast the energy can flow out of the entity. 0 means no limit.
Optional. The rate at which energy can be provided, to the network, from the energy buffer. 0 means no transfer.


=== drain ===
=== drain ===
'''Type''': [[Types/Energy]]
'''Type''': [[Types/Energy]]
Optional. How much energy (per second) will be continuously removed from the energy buffer. In game, this is shown in the tooltip as "Min. ''[Minimum]'' Consumption". Applied as a constant consumption-per-tick, even when the entity has the property <code>active</code> false.


== Burner ==
== Burner ==
=== fuel_inventory_size ===
=== fuel_inventory_size ===
'''Type''': [[Types/ItemStackIndex]]
'''Type''': [[Types/ItemStackIndex]]
Mandatory.


=== burnt_inventory_size ===
=== burnt_inventory_size ===
Line 57: Line 66:


'''Default''': 0
'''Default''': 0
Optional.


=== smoke ===
=== smoke ===
'''Type''': [[Types/table]] of [[Types/SmokeSource]]
'''Type''': [[Types/table]] of [[Types/SmokeSource]]


Array of 1 or more smoke sources.
Optional. Array of 1 or more smoke sources.


=== light_flicker ===
=== light_flicker ===
'''Type''': [[Types/LightFlickeringDefinition]]
'''Type''': [[Types/LightFlickeringDefinition]]
Optional.


=== effectivity ===
=== effectivity ===
Line 71: Line 84:
'''Default''': 1
'''Default''': 1


1 means 100% effectivity. Can't be 0.
Optional. 1 means 100% effectivity. Must be greater than 0. Multiplier of the energy output.


=== fuel_category ===
=== fuel_category ===
Line 78: Line 91:
'''Default''': "chemical"
'''Default''': "chemical"


The energy source can be used with fuel from this [[Prototype/FuelCategory|fuel category]].
Optional. The energy source can be used with fuel from this [[Prototype/FuelCategory|fuel category]]. For a list on built-in categories, see [[Data.raw#fuel-category]].
 
If <code>fuel_categories</code> is defined, fuel_category is ignored.


=== fuel_categories ===
=== fuel_categories ===
'''Type''': [[Types/table]] of [[Types/string]]
'''Type''': [[Types/table]] of [[Types/string]]


Same as above, only one of them can exist.
Optional. Same as above, only one of them can exist. For a list on built-in categories, see [[Data.raw#fuel-category]].
 
Takes precedence over <code>fuel_category</code>.


== Heat energy source ==
== Heat energy source ==
=== max_temperature ===
=== max_temperature ===
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]
Mandatory. max_temperature must be >= default_temperature.
=== default_temperature ===
'''Type''': [[Types/double]]
'''Default''': 15
Optional.


=== specific_heat ===
=== specific_heat ===
'''Type''': [[Types/Energy]]
'''Type''': [[Types/Energy]]
Mandatory.


=== max_transfer ===
=== max_transfer ===
'''Type''': [[Types/Energy]]
'''Type''': [[Types/Energy]]
Mandatory.


=== min_temperature_gradient ===
=== min_temperature_gradient ===
Line 99: Line 129:


'''Default''': 1
'''Default''': 1
Optional.
=== min_working_temperature ===
'''Type''': [[Types/double]]
'''Default''': 15
Optional. min_working_temperature must be >= default_temperature. min_working_temperature must be <= max_temperature.
=== minimum_glow_temperature ===
'''Type''': [[Types/float]]
'''Default''': 1
=== pipe_covers ===
'''Type''': [[Types/Sprite4Way]]
Optional.
=== heat_pipe_covers ===
'''Type''': [[Types/Sprite4Way]]
Optional.
=== heat_picture ===
'''Type''': [[Types/Sprite4Way]]
Optional.
=== heat_glow ===
'''Type''': [[Types/Sprite4Way]]
Optional.


=== connections ===
=== connections ===
'''Type''': [[Types/table]] of [[Types/HeatConnection]]
'''Type''': [[Types/table]] of [[Types/HeatConnection]]


=== pipe_covers ===
Optional. The table may only contain up to 32 connections.
'''Type''': [[Types/Sprite4Way]]
 
== Void energy source ==
Void is free energy, there are no additional entries required.
<syntaxhighlight lang="lua">
  energy_source = {type = "void"}
</syntaxhighlight>
 
== Fluid energy source ==
=== fluid_box ===
'''Type''': [[Types/FluidBox]]
 
Mandatory.
All standard fluid box configurations are acceptable, but the type must be "input" or "input-output" to function correctly.
Scale_fluid_usage, fluid_usage_per_tick or a filter on the fluidbox must be set to be able to calculate the fluid usage of the energy source.
 
=== smoke ===
'''Type''': [[Types/table]] of [[Types/SmokeSource]]
 
Optional. Array of 1 or more smoke sources.
 
=== light_flicker ===
'''Type''': [[Types/LightFlickeringDefinition]]
 
Optional.
 
=== effectivity ===
'''Type''': [[Types/double]]
 
'''Default''': 1
 
Optional. 1 means 100% effectivity. Must be greater than 0. Multiplier of the energy output.
 
=== burns_fluid ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
Optional. If set to true, the energy source will calculate power based on the fluid's fuel_value entry, else it will calculate based on fluid temperature.
 
=== scale_fluid_usage ===
'''Type''': [[Types/bool]]
 
'''Default''': false
 
Optional. If set to true, the energy source will consume as much fluid as required to produce the desired power, if set to false it will consume as much as it is allowed to, wasting any excess.
 
=== destroy_non_fuel_fluid ===
'''Type''': [[Types/bool]]
 
'''Default''': true
 
Optional. This property is used when:
* <code>burns_fluid</code> is true and the fluid has a [[Prototype/Fluid#fuel_value|fuel_value]] of 0
* or <code>burns_fluid</code> is false and the fluid is at default temperature
In these cases, this property determines whether the fluid should be destroyed, meaning that the fluid is consumed at the rate of <code>fluid_usage_per_tick</code>, without producing any power.
 
=== fluid_usage_per_tick ===
'''Type''': [[Types/double]]
 
'''Default''': 0
 
Optional. The number of fluid units the energy source uses per tick.
If used with scale_fluid_usage, this specifies the maximum. If this value is not set, scale_energy_usage = false and a fluid box filter is set, the game will attempt to calculate this value from the fluid box filter's fluid's fuel_value or heat_capacity and the entity's energy_usage. If burns_fluid is false, maximum_temperature will also be used. If the attempt of the game to calculate this value fails ( scale_energy_usage = false and a fluid box filter is set), then scale_energy_usage will be forced to true, to prevent the energy source from being an infinite fluid sink.[https://forums.factorio.com/90613]
 
=== maximum_temperature ===
'''Type''': [[Types/double]]
 
'''Default''': 0, meaning unlimited
 
If it is specified while scale_fluid_usage = false and fluid_usage_per_tick is not specified, the game will use this value to calculate fluid_usage_per_tick.
 
{{Prototype property type usage|{{FULLPAGENAME}}}}

Latest revision as of 17:53, 8 December 2022

Basics

Specifies the way the entity gets its energy.

type

Type: Types/string

Mandatory. Only valid values are "electric", "burner", "heat", "fluid" or "void", it specifies the type of the energy source to be used.

emissions_per_minute

Type: Types/double

Default: 0

Optional. The pollution an entity emits per minute at full energy consumption. emissions_per_minute is exactly the value that is shown in the entity tooltip.

render_no_power_icon

Type: Types/bool

Default: true

Optional. Whether to render the Electricity-icon-red.png icon on the entity if it is low on power. Also applies to Fuel-icon-red.png when using a burner energy source.

render_no_network_icon

Type: Types/bool

Default: true

Optional. Whether to render the Electricity-icon-unplugged.png icon on the entity if it is not connected to a electric network.

Electric energy source

buffer_capacity

Type: Types/Energy

Optional. How much energy the entity holds.

usage_priority

Type: Types/ElectricUsagePriority

Mandatory.

input_flow_limit

Type: Types/Energy

Default: max double

Optional. The rate at which energy can be taken, from the network, to refill the energy buffer. 0 means no transfer.

output_flow_limit

Type: Types/Energy

Default: max double

Optional. The rate at which energy can be provided, to the network, from the energy buffer. 0 means no transfer.

drain

Type: Types/Energy

Optional. How much energy (per second) will be continuously removed from the energy buffer. In game, this is shown in the tooltip as "Min. [Minimum] Consumption". Applied as a constant consumption-per-tick, even when the entity has the property active false.

Burner

fuel_inventory_size

Type: Types/ItemStackIndex

Mandatory.

burnt_inventory_size

Type: Types/ItemStackIndex

Default: 0

Optional.

smoke

Type: Types/table of Types/SmokeSource

Optional. Array of 1 or more smoke sources.

light_flicker

Type: Types/LightFlickeringDefinition

Optional.

effectivity

Type: Types/double

Default: 1

Optional. 1 means 100% effectivity. Must be greater than 0. Multiplier of the energy output.

fuel_category

Type: Types/string

Default: "chemical"

Optional. The energy source can be used with fuel from this fuel category. For a list on built-in categories, see Data.raw#fuel-category.

If fuel_categories is defined, fuel_category is ignored.

fuel_categories

Type: Types/table of Types/string

Optional. Same as above, only one of them can exist. For a list on built-in categories, see Data.raw#fuel-category.

Takes precedence over fuel_category.

Heat energy source

max_temperature

Type: Types/double

Mandatory. max_temperature must be >= default_temperature.

default_temperature

Type: Types/double

Default: 15

Optional.

specific_heat

Type: Types/Energy

Mandatory.

max_transfer

Type: Types/Energy

Mandatory.

min_temperature_gradient

Type: Types/double

Default: 1

Optional.

min_working_temperature

Type: Types/double

Default: 15

Optional. min_working_temperature must be >= default_temperature. min_working_temperature must be <= max_temperature.

minimum_glow_temperature

Type: Types/float

Default: 1

pipe_covers

Type: Types/Sprite4Way

Optional.

heat_pipe_covers

Type: Types/Sprite4Way

Optional.

heat_picture

Type: Types/Sprite4Way

Optional.

heat_glow

Type: Types/Sprite4Way

Optional.

connections

Type: Types/table of Types/HeatConnection

Optional. The table may only contain up to 32 connections.

Void energy source

Void is free energy, there are no additional entries required.

  energy_source = {type = "void"}

Fluid energy source

fluid_box

Type: Types/FluidBox

Mandatory. All standard fluid box configurations are acceptable, but the type must be "input" or "input-output" to function correctly. Scale_fluid_usage, fluid_usage_per_tick or a filter on the fluidbox must be set to be able to calculate the fluid usage of the energy source.

smoke

Type: Types/table of Types/SmokeSource

Optional. Array of 1 or more smoke sources.

light_flicker

Type: Types/LightFlickeringDefinition

Optional.

effectivity

Type: Types/double

Default: 1

Optional. 1 means 100% effectivity. Must be greater than 0. Multiplier of the energy output.

burns_fluid

Type: Types/bool

Default: false

Optional. If set to true, the energy source will calculate power based on the fluid's fuel_value entry, else it will calculate based on fluid temperature.

scale_fluid_usage

Type: Types/bool

Default: false

Optional. If set to true, the energy source will consume as much fluid as required to produce the desired power, if set to false it will consume as much as it is allowed to, wasting any excess.

destroy_non_fuel_fluid

Type: Types/bool

Default: true

Optional. This property is used when:

  • burns_fluid is true and the fluid has a fuel_value of 0
  • or burns_fluid is false and the fluid is at default temperature

In these cases, this property determines whether the fluid should be destroyed, meaning that the fluid is consumed at the rate of fluid_usage_per_tick, without producing any power.

fluid_usage_per_tick

Type: Types/double

Default: 0

Optional. The number of fluid units the energy source uses per tick. If used with scale_fluid_usage, this specifies the maximum. If this value is not set, scale_energy_usage = false and a fluid box filter is set, the game will attempt to calculate this value from the fluid box filter's fluid's fuel_value or heat_capacity and the entity's energy_usage. If burns_fluid is false, maximum_temperature will also be used. If the attempt of the game to calculate this value fails ( scale_energy_usage = false and a fluid box filter is set), then scale_energy_usage will be forced to true, to prevent the energy source from being an infinite fluid sink.[1]

maximum_temperature

Type: Types/double

Default: 0, meaning unlimited

If it is specified while scale_fluid_usage = false and fluid_usage_per_tick is not specified, the game will use this value to calculate fluid_usage_per_tick.

Prototype properties that use this type