Commonly used conventions for passing data between mods and Factorio
show_controller_gui :: boolean [RW] | Show the controller GUI elements. |
show_minimap :: boolean [RW] | Show the chart in the upper right-hand corner of the screen. |
show_research_info :: boolean [RW] | Show research progress and name in the upper right-hand corner of the screen. |
show_entity_info :: boolean [RW] | Show overlay icons on entities. |
show_alert_gui :: boolean [RW] | Show the flashing alert icons next to the player's toolbar. |
update_entity_selection :: boolean [RW] |
When true (the default), mousing over an entity will select it. |
show_rail_block_visualisation :: boolean [RW] |
When true (false is default), the rails will always show the rail block visualisation. |
show_side_menu :: boolean [RW] | Shows or hides the buttons row. |
show_map_view_options :: boolean [RW] | Shows or hides the view options when map is opened. |
show_quickbar :: boolean [RW] | Shows or hides quickbar of shortcuts. |
show_shortcut_bar :: boolean [RW] | Shows or hides the shortcut bar. |
tier_from_start :: double [RW] | |
roughness :: double [RW] | |
elevation :: double [RW] | |
available_water :: double [RW] | |
temperature :: double [RW] |
Localised strings are a way to support translation of in-game text. It is an array where the first element is the key and the remaining elements are parameters that will be substituted for placeholders in the template designated by the key.
The key identifies the string template. For example, "gui-alert-tooltip.attack"
(for the template "__1__
objects are being damaged"
; see the file data/core/locale/en.cfg
).
The template can contain placeholders such as __1__
or __2__
. These will be replaced by the respective
parameter in the LocalisedString. The parameters themselves can be other localised strings, which will be
processed recursively in the same fashion.
As a special case, when the key is just the empty string, all the parameters will be concatenated (after processing, if any are localised strings). If there is only one parameter, it will be used as is.
Furthermore, when an API function expects a localised string, it will also accept a regular string (i.e. not a table) which will not be translated, or number which will be converted to its textual representation.
"No ammo"
; in the Czech translation, it will print "Bez munice"
:
game.player.print({"description.no-ammo"})
description.no-ammo
template contains no placeholders, so no further parameters are necessary.
"Durability: 5/9"
; in the Japanese one, it will print
"耐久度: 5/9"
:
game.player.print({"description.durability", 5, 9})
"hello"
in all translations:
game.player.print({"", "hello"})
"Iron plate: 60"
in the English translation and "Eisenplatte: 60"
in the German translation.
game.print({"", {"item-name.iron-plate"}, ": ", 60})
Coordinates of a tile in a map.
Positions may be specified either as a dictionary with x
, y
as keys,
or simply as an array with two elements.
{10, 20}
{x = 50, y = 20}
{y = 20, x = 50}
Coordinates of a chunk in a LuaSurface where each integer x/y represents a different chunk. This uses the same format as Position. You can translate a Position to a chunk position by dividing the x/y values by 32.
Coordinates of a tile in a chunk on a LuaSurface where each integer x/y represents a different tile. This uses the same format as Position except it rounds any x/y down to whole numbers.
A ChunkPosition with an added bounding box for the area of the chunk.
Table with the following fields:
Members:
name
takes precedence over names
.names
is always populated.
A dictionary of string to the 4 basic Lua types: string, boolean, number, table.
{a = 1, b = true, c = "three", d = {e = "f"}}
A table:
A vector is a two-element array containing the x and y components. Unlike Positions, vectors don't use the
x
, y
keys.
right = {1.0, 0.0}
Two positions, specifying the top-left and bottom-right corner of the box, respectively. Like with Position, the names of the members may be omitted. When read from the game, the third member "orientation" is present if it is non-zero, however it is ignored when provided to the game.
Members:
{left_top = {-2, -3}, right_bottom = {5, 8}}
{{-2, -3}, {5, 8}}
An area defined using the map editor.
Members:
Red, green, blue and alpha values, all in range [0, 1] or all in range [0, 255] if any value is > 1. All values here are optional; color channels default to 0, the alpha channel defaults to 1. Similar to Position, Color allows the short-hand notation of passing an array of exactly 3 or 4 numbers. The game usually expects colors to be in pre-multiplied form (color channels are pre-multiplied by alpha).
Members:
red1 = {r = 0.5, g = 0, b = 0, a = 0.5} -- Half-opacity red
red2 = {r = 0.5, a = 0.5} -- Same color as red1
black = {} -- All channels omitted: black
red1_short = {0.5, 0, 0, 0.5} -- Same color as red1 in short-hand notation
Same as Color, but red, green, blue and alpha values can be any floating point number, without any special handling o range [1, 255].
Parameters that affect the look and control of the game. Updating any of the member attributes here will immediately take effect in the game engine.
Show the controller GUI elements. This includes the toolbar, the selected tool slot, the armour slot, and the gun and ammunition slots.
Show the chart in the upper right-hand corner of the screen.
Show research progress and name in the upper right-hand corner of the screen.
Show overlay icons on entities. Also known as "alt-mode".
Show the flashing alert icons next to the player's toolbar.
When true
(the default), mousing over an entity will select it. Otherwise, moving the mouse won't update
entity selection.
When true
(false is default), the rails will always show the rail block visualisation.
Shows or hides the view options when map is opened.
Shows or hides quickbar of shortcuts.
Shows or hides the shortcut bar.
What is shown in the map view. If a field is not given, that setting will not be changed.
Various game-related settings. See data/base/prototypes/map-settings.lua
for a description
of all attributes. Updating any of the attributes will immediately take effect in the game engine.
game.map_settings.path_finder.short_cache_size = 15
Technology and recipe difficulty settings.
The data that can be extracted from a map exchange string, as a plain table.
Table with the following fields:
Fluid is represented as a table
An ingredient is a table
"item"
or "fluid"
.
Table with the following fields:
"item"
or "fluid"
.amount_min
,
amount_max
and probability
must all be specified.amount
is specified.amount
is specified.
{{type="item", name="steel-chest", amount=1}}
{{type="fluid", name="heavy-oil", amount=1},
{type="fluid", name="light-oil", amount=4.5},
{type="fluid", name="petroleum-gas", amount=5.5}}
{{type=0, name="custom-item", probability=0.5, amount_min=1, amount_max=5}}
Loot is an array of loot items. Each loot item is a table:
The effect that is applied when a technology is researched. It is a table that contains at least the field
type
. A modifier may also have other fields depending on the type.
"inserter-stack-size-bonus"
, "stack-inserter-capacity-bonus"
, "laboratory-speed"
,
"character-logistic-trash-slots"
, "maximum-following-robots-count"
, "worker-robot-speed"
,
"worker-robot-storage"
, "ghost-time-to-live"
, "turret-attack"
, "ammo-damage"
, "give-item"
, "gun-speed"
,
"unlock-recipe"
, "character-crafting-speed"
, "character-mining-speed"
, "character-running-speed"
,
"character-build-distance"
, "character-item-drop-distance"
, "character-reach-distance"
, "character-resource-reach-distance"
,
"character-item-pickup-distance"
, "character-loot-pickup-distance"
, "character-inventory-slots-bonus"
,
"deconstruction-time-to-live"
, "max-failed-attempts-per-tick-per-construction-queue"
,
"max-successful-attempts-per-tick-per-construction-queue"
, "character-health-bonus"
,
"mining-drill-productivity-bonus"
, "train-braking-force-bonus"
, "zoom-to-world-enabled"
,
"zoom-to-world-ghost-building-enabled"
, "zoom-to-world-blueprint-enabled"
, "zoom-to-world-deconstruction-planner-enabled"
,
"zoom-to-world-upgrade-planner-enabled"
, "zoom-to-world-selection-tool-enabled"
, "worker-robot-battery"
,
"laboratory-productivity"
, "follower-robot-lifetime"
, "artillery-range"
, "nothing"
,
"character-additional-mining-categories"
, "character-logistic-requests"
.type
"gun-speed"
"give-item"
"turret-attack"
"unlock-recipe"
"nothing"
A single offer on a market entity.
Table with the following fields:"give-item"
modifier.
Specifies how probability and richness are calculated when placing something on the map.
Can be specified either using probability_expression
and richness_expression
or by using all the other fields.
Table with the following fields:
d
is the dimension name; this attribute may occur multiple times, once for each
dimension, every time with a different prefix.d
is the dimension name.d
is the dimension name.d
is the dimension name.
A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain generation. These can only be meaningfully written/modified during the data load phase. More detailed information is in the wiki.
Table with the following fields:
A floating point number specifying an amount. For backwards compatibility, MapGenSizes can also be specified as one of the following strings, which will be converted to a number (when queried, a number will always be returned):
"none"
- equivalent to 0"very-low"
, "very-small"
, "very-poor"
- equivalent to 1/2"low"
, "small"
, "poor"
- equivalent to 1/sqrt(2)"normal"
, "medium"
, "regular"
- equivalent to 1"high"
, "big"
, "good"
- equivalent to sqrt(2)"very-high"
, "very-big"
, "very-good"
- equivalent to 2
Table with the following fields:
Table with the following fields:
Table with the following fields:
terrain_segmentation
increases the scale of elevation features (lakes, continents, etc).
This behavior can be overridden with alternate elevation generators (see property_expression_names
, below).property_expression_names
, below)."terrain"
,
then scale is shown in the map generator GUI instead of frequency.game.autoplace_control_prototypes[(control prototype name)]
,
e.g. game.autoplace_control_prototypes["enemy-base"].richness
is false, because enemy base autoplacement doesn't use richness."entity"
"tile"
"decorative"
"5"
).
All other controls can be overridden by a property expression names.
Notable properties: moisture
- a value between 0 and 1 that determines whether a tile becomes sandy (low moisture) or grassy (high moisture).aux
- a value between 0 and 1 that determines whether low-moisture tiles become sand or red desert.temperature
- provides a value (vaguely representing degrees Celsius, varying between -20 and 50) that is used
(together with moisture and aux) as part of tree and decorative placement.elevation
- tiles values less than zero become water. Cliffs are placed along certain contours according to CliffPlacementSettings.cliffiness
- determines whether (when >0.5) or not (when <0.5) a cliff will be placed at an otherwise suitable (according to CliffPlacementSettings) location.enemy-base-intensity
- a number that is referenced by both enemy-base-frequency
and enemy-base-radius
.
i.e. if this is overridden, enemy base frequency and size will both be affected and do something reasonable.
By default, this expression returns a value proportional to distance from any starting point, clamped at about 7.enemy-base-frequency
- a number representing average number of enemy bases per tile for a region, by default in terms of enemy-base-intensity
.enemy-base-radius
- a number representing the radius of an enemy base, if one were to be placed on the given tile, by default proportional to
a constant plus enemy-base-intensity
.control-setting:moisture:frequency:multiplier
- frequency (inverse of scale) multiplier for moisture noise. Default is 1.control-setting:moisture:bias
- global bias for moisture (which normally varies between 0 and 1). Default is 0.control-setting:aux:frequency:multiplier
- frequency (inverse of scale) multiplier for aux (called 'terrain type' in the GUI) noise. Default is 1.control-setting:aux:bias
- global bias for aux/terrain type (which normally varies between 0 and 1). Default is 0.{tile|entity|decorative}:(prototype name):{probability|richness}
. The 'map type' dropdown in the map generation GUI is actually a selector for elevation generator.
The base game sets property_expression_names.elevation
to "0_16-elevation"
to reproduce terrain from 0.16 or to "0_17-island"
for the island preset.
If generators are available for other properties, the 'map type' dropdown in the GUI will be renamed
to 'elevation' and shown along with selectors for the other selectable properties.
local surface = game.player.surface
local mgs = surface.map_gen_settings
mgs.property_expression_names["tile:grass1:probability"] = "my-alternate-grass1-probability"
surface.map_gen_settings = mgs
local surface = game.player.surface
local mgs = surface.map_gen_settings
mgs.property_expression_names["tile:deepwater:probability"] = -1000
surface.map_gen_settings = mgs
"123"
) are understood
to stand for constant value expressions.
A single filter used by an infinity-pipe type entity.
Table with the following fields:"at-least"
, "at-most"
, or "exactly"
A definition of a fluidbox connection point.
Table with the following fields:
Table with the following fields:
first_constant
.second_constant
.first_signal
is set. Defaults to 0
.second_signal
is set. Defaults to 0
."*"
, "/"
, "+"
, "-"
, "%"
, "^"
, "<<"
, ">>"
, "AND"
, "OR"
, "XOR"
. When not specified,
defaults to "*"
.
A string, one of: "<"
, ">"
, "="
, "≥"
, "≤"
, "≠"
Table with the following fields:
constant
.0
."<"
.true
. When false
, will output a value of 1
for
the given output_signal
.
Table with the following fields:
"<"
.first_signal
to. If not specified, first_signal
will be compared to constant
.first_signal
to. Has no effect when second_signal
is set.
When neither second_signal
nor constant
are specified, the effect is as though constant
were specified
with the value 0
.
Table with the following fields:
Table with the following fields:
A table - the parameters required to raise a given game event. See the event being raised for what parameters are required.
An item stack may be specified either as a string (in which case it represents a full stack containing the specified item), or as the following table:
1
.1.0
.
{name="iron-plate"}
{name="iron-plate", count=1}
{name="copper-plate", count=47}
"iron-plate"
{name="iron-plate", count=100}
Commands can be given to enemies and unit groups. It is a table:
type
defines.distraction.by_enemy
.defines.distraction.by_enemy
.defines.distraction.by_enemy
.defines.distraction.by_enemy
.defines.distraction.by_enemy
.wander_in_group
is true
.true
, the units in the group will wander around inside the group's radius, just like gathering biters.
When false
, the units will wander as a group, ie they will all walk together in the same random direction.
Default is true for groups. Passing true for a single unit is an error.defines.distraction.by_enemy
.defines.distraction.by_enemy
.defines.distraction.by_enemy
.false
, they will obey and not build a base in a non-candidate chunk. Defaults to false
.
Table with the following fields:
A fluid may be specified in one of the following ways.
A technology may be specified in one of three ways.
A surface may be specified in one of three ways.
nauvis
has index 1
, the first surface-created
surface will have index 2
and so on."nauvis"
.
An entity prototype may be specified in one of the following ways.
An item prototype may be specified in one of the following ways.
Table with the following fields:
"time"
, "inactivity"
, "full"
, "empty"
, "item_count"
, "circuit"
, "robots_inactive"
, "fluid_count"
, "passenger_present"
, "passenger_not_present"
."and"
, or "or"
. Tells how this condition is to be compared with
the preceding conditions in the corresponding wait_conditions
array.type
is "time"
or "inactivity"
.type
is "item_count"
, "circuit"
or "fluid_count"
.
Table with the following fields:
station
is present.
Table with the following fields:
Used for specifying where a GUI arrow should point to. It is a table:
"nowhere"
(will remove the arrow entirely), "goal"
(will point to the current goal), "entity_info"
, "active_window"
,
"entity"
, "position"
, "crafting_queue"
or "item_stack"
(will point to a given item stack in an
inventory). Depending on this value, other fields may have to be specified.type
"entity"
"position"
"crafting_queue"
"item_stack"
"player"
, "target"
, "player-quickbar"
or "player-equipment-bar"
.
Table with the following fields:
"entity"
(fires at an entity), "position"
(fires directly at a position),
or "direction"
(fires in a direction).true
, the gun will be able to shoot even when the target is out of range. Only applies when
target_type
is position
. The gun will fire at the maximum range in the direction of the target position.
Defaults to false
.0
.
It is a table with two fields:
Table with the following fields:
It is specified by string. It can be either the name of a sprite prototype defined in the data phase or a path in form "type/name". Supported types are.
"item"
- for example "item/iron-plate" is the icon sprite of iron plate"entity"
- for example "entity/small-biter" is the icon sprite of the small biter"technology"
"recipe"
"item-group"
"fluid"
"tile"
"virtual-signal"
"achievement"
"equipment"
"file"
- path to an image file located inside the current scenario. This file is not preloaded so it will be slower; for frequently used sprites, it is better to define sprite prototype and use it instead."utility"
- sprite defined in the utility-sprites object, these are the pictures used by the game internally for the UI.
A sound specification defined by a string. It can be either the name of a sound prototype defined in the data phase or a path in the form "type/name". Supported types are.
"utility"
- a sound defined in the utility-sounds object, for example "utility/wire_connect_pole""ambient"
- a sound defined using the "ambient-sound" type, for example "ambient/resource-deficiency""tile-walking"
- for example "tile-walking/concrete""tile-build"
"tile-mined"
"entity-build"
- for example "entity-build/wooden-chest""entity-mined"
"entity-mining"
"entity-vehicle_impact"
"rotated"
"entity-open"
"entity-close"
Table with the following fields:
Table with the following fields:
0.6
means 60% increase.
This is a mapping of effect name to effect values given as a dictionary string → EffectValue.
{consumption={bonus=0.6},
speed={bonus=-0.15},
productivity={bonus=0.06},
pollution={bonus=0.075}}
This is a set of flags given as a dictionary string → boolean. When a flag is set, it is present
in the dictionary with the value true
. Unset flags aren't present in the dictionary at all.
So, the boolean value is meaningless and exists just for easy table lookup if a flag is set.
Possible flags are:
"not-rotatable"
"placeable-neutral"
"placeable-player"
"placeable-enemy"
"placeable-off-grid"
"player-creation"
"building-direction-8-way"
"filter-directions"
"fast-replaceable-no-build-while-moving"
"breaths-air"
"not-repairable"
"not-on-map"
"not-deconstructable"
"not-blueprintable"
"hidden"
"hide-alt-info"
"fast-replaceable-no-cross-type-while-moving"
"no-gap-fill-while-building"
"not-flammable"
"no-automated-item-removal"
"no-automated-item-insertion"
"no-copy-paste"
"not-selectable-in-game"
"not-upgradable"
This is a set of flags given as dictionary string → boolean. When a flag is set, it is present
in the dictionary with the value true
. Unset flags aren't present in the dictionary at all.
So, the boolean value is meaningless and exists just for easy table lookup if a flag is set.
Possible flags are:
"draw-logistic-overlay"
"hidden"
"always-show"
"hide-from-bonus-gui"
"hide-from-fuel-tooltip"
"not-stackable"
"can-extend-inventory"
"primary-place-result"
"mod-openable"
"only-in-cursor"
A string specifying a collision mask layer.
Possible values for the string are:
"ground-tile"
"water-tile"
"resource-layer"
"doodad-layer"
"floor-layer"
"item-layer"
"ghost-layer"
"object-layer"
"player-layer"
"train-layer"
"rail-layer"
"transport-belt-layer"
"not-setup"
Additionally the values "layer-13"
through "layer-55"
. These layers are currently unused by the game but may change.
If a mod is going to use one of the unused layers it's recommended to start at the higher layers because the base game will take from the lower ones.
This is a set of masks given as a dictionary CollisionMaskLayer → boolean. Only set masks are present in the
dictionary and they have the value true
. Unset flags aren't present at all.
A CollisionMask but also includes any flags this mask has. Flags such as:
"not-colliding-with-itself"
"consider-tile-transitions"
"colliding-with-tiles-only"
Table with the following fields:
"damage"
, "create-entity"
, "create-explosion"
, "create-fire"
, "create-smoke"
, "create-trivial-smoke"
, "create-particle"
,
"create-sticker"
, "nested-result"
, "play-sound"
, "push-back"
, "destroy-cliffs"
, "show-explosion-on-chart"
, "insert-item"
, "script"
.
Table with the following fields:
"instant"
, "projectile"
, "flame-thrower"
, "beam"
, "stream"
, "artillery"
.
Table with the following fields:
"direct"
, "area"
, "line"
, "cluster"
."enemy"
, the trigger will only affect
entities whose force is different from the attacker's and for which there is no cease-fire set. "ally"
is the opposite of "enemy"
.
An array of TriggerItem
Table with the following fields:
1
is
the full circle).range
, the entity will choose a random distance between
range
and min_attack_distance
and attack from that distance. Used for spitters.
Table with the following fields:
"throw"
, "equipment-remote"
, "use-on-self"
.type
is "throw"
or "use-on-self"
.type
is "equipment-remote"
. It is the equipment
prototype name.
This is a set of flags given as a dictionary string → boolean. Set flags are present in the dictionary
with the value true
; unset flags aren't present at all.
Possible flags are:
"blueprint"
: Entities that can be selected for blueprint."deconstruct"
: Entities that can be marked for deconstruction."cancel-deconstruct"
: Entities that can be marked for deconstruction cancelling."items"
"trees"
"buildable-type"
: Buildable entities."nothing"
: Only select an area."items-to-place"
: Entities that can be placed using an item."any-entity"
"any-tile"
"same-force"
: Entities with the same force as the selector."not-same-force"
"friend"
"enemy"
"upgrade"
"cancel-upgrade"
"entity-with-health"
"entity-with-force"
"entity-with-owner"
Any basic type (string, number, boolean) plus tables.
A string that specifies where a gui element should be.
Possible values are:
"top-left"
"middle-left"
or just "left"
"bottom-left"
"top-center"
"middle-center"
or just "center"
"bottom-center"
"top-right"
"middle-right"
or just "right"
"bottom-right"
This is a set of flags given as a dictionary string → boolean. When a flag is set, it is present
in the dictionary with the value true
. Unset flags aren't present in the dictionary at all.
To write to this, use an array of string of the mouse buttons that should be possible to use with on button.
When setting flags, the flag "left-and-right"
can also be set, it will set "left"
and "right"
true.
Possible flags when reading are:
"left"
"right"
"middle"
"button-4"
"button-5"
"button-6"
"button-7"
"button-8"
"button-9"
It is specified by string.
"electricity"
"copy"
"not-allowed"
"pair"
"logistics"
"train-visualization"
It is specified by string.
"all"
- All forces pass."enemy"
- Forces which will attack pass."ally"
- Forces which won't attack pass."friend"
- Forces which are friends pass."not-friend"
- Forces which are not friends pass."same"
- The same force pass."not-same"
- The non-same forces pass.
A value between 0 and 255 inclusive represented by one of the following named string or string version of the value (for example "27"
and "decals"
are both valid).
Higher values are rendered on top of lower values.
"water-tile"
: 15"ground-tile"
: 25"tile-transition"
: 26"decals"
: 27"lower-radius-visualization"
: 29"radius-visualization"
: 30"transport-belt-integration"
: 65"resource"
:66"building-smoke"
:67"decorative"
: 92"ground-patch"
: 93"ground-patch-higher"
: 94"ground-patch-higher2"
: 95"remnants"
: 112"floor"
: 113"transport-belt"
: 114"transport-belt-endings"
: 115"floor-mechanics-under-corpse"
: 120"corpse"
: 121"floor-mechanics"
: 122"item"
: 123"lower-object"
: 124"transport-belt-circuit-connector"
: 126"lower-object-above-shadow"
: 127"object"
: 129"higher-object-under"
: 131"higher-object-above"
: 132"item-in-inserter-hand"
: 134"wires"
: 135"wires-above"
: 136"entity-info-icon"
: 138"entity-info-icon-above"
: 139"explosion"
: 142"projectile"
: 143"smoke"
: 144"air-object"
: 145"air-entity-info-icon"
: 147"light-effect"
: 148"selection-box"
: 187"higher-selection-box"
: 188"collision-selection-box"
: 189"arrow"
: 190"cursor"
: 210
"west-to-east"
"north-to-south"
"east-to-west"
"south-to-north"
"west-to-north"
"north-to-east"
"east-to-south"
"south-to-west"
"west-to-south"
"north-to-west"
"east-to-north"
"south-to-east"
"west-to-none"
"none-to-east"
"east-to-none"
"none-to-west"
"north-to-none"
"none-to-south"
"south-to-none"
"none-to-north"
"game-effect"
"gui-effect"
"ambient"
"environment"
"walking"
"alert"
"wind"
An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
"tool"
"mergeable"
"item-with-inventory"
"selection-tool"
"item-with-label"
"has-rocket-launch-products"
"fuel"
"place-result"
: Additional fields:"burnt-result"
: Additional fields:"place-as-tile"
: Additional fields:"placed-as-equipment-result"
: Additional fields:"name"
: Additional fields:
For use within nested filters such as the has-product-item
filter of RecipePrototypeFilters.
To get a specific prototype by name, see LuaGameScript::item_prototypes.
"type"
: Additional fields: game.get_filtered_item_prototypes({{filter = "type", type = "armor"}})
"flag"
: Additional fields:"subgroup"
: Additional fields:"fuel-category"
: Additional fields:"stack-size"
: Additional fields: game.get_filtered_item_prototypes({{filter = "stack-size", comparison = ">", value = 20}, {filter = "stack-size", comparison = "<", value = 100, mode = "and"}})
"default-request-amount"
: Additional fields:"wire-count"
: Additional fields:"fuel-value"
: Additional fields:"fuel-acceleration-multiplier"
: Additional fields:"fuel-top-speed-multiplier"
: Additional fields:"fuel-emissions-multiplier"
: Additional fields:An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
"enabled"
"hidden"
"upgrade"
"visible-when-disabled"
"has-effects"
"has-prerequisites"
"research-unit-ingredient"
: Additional fields:"level"
: Additional fields:"max-level"
: Additional fields:"time"
: Additional fields:An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
"decal"
"autoplace"
"collision-mask"
: Additional fields:"collides"
or "layers-equals"
An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
"allowed-without-fight"
"type"
: Additional fields:An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
"hidden"
"name"
: Additional fields:
For use within nested filters such as the has-product-fluid
filter of RecipePrototypeFilters.
To get a specific prototype by name, see LuaGameScript::fluid_prototypes.
"subgroup"
: Additional fields:"default-temperature"
: Additional fields:"max-temperature"
: Additional fields:"heat-capacity"
: Additional fields:"fuel-value"
: Additional fields:"emissions-multiplier"
: Additional fields:"gas-temperature"
: Additional fields:An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
"item-to-place"
"type"
: Additional fields:An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
"minable"
"autoplace"
"blueprintable"
"item-to-place"
"collision-mask"
: Additional fields:"collides"
or "layers-equals"
"walking-speed-modifier"
: Additional fields:"vehicle-friction-modifier"
: Additional fields:"decorative-removal-probability"
: Additional fields:"emissions"
: Additional fields:An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
"enabled"
"hidden"
"hidden-from-flow-stats"
"hidden-from-player-crafting"
"allow-as-intermediate"
"allow-intermediates"
"allow-decomposition"
"always-show-made-in"
"always-show-products"
"show-amount-in-title"
"has-ingredients"
"has-products"
"has-ingredient-item"
: Additional fields:"has-ingredient-fluid"
: Additional fields: -- selects recipes that consume sulfuric acid
{{filter = "has-ingredient-fluid", elem_filters = {{filter = "name", name = "sulfuric-acid"}}}}
"has-product-item"
: Additional fields: -- selects recipes that produce an item
{{filter = "has-product-item"}}
-- selects recipes that produce iron plates
{{filter = "has-product-item", elem_filters = {{filter = "name", name = "iron-plate"}}}}
-- selects recipes that produce items that place furnaces
{{filter = "has-product-item", elem_filters = {{filter = "place-result", elem_filters = {{filter = "type", type = "furnace"}}}}}}
"has-product-fluid"
: Additional fields:"subgroup"
: Additional fields:"category"
: Additional fields:"energy"
: Additional fields:"emissions-multiplier"
: Additional fields:"request-paste-multiplier"
: Additional fields:"overload-multiplier"
: Additional fields:An array of filters. Each filter is a table:
"or"
or "and"
.
Default is "or"
.false
. Depending on the value of filter
, the table may take additional fields. filter
may be one of the following:
"flying-robot"
"robot-with-logistics-interface"
"rail"
"ghost"
"explosion"
"vehicle"
"crafting-machine"
"rolling-stock"
"turret"
"transport-belt-connectable"
"wall-connectable"
"buildable"
"placable-in-editor"
"clonable"
"selectable"
"hidden"
"entity-with-health"
"building"
"fast-replaceable"
"uses-direction"
"minable"
"circuit-connectable"
"autoplace"
"blueprintable"
"item-to-place"
"name"
: Additional fields:
For use within nested filters such as the place-result
filter of ItemPrototypeFilters.
To get a specific prototype by name, see LuaGameScript::entity_prototypes.
"type"
: Additional fields: game.get_filtered_entity_prototypes({{filter = "type", type = "unit"}})
"collision-mask"
: Additional fields:"collides"
or "layers-equals"
game.get_filtered_entity_prototypes({{filter = "collision-mask", mask = "player-layer", mask_mode = "collides"}})
"flag"
: Additional fields: game.get_filtered_entity_prototypes({{filter = "flag", flag = "placeable-player"}, {filter = "flag", flag = "placeable-enemy", mode = "and"}})
"build-base-evolution-requirement"
: Additional fields:"selection-priority"
: Additional fields:"emissions"
: Additional fields:"crafting-category"
: Additional fields: