Prototype/CraftingMachine: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎Optional properties: working_visualisations)
(0.16)
Line 5: Line 5:
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].


=== animation ===
=== energy_usage ===
'''Type''': [[Types/Animation]]
'''Type''': [[Types/Energy]]
 
Sets how much energy this machine uses while crafting. Energy usage has to be positive.
 
=== 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.


The animation played when crafting. When the crafting machine is idle, the animation will be paused.
Crafting speed has to be positive.


=== crafting_categories ===
=== crafting_categories ===
Line 19: Line 26:
crafting_categories = {"crafting", "smelting"}
crafting_categories = {"crafting", "smelting"}
</pre>
</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 ===
=== energy_source ===
Line 30: Line 32:
Defines how the crafting machine is powered.
Defines how the crafting machine is powered.


=== energy_usage ===
=== animation ===
'''Type''': [[Types/EnergyPower]]
'''Type''': [[Types/Animation4Way]]


Sets how much energy this machine uses while crafting.
The animation played when crafting. When the crafting machine is idle, the animation will be paused.


== Optional properties ==
=== idle_animation ===
'''Type''': [[Types/Animation4Way]]


=== module_specification ===
The animation played when idle. Idle animation must have the same frame count as animation.
'''Type''': [[Types/ModuleSpecification]]


The number of module slots in this machine, and their icon positions.
== Optional properties ==
 
<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 ===
=== fluid_boxes ===
Line 82: Line 71:
       off_when_no_fluid_recipe = true
       off_when_no_fluid_recipe = true
     },</syntaxhighlight>
     },</syntaxhighlight>
=== allowed_effects ===
'''Type''': [[Types/EffectTypeLimitation]]
Sets the module effects that are allowed to be used on this machine.
=== has_backer_name ===
'''Type''': [[Types/bool]]
'''Default''': false
=== scale_entity_info_icon ===
'''Type''': [[Types/bool]]
'''Default''': false
=== always_draw_idle_animation ===
'''Type''': [[Types/bool]]
'''Default''': false
=== 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>


=== working_visualisations ===
=== working_visualisations ===
'''Type''': [[Types/table]] of [[Types/WorkingVisualisation]]

Revision as of 13:41, 20 May 2018

Basics

The abstract basis of the assembling machines and furnaces. Contains the properties that both of them have.

Mandatory properties

This prototype inherits all the properties from Prototype/EntityWithHealth.

energy_usage

Type: Types/Energy

Sets how much energy this machine uses while crafting. Energy usage has to be positive.

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.

Crafting speed has to be positive.

crafting_categories

Type: Types/table of Types/strings

A list of recipe categories this crafting machine can use.

Example:

crafting_categories = {"crafting", "smelting"}

energy_source

Type: Types/EnergySource

Defines how the crafting machine is powered.

animation

Type: Types/Animation4Way

The animation played when crafting. When the crafting machine is idle, the animation will be paused.

idle_animation

Type: Types/Animation4Way

The animation played when idle. Idle animation must have the same frame count as animation.

Optional properties

fluid_boxes

Type: Types/table of Types/FluidBox

Can have off_when_no_fluid_recipe key that has a Types/bool value.

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
    },

allowed_effects

Type: Types/EffectTypeLimitation

Sets the module effects that are allowed to be used on this machine.

has_backer_name

Type: Types/bool

Default: false

scale_entity_info_icon

Type: Types/bool

Default: false

always_draw_idle_animation

Type: Types/bool

Default: false

module_specification

Type: Types/ModuleSpecification

The number of module slots in this machine, and their icon positions.

module_specification = {
  module_info_icon_shift = {
    0,
    0.8
  },
  module_slots = 2
},

working_visualisations

Type: Types/table of Types/WorkingVisualisation