Prototype/CraftingMachine: Difference between revisions
(Set prototype parent) |
(Converted to SMW format) |
||
Line 1: | Line 1: | ||
{{Prototype parent|Prototype/EntityWithHealth}} | {{Prototype parent|Prototype/EntityWithHealth}} | ||
The abstract basis of the assembling machines and furnaces. Contains the properties that both of them have. | The abstract basis of the assembling machines and furnaces. Contains the properties that both of them have. | ||
Note that a crafting machine cannot be rotated unless it has at least one of the following: a fluid box, a heat energy source, a fluid energy source, or a non-square collision box. | Note that a crafting machine cannot be rotated unless it has at least one of the following: a fluid box, a heat energy source, a fluid energy source, or a non-square collision box. | ||
{{Prototype TOC|''abstract''}} | |||
== Extensions == | == Extensions == | ||
Line 17: | Line 15: | ||
This prototype inherits all the properties from [[Prototype/EntityWithHealth]]. | This prototype inherits all the properties from [[Prototype/EntityWithHealth]]. | ||
{{Prototype property|energy_usage|[[Types/Energy|Energy]]}} | |||
Sets how much energy this machine uses while crafting. Energy usage has to be positive. | Sets how much energy this machine uses while crafting. Energy usage has to be positive. | ||
{{Prototype property|crafting_speed|[[Types/double|double]]}} | |||
How fast this crafting machine can craft. 1 means that for example a 1 second long recipe take 1 second to craft. 0.5 means it takes 2 seconds, and 2 means it takes 0.5 seconds. | How fast this crafting machine can craft. 1 means that for example a 1 second long recipe take 1 second to craft. 0.5 means it takes 2 seconds, and 2 means it takes 0.5 seconds. | ||
Crafting speed has to be positive. | Crafting speed has to be positive. | ||
{{Prototype property|crafting_categories|[[Types/table|table]] of [[Types/string|string]]s}} | |||
A list of [[Prototype/RecipeCategory|recipe categories]] this crafting machine can use. | A list of [[Prototype/RecipeCategory|recipe categories]] this crafting machine can use. | ||
Line 39: | Line 31: | ||
</pre> | </pre> | ||
{{Prototype property|energy_source|[[Types/EnergySource|EnergySource]]}} | |||
Defines how the crafting machine is powered. | Defines how the crafting machine is powered. | ||
When using an electric energy source and <code>drain</code> is not specified, it will be set to <code>energy_usage ÷ 30</code> automatically. | When using an electric energy source and <code>drain</code> is not specified, it will be set to <code>energy_usage ÷ 30</code> automatically. | ||
{{Prototype property|animation|[[Types/Animation4Way|Animation4Way]]}} | |||
The animation played when crafting. When the crafting machine is idle, the animation will be paused. | The animation played when crafting. When the crafting machine is idle, the animation will be paused. | ||
When a crafting machine cannot be rotated (see [[#Basics]]), only the north rotation of the animation will be used. | When a crafting machine cannot be rotated (see [[#Basics]]), only the north rotation of the animation will be used. | ||
{{Prototype property|idle_animation|[[Types/Animation4Way|Animation4Way]]}} | |||
The animation played when idle. Idle animation must have the same frame count as animation. | The animation played when idle. Idle animation must have the same frame count as animation. | ||
Line 62: | Line 48: | ||
== Optional properties == | == Optional properties == | ||
{{Prototype property|fluid_boxes|[[Types/table|table]] of [[Types/FluidBox|FluidBox]]|optional=true}} | |||
Can have off_when_no_fluid_recipe key that has a [[Types/bool|bool]] value. off_when_no_fluid_recipe defaults to false. | |||
Can have off_when_no_fluid_recipe key that has a [[Types/bool]] value. off_when_no_fluid_recipe defaults to false. | |||
If a crafting machine has fluid boxes ''and'' off_when_no_fluid_recipe is true, the crafting machine can only be rotated when a recipe consuming or producing fluid is set, or it has one of the other properties listed in [[#Basics]]. | If a crafting machine has fluid boxes ''and'' off_when_no_fluid_recipe is true, the crafting machine can only be rotated when a recipe consuming or producing fluid is set, or it has one of the other properties listed in [[#Basics]]. | ||
Line 92: | Line 76: | ||
},</syntaxhighlight> | },</syntaxhighlight> | ||
{{Prototype property|allowed_effects|[[Types/EffectTypeLimitation|EffectTypeLimitation]]|optional=true}} | |||
Sets the module effects that are allowed to be used on this machine. | Sets the module effects that are allowed to be used on this machine. | ||
{{Prototype property|has_backer_name|[[Types/bool|bool]]|false|optional=true}} | |||
Whether this machine automatically gets assigned a random name from the list of Factorio backers when it is placed. | |||
{{Prototype property|scale_entity_info_icon|[[Types/bool|bool]]|false|optional=true}} | |||
Whether the "alt-mode icon" should be scaled to the size of the machine. | |||
{{Prototype property|show_recipe_icon|[[Types/bool|bool]]|true|optional=true}} | |||
Whether the "alt-mode icon" should be drawn at all. | |||
{{Prototype property|always_draw_idle_animation|[[Types/bool|bool]]|false|optional=true}} | |||
= | |||
{{Prototype property|return_ingredients_on_change|[[Types/bool|bool]]|false|optional=true}} | |||
Controls whether the ingredients of an in-progress recipe are destroyed when mining the machine/changing the recipe. If set to true, the ingredients do not get destroyed. This affects only the ingredients of the recipe that is currently in progress, so those that visually have already been consumed while their resulting product has not yet been produced. | Controls whether the ingredients of an in-progress recipe are destroyed when mining the machine/changing the recipe. If set to true, the ingredients do not get destroyed. This affects only the ingredients of the recipe that is currently in progress, so those that visually have already been consumed while their resulting product has not yet been produced. | ||
{{Prototype property|entity_info_icon_shift|[[Types/vector|vector]]|<nowiki>{0, -0.3}</nowiki> for [[Prototype/AssemblingMachine]] and <nowiki>{0, -0.1}</nowiki> for [[Prototype/Furnace]]|optional=true}} | |||
Shift of the "alt-mode icon" relative to the machine's center. | |||
{{Prototype property|draw_entity_info_icon_background|[[Types/bool|bool]]|true|optional=true}} | |||
Whether the "alt-mode icon" should have a black background. | |||
Whether the "alt-mode icon" should have | |||
{{Prototype property|base_productivity|[[Types/float|float]]|0|optional=true}} | |||
Productivity bonus that this machine always has. | Productivity bonus that this machine always has. | ||
{{Prototype property|module_specification|[[Types/ModuleSpecification|ModuleSpecification]]|optional=true}} | |||
The number of module slots in this machine, and their icon positions. | The number of module slots in this machine, and their icon positions. | ||
Line 156: | Line 113: | ||
},</syntaxhighlight> | },</syntaxhighlight> | ||
{{Prototype property|working_visualisations|[[Types/table|table]] of [[Types/WorkingVisualisation|WorkingVisualisation]]|optional=true}} | |||
Revision as of 19:54, 29 July 2019
Template:Prototype parent The abstract basis of the assembling machines and furnaces. Contains the properties that both of them have.
Note that a crafting machine cannot be rotated unless it has at least one of the following: a fluid box, a heat energy source, a fluid energy source, or a non-square collision box.
Extensions
- Prototype/AssemblingMachine assembling-machine
- Prototype/RocketSilo rocket-silo
- Prototype/Furnace furnace
Mandatory properties
This prototype inherits all the properties from Prototype/EntityWithHealth.
Template:Prototype property Sets how much energy this machine uses while crafting. Energy usage has to be positive.
Template:Prototype property How fast this crafting machine can craft. 1 means that for example a 1 second long recipe take 1 second to craft. 0.5 means it takes 2 seconds, and 2 means it takes 0.5 seconds.
Crafting speed has to be positive.
Template:Prototype property A list of recipe categories this crafting machine can use.
Example:
crafting_categories = {"crafting", "smelting"}
Template:Prototype property Defines how the crafting machine is powered.
When using an electric energy source and drain
is not specified, it will be set to energy_usage ÷ 30
automatically.
Template:Prototype property The animation played when crafting. When the crafting machine is idle, the animation will be paused.
When a crafting machine cannot be rotated (see #Basics), only the north rotation of the animation will be used.
Template:Prototype property The animation played when idle. Idle animation must have the same frame count as animation.
When a crafting machine cannot be rotated (see #Basics), only the north rotation of the idle animation will be used.
Optional properties
Template:Prototype property Can have off_when_no_fluid_recipe key that has a bool value. off_when_no_fluid_recipe defaults to false.
If a crafting machine has fluid boxes and off_when_no_fluid_recipe is true, the crafting machine can only be rotated when a recipe consuming or producing fluid is set, or it has one of the other properties listed in #Basics.
fluid_boxes =
{
{
production_type = "input",
pipe_picture = assembler2pipepictures(),
pipe_covers = pipecoverspictures(),
base_area = 10,
base_level = -1,
pipe_connections = {{ type="input", position = {0, -2} }},
secondary_draw_orders = { north = -1 }
},
{
production_type = "output",
pipe_picture = assembler2pipepictures(),
pipe_covers = pipecoverspictures(),
base_area = 10,
base_level = 1,
pipe_connections = {{ type="output", position = {0, 2} }},
secondary_draw_orders = { north = -1 }
},
off_when_no_fluid_recipe = true
},
Template:Prototype property Sets the module effects that are allowed to be used on this machine.
Template:Prototype property Whether this machine automatically gets assigned a random name from the list of Factorio backers when it is placed.
Template:Prototype property Whether the "alt-mode icon" should be scaled to the size of the machine.
Template:Prototype property Whether the "alt-mode icon" should be drawn at all.
Template:Prototype property Controls whether the ingredients of an in-progress recipe are destroyed when mining the machine/changing the recipe. If set to true, the ingredients do not get destroyed. This affects only the ingredients of the recipe that is currently in progress, so those that visually have already been consumed while their resulting product has not yet been produced.
Template:Prototype property Shift of the "alt-mode icon" relative to the machine's center.
Template:Prototype property Whether the "alt-mode icon" should have a black background.
Template:Prototype property Productivity bonus that this machine always has.
Template:Prototype property The number of module slots in this machine, and their icon positions.
module_specification = {
module_info_icon_shift = {
0,
0.8
},
module_slots = 2
},