Prototype/CraftingMachine: Difference between revisions
m (.animation and .idle_animation are ignored by prototype/rocketsilo) |
(animation and idle animation are optional) |
||
Line 36: | Line 36: | ||
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]]}} | == Optional properties == | ||
{{Prototype property|animation|[[Types/Animation4Way|Animation4Way]]|optional=true}} | |||
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, only the north rotation of the animation will be used. | When a crafting machine cannot be rotated, only the north rotation of the animation will be used. | ||
{{Prototype property|idle_animation|[[Types/Animation4Way|Animation4Way]]|optional=true}} | |||
{{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. | ||
When a crafting machine cannot be rotated, only the north rotation of the idle animation will be used. | When a crafting machine cannot be rotated, only the north rotation of the idle animation will be used. | ||
{{Prototype property|fluid_boxes|[[Types/table|table]] of [[Types/FluidBox|FluidBox]]|optional=true}} | {{Prototype property|fluid_boxes|[[Types/table|table]] of [[Types/FluidBox|FluidBox]]|optional=true}} |
Revision as of 16:17, 25 November 2019
Prototype definitions » PrototypeBase » Prototype/Entity » Prototype/EntityWithHealth » Prototype/EntityWithOwner » Prototype/CraftingMachine
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. Crafting machines with non-square collision boxes can only be rotated before placement, not after.
Extensions
- Prototype/AssemblingMachine assembling-machine
- Prototype/RocketSilo rocket-silo
- Prototype/Furnace furnace
Mandatory properties
This prototype inherits all the properties from Prototype/EntityWithHealth.
energy_usage
Type: Energy
Sets how much energy this machine uses while crafting. Energy usage has to be positive.
crafting_speed
Type: 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: table of strings
A list of recipe categories this crafting machine can use.
Example:
crafting_categories = {"crafting", "smelting"}
energy_source
Type: EnergySource
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.
Optional properties
animation
Type: Animation4Way
The animation played when crafting. When the crafting machine is idle, the animation will be paused.
When a crafting machine cannot be rotated, only the north rotation of the animation will be used.
idle_animation
Type: Animation4Way
The animation played when idle. Idle animation must have the same frame count as animation.
When a crafting machine cannot be rotated, only the north rotation of the idle animation will be used.
fluid_boxes
Type: table of FluidBox
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
},
allowed_effects
Type: EffectTypeLimitation
Sets the module effects that are allowed to be used on this machine.
has_backer_name
Type: bool
Default: false
Whether this machine automatically gets assigned a random name from the list of Factorio backers when it is placed.
scale_entity_info_icon
Type: bool
Default: false
Whether the "alt-mode icon" should be scaled to the size of the machine.
show_recipe_icon
Type: bool
Default: true
Whether the "alt-mode icon" should be drawn at all.
always_draw_idle_animation
Type: bool
Default: false
default_recipe_tint
crafting_machine_tint = { primary = {r=1,g=1,b=1,a=1}, secondary = {r=1,g=1,b=1,a=1}, tertiary = {r=1,g=1,b=1,a=1}, quaternary = {r=1,g=1,b=1,a=1}}
Each key/value pair is optional and defaults to the above value.
return_ingredients_on_change
Type: bool
Default: false
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.
entity_info_icon_shift
Type: vector
Default: {0, -0.3} for Prototype/AssemblingMachine and {0, -0.1} for Prototype/Furnace
Shift of the "alt-mode icon" relative to the machine's center.
draw_entity_info_icon_background
Type: bool
Default: true
Whether the "alt-mode icon" should have a black background.
match_animation_speed_to_activity
Type: bool
Default: false
Whether the speed of the animation and working visualization should be based on the machine's speed (boosted or slowed by modules).
base_productivity
Type: float
Default: 0
Productivity bonus that this machine always has.
module_specification
Type: 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: table of WorkingVisualisation