Prototype/CraftingMachine: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(added fluid_boxes)
(Removed old prototype docs)
Tag: Replaced
 
(45 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Basics ==
<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/CraftingMachinePrototype.html https://lua-api.factorio.com/latest/prototypes/CraftingMachinePrototype.html]
The abstract basis of the assembling machines and furnaces. Contains the properties that both of them have.


== Mandatory properties ==
</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>
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].
 
=== animation ===
'''Type''': [[Types/Animation]]
 
The animation played when crafting. When the crafting machine is idle, the animation will be paused.
 
=== crafting_categories ===
'''Type''': [[Types/table]] of [[Types/string]]s
 
A list of [[Prototype/RecipeCategory|recipe categories]] this crafting machine can use.
 
Example:
<pre>
crafting_categories = {"crafting", "smelting"}
</pre>
 
=== crafting_speed ===
'''Type''': [[Types/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.
 
=== energy_source ===
'''Type''': [[Types/EnergySource]]
 
Defines how the crafting machine is powered.
 
=== energy_usage ===
'''Type''': [[Types/EnergyPower]]
 
Sets how much energy this machine uses while crafting.
 
== Optional properties ==
 
=== module_specification ===
'''Type''': [[Types/ModuleSpecification]]
 
The number of module slots in this machine, and their icon positions.
 
<syntaxhighlight lang="lua">module_specification = {
  module_info_icon_shift = {
    0,
    0.8
  },
  module_slots = 2
},</syntaxhighlight>
 
=== allowed_effects ===
'''Type''': [[Types/AllowedEffects]]
 
Sets the module effects that are allowed to be used on this machine.
 
=== fluid_boxes ===
'''Type''': [[Types/table]] of [[Types/FluidBox]]
 
Can have off_when_no_fluid_recipe key that has a [[Types/bool]] value.
 
<syntaxhighlight lang="lua">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
    },</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/CraftingMachinePrototype.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.