Factorio.com|Forums|Wiki|Mod Portal|API Docs Prototype|Runtime|Auxiliary

# Factorio Runtime Docs Version 2.0.7

## Concepts

Commonly used conventions for passing data between mods and Factorio.

MapTick | uint64 | `math.huge` represents the maximum possible tick.
`math.huge` represents the maximum possible tick.
ModuleEffectValue | float | The percentual increase of the attribute. [...]
The percentual increase of the attribute. [...]
ModuleEffects | table |
ComparatorString | union | A string that specifies how the inputs should be compared. [...]
A string that specifies how the inputs should be compared. [...]
SpritePath | string | It can be either the name of a SpritePrototype defined in the data stage, or a path in form "type/name" or "type.name". [...]
It can be either the name of a SpritePrototype defined in the data stage, or a path in form "type/name" or "type.name". [...]
CollisionMask | table |
ItemStackIndex | uint16 |
LogisticFilterIndex | uint16 |
ItemCountType | uint |
RollingStockDrawData | table |
EntitySearchFilters | table |
TileSearchFilters | table |
RailExtensionData | table |
TrainFilter | table |
TrainStopFilter | table |
TrainPathRequestType | union | A string specifying the type of request for LuaTrainManager::request_train_path.
A string specifying the type of request for LuaTrainManager::request_train_path.
TrainPathFinderGoal | union |
TrainStopGoal | table |
RailEndGoal | table |
RailEndStart | table |
TrainPathFinderOneGoalResult | table |
TrainPathAllGoalsResult | table |
DetailedItemOnLine | table |
PipeConnection | table | A single pipe connection for a given fluidbox.
A single pipe connection for a given fluidbox.
FluidBoxConnectionRecord | table |
EventFilter | array[union] | Used to filter out irrelevant event callbacks in a performant way. [...]
Used to filter out irrelevant event callbacks in a performant way. [...]
UndoRedoAction | table |
BlueprintWireEnd | table |
SoundType | union | Defines which slider in the game's sound settings affects the volume of this sound. [...]
Defines which slider in the game's sound settings affects the volume of this sound. [...]
ItemStackDefinition | table |
SelectionModeFlags | dictionary[union → `true`] | A set of flags on a selection tool that define how entities and tiles are selected. [...]
A set of flags on a selection tool that define how entities and tiles are selected. [...]
AmmoType | table |
ItemPrototypeFlags | dictionary[ItemPrototypeFlag → `true`] | A set of flags. [...]
A set of flags. [...]
ItemPrototypeFlag | union | A string specifying an item prototype flag.
A string specifying an item prototype flag.
PrototypeFilterMode | union |
PipeConnectionDefinition | table |
CollisionLayerID | string | The name of a LuaCollisionLayerPrototype.
The name of a LuaCollisionLayerPrototype.
ItemIDFilter | table |
EntityIDFilter | table |
PrototypeFilter | array[union] | Types `"signal"` and `"item-group"` do not support filters. [...]
Types `"signal"` and `"item-group"` do not support filters. [...]
DisplayPanelMessageDefinition | table |
SignalIDType | union |
LinkedGameControl | union | The internal name of a game control (key binding).
The internal name of a game control (key binding).
ResearchIngredient | table |
ModifierType | union | Used by TechnologyModifier.
Used by TechnologyModifier.
ResearchTrigger | table |
EntityPrototypeFlags | dictionary[EntityPrototypeFlag → `true`] | A set of flags. [...]
A set of flags. [...]
EntityPrototypeFlag | union | A string specifying an entity prototype flag.
A string specifying an entity prototype flag.
CustomEntityStatus | table |
ItemInventoryPositions | table |
InventoryPosition | table |
RadiusVisualisationSpecification | table |
ProgrammableSpeakerPlaybackMode | union | Specifies from where the programmable speaker's sound will be heard.
Specifies from where the programmable speaker's sound will be heard.
CliffOrientation | union |
BlueprintInsertPlan | table | Defines an item type that a blueprint entity will request.
Defines an item type that a blueprint entity will request.
MarketIngredient | table |
Offer | table | A single offer on a market entity.
A single offer on a market entity.
ItemFilter | table or string | An item filter may be specified in two ways, either as a string which is an item prototype name or as a table.
An item filter may be specified in two ways, either as a string which is an item prototype name or as a table.
ScheduleRecord | table |
GuiArrowSpecification | table | Used for specifying where a GUI arrow should point to.
Used for specifying where a GUI arrow should point to.
Vector3D | table or {float, float, float} | Reading this always returns the table with the named keys. [...]
Reading this always returns the table with the named keys. [...]
TrainSchedule | table |
PlatformSchedule | table |
EffectReceiver | table |
RecipeIDAndQualityIDPair | table | A recipe prototype with optional quality specification.
A recipe prototype with optional quality specification.
WorkerRobotOrder | table |
ForceID | union | A force may be specified in one of three ways.
A force may be specified in one of three ways.
FluidID | union | A fluid may be specified in one of three ways.
A fluid may be specified in one of three ways.
EntityWithQualityID | union | An entity prototype with optional quality specification. [...]
An entity prototype with optional quality specification. [...]
EntityIDAndQualityIDPair | table | An entity prototype with optional quality specification.
An entity prototype with optional quality specification.
ItemWithQualityID | union | An item prototype with optional quality specification. [...]
An item prototype with optional quality specification. [...]
ItemIDAndQualityIDPair | table | An item prototype with optional quality specification.
An item prototype with optional quality specification.
ItemID | union | An item prototype may be specified in one of four ways.
An item prototype may be specified in one of four ways.
EntityID | union | An entity prototype may be specified in one of three ways.
An entity prototype may be specified in one of three ways.
VirtualSignalID | union | A virtual signal prototype may be specified in one of two ways.
A virtual signal prototype may be specified in one of two ways.
TechnologyID | union | An technology prototype may be specified in one of three ways.
An technology prototype may be specified in one of three ways.
ParticleID | union | A particle prototype may be specified in one of two ways.
A particle prototype may be specified in one of two ways.
DamageTypeID | union | A damage type prototype may be specified in one of two ways.
A damage type prototype may be specified in one of two ways.
TrivialSmokeID | union | A trivial smoke prototype may be specified in one of two ways.
A trivial smoke prototype may be specified in one of two ways.
TextAlign | union | The text is aligned so that the target position is at the given side of the text. [...]
The text is aligned so that the target position is at the given side of the text. [...]
VerticalTextAlign | union | The text is aligned so that the target position is at the given side of the text. [...]
The text is aligned so that the target position is at the given side of the text. [...]
QualityID | union | A quality prototype may be specified in one of two ways.
A quality prototype may be specified in one of two ways.
RecipeID | union | A recipe may be specified in one of three ways.
A recipe may be specified in one of three ways.
TileID | union | A tile may be specified in one of three ways.
A tile may be specified in one of three ways.
Fluid | table |
EquipmentID | union | An equipment prototype may be specified in one of three ways.
An equipment prototype may be specified in one of three ways.
EquipmentWithQualityID | union | An equipment prototype with optional quality specification.
An equipment prototype with optional quality specification.
EquipmentIDAndQualityIDPair | table | An equipment prototype with optional quality specification.
An equipment prototype with optional quality specification.
BoundingBox | table or {MapPosition, MapPosition} | Two positions, specifying the top-left and bottom-right corner of the box respectively. [...]
Two positions, specifying the top-left and bottom-right corner of the box respectively. [...]
SpacePlatformIdentification | union | Space platform may be specified in one of one ways.
Space platform may be specified in one of one ways.
ForceSet | union | Set of forces. [...]
Set of forces. [...]
DecorativeID | union | A decorative prototype may be specified in one of two ways.
A decorative prototype may be specified in one of two ways.
AsteroidChunkID | union | An asteroid chunk prototype may be specified in one of two ways.
An asteroid chunk prototype may be specified in one of two ways.
SpaceLocationID | union | A space location prototype may be specified in one of two ways.
A space location prototype may be specified in one of two ways.
SignalFilter | table or string | A signal filter may be specified in two ways, either as a string which is a virtual signal name or item prototype name or as a table.
A signal filter may be specified in two ways, either as a string which is a virtual signal name or item prototype name or as a table.
LogisticFilter | table |
PrintSettings | table |
SurfacePropertyID | union | Surface property prototype may be specified in one of two ways.
Surface property prototype may be specified in one of two ways.
ScriptRenderTarget | LuaEntity or MapPosition or ScriptRenderTargetTable | When writing it is possible to give LuaEntity or MapPosition directly. [...]
When writing it is possible to give LuaEntity or MapPosition directly. [...]
ScriptRenderTargetTable | table |
QualityCondition | table or string | An item filter may be specified in two ways, either as a string which is a quality prototype name or as a table.
An item filter may be specified in two ways, either as a string which is a quality prototype name or as a table.
RangeMode | union |
BlueprintEntity | table | The representation of an entity inside of a blueprint. [...]
The representation of an entity inside of a blueprint. [...]
MathExpression | string | A string that represents a math expression. [...]
A string that represents a math expression. [...]
Product | union | Returns one of the subtypes, depending on the value of `type`.
Returns one of the subtypes, depending on the value of `type`.
ItemProduct | table |
FluidProduct | table |
ResearchProgressProduct | table |
LogisticSections | table |
CompiledLogisticFilter | table |
LogisticSection | table |
BlueprintLogisticFilter | table |
AutoplaceSpecification | table | Specifies how probability and richness are calculated when placing something on the map.
Specifies how probability and richness are calculated when placing something on the map.
CliffPlacementSettings | table |
AutoplaceSettings | table |
TerritorySettings | table |
MapGenSettings | table |
AsteroidMapSettings | table |
PollutionMapSettings | table | These values are for the time frame of one second (60 ticks).
These values are for the time frame of one second (60 ticks).
EnemyEvolutionMapSettings | table | These values represent a percentual increase in evolution. [...]
These values represent a percentual increase in evolution. [...]
EnemyExpansionMapSettings | table | Candidate chunks are given scores to determine which one of them should be expanded into. [...]
Candidate chunks are given scores to determine which one of them should be expanded into. [...]
SteeringMapSetting | table |
SteeringMapSettings | table |
UnitGroupMapSettings | table |
PathFinderMapSettings | table |
DifficultySettings | LuaStruct | Technology difficulty settings. [...]
Technology difficulty settings. [...]
MapDifficultySettings | table |
MapAndDifficultySettings | table | A standard table containing all MapSettings attributes plus an additional table that contains all DifficultySettings properties.
A standard table containing all MapSettings attributes plus an additional table that contains all DifficultySettings properties.
MapSettings | LuaStruct | Various game-related settings. [...]
Various game-related settings. [...]
BlueprintScheduleRecord | table |
BlueprintScheduleInterrupt | table |
BlueprintSchedule | table |
WaitCondition | table |
WaitConditionType | union | Type of a WaitCondition.
Type of a WaitCondition.
CursorBoxRenderType | union |
MapViewSettings | table | What is shown in the map view. [...]
What is shown in the map view. [...]
RenderLayer | union | A number between 0 and 255 inclusive, represented by one of the following named strings or the string version of the number. [...]
A number between 0 and 255 inclusive, represented by one of the following named strings or the string version of the number. [...]
BurnerUsageID | string | The name of a LuaBurnerUsagePrototype.
The name of a LuaBurnerUsagePrototype.
ElemType | union | A string specifying a type for choose elem buttons. [...]
A string specifying a type for choose elem buttons. [...]
SwitchState | union | State of a GUI switch.
State of a GUI switch.
ElemID | table |
TriggerEffectItemType | union | Used by TriggerEffectItem.
Used by TriggerEffectItem.
TriggerEffectItem | table |
TriggerTargetMask | dictionary[string → `true`] | A set of trigger target masks.
A set of trigger target masks.
TriggerItem | table |
TriggerDelivery | table |
DamageTypeFilters | table |
LocalisedString | string or number or boolean or LuaObject or nil or array[LocalisedString] | Localised strings are a way to support translation of in-game text. [...]
Localised strings are a way to support translation of in-game text. [...]
DisplayResolution | table |
RealOrientation | float | The smooth orientation. [...]
The smooth orientation. [...]
MapPosition | table or {double, double} | Coordinates on a surface, for example of an entity. [...]
Coordinates on a surface, for example of an entity. [...]
ChunkPosition | table or {int, int} | Coordinates of a chunk in a LuaSurface where each integer `x`/`y` represents a different chunk. [...]
Coordinates of a chunk in a LuaSurface where each integer `x`/`y` represents a different chunk. [...]
TilePosition | table or {int, int} | Coordinates of a tile on a LuaSurface where each integer `x`/`y` represents a different tile. [...]
Coordinates of a tile on a LuaSurface where each integer `x`/`y` represents a different tile. [...]
EquipmentPosition | table or {int, int} | Position inside an equipment grid. [...]
Position inside an equipment grid. [...]
GuiLocation | table or {int, int} | Screen coordinates of a GUI element in a LuaGui. [...]
Screen coordinates of a GUI element in a LuaGui. [...]
ChunkPositionAndArea | table | A ChunkPosition with an added bounding box for the area of the chunk.
A ChunkPosition with an added bounding box for the area of the chunk.
EquipmentPoint | table | A table used to define a manual shape for a piece of equipment.
A table used to define a manual shape for a piece of equipment.
GuiAnchor | table |
TabAndContent | table |
OldTileAndPosition | table |
Tags | dictionary[string → AnyBasic] | A dictionary of string to the four basic Lua types: `string`, `boolean`, `number`, `table`. [...]
A dictionary of string to the four basic Lua types: `string`, `boolean`, `number`, `table`. [...]
SurfaceCondition | table |
SmokeSource | table |
Vector | table or {float, float} | A vector is a two-element array or dictionary containing the `x` and `y` components. [...]
A vector is a two-element array or dictionary containing the `x` and `y` components. [...]
ScriptArea | table | An area defined using the map editor.
An area defined using the map editor.
ScriptPosition | table | A position defined using the map editor.
A position defined using the map editor.
Color | table or {float, float, float, float} | Red, green, blue and alpha values, all in range [0, 1] or all in range [0, 255] if any value is > 1. [...]
Red, green, blue and alpha values, all in range [0, 1] or all in range [0, 255] if any value is > 1. [...]
ColorModifier | table or {float, float, float, float} | Same as Color, but red, green, blue and alpha values can be any floating point number, without any special handling of the range [1, 255].
Same as Color, but red, green, blue and alpha values can be any floating point number, without any special handling of the range [1, 255].
CraftingQueueItem | table |
Alert | table |
PathfinderWaypoint | table |
CutsceneWaypoint | table |
Decorative | table |
DecorativeResult | table |
MineableProperties | table |
SpaceLocationAsteroidSpawnDefinition | table |
SpaceConnectionAsteroidSpawnPoint | table |
SpaceConnectionAsteroidSpawnDefinition | table |
AsteroidChunk | table |
PrototypeHistory | table |
ChartTagSpec | table | Either `icon`, `text`, or both must be provided.
Either `icon`, `text`, or both must be provided.
GameViewSettings | LuaStruct | Parameters that affect the look and control of the game. [...]
Parameters that affect the look and control of the game. [...]
MapExchangeStringData | table | The data that can be extracted from a map exchange string, as a plain table.
The data that can be extracted from a map exchange string, as a plain table.
BlueprintSignalIcon | table |
ItemLocationData | table |
BlueprintWire | {uint, defines.wire_connector_id, uint, defines.wire_connector_id} | Describes a single wire in the blueprint. [...]
Describes a single wire in the blueprint. [...]
Tile | table |
Ingredient | table |
Loot | table |
TechnologyModifier | table | The effect that is applied when a technology is researched. [...]
The effect that is applied when a technology is researched. [...]
NoiseExpression | table | A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain generation. [...]
A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain generation. [...]
AutoplaceSpecificationRestriction | table |
Resistance | table |
MapGenSize | union | A floating point number specifying an amount. [...]
A floating point number specifying an amount. [...]
AutoplaceControl | table |
PropertyExpressionNames | dictionary[string → string] | All other MapGenSettings feed into named noise expressions, and therefore placement can be overridden by including the name of a property in this dictionary. [...]
All other MapGenSettings feed into named noise expressions, and therefore placement can be overridden by including the name of a property in this dictionary. [...]
AdvancedMapGenSettings | table |
MapGenPreset | table |
SignalID | table |
Signal | table | An actual signal transmitted by the network.
An actual signal transmitted by the network.
UpgradeMapperSource | table |
UpgradeMapperDestination | table |
InfinityInventoryFilter | table | A single filter used by an infinity-filters instance.
A single filter used by an infinity-filters instance.
InfinityPipeFilter | table | A single filter used by an infinity-pipe type entity.
A single filter used by an infinity-pipe type entity.
FluidBoxFilter | table |
FluidBoxFilterSpec | table |
HeatSetting | table | The settings used by a heat-interface type entity.
The settings used by a heat-interface type entity.
HeatConnection | table |
ArithmeticCombinatorParameters | table |
ConstantCombinatorParameters | table |
SelectorCombinatorParameters | table |
DeciderCombinatorParameters | table |
DeciderCombinatorCondition | table |
DeciderCombinatorOutput | table |
CircuitNetworkSelection | table |
InserterCircuitConditions | table |
CircuitCondition | table |
CircuitConditionDefinition | table |
DragTarget | table |
InventoryFilter | table |
PlaceAsTileResult | table |
RaiseEventParameters | table | A table containing the parameters required to raise a given game event. [...]
A table containing the parameters required to raise a given game event. [...]
ItemCountWithQuality | table |
Command | table | Commands can be given to enemies and unit groups.
Commands can be given to enemies and unit groups.
PathfinderFlags | table |
UnitSpawnDefinition | table |
SpawnPointDefinition | table |
SpoilToTriggerResult | table |
SimpleItemStack | union | An item stack may be specified in one of two ways.
An item stack may be specified in one of two ways.
SurfaceIdentification | union | A surface may be specified in one of three ways.
A surface may be specified in one of three ways.
PlayerIdentification | union | A player may be specified in one of three ways.
A player may be specified in one of three ways.
ItemStackIdentification | union | An item may be specified in one of two ways.
An item may be specified in one of two ways.
TargetType | union | Target type of an AmmoType.
Target type of an AmmoType.
BeamTarget | table |
RidingState | table |
SoundPath | string | It can be either the name of a SoundPrototype defined in the data stage, or a path in the form `"type/name"`. [...]
It can be either the name of a SoundPrototype defined in the data stage, or a path in the form `"type/name"`. [...]
CircularParticleCreationSpecification | table |
CircularProjectileCreationSpecification | {RealOrientation, Vector} |
AttackParameterFluid | table |
AttackParameters | table |
GunShift4Way | table |
CapsuleAction | table |
LogisticsNetworkSupplyCounts | table |
LogisticsNetworkSupplyPoints | table |
ModSetting | table |
AnyBasic | string or boolean or number or table | Any basic type (string, number, boolean) or table.
Any basic type (string, number, boolean) or table.
Any | string or boolean or number or table or LuaObject | Any basic type (string, number, boolean), table, or LuaObject.
Any basic type (string, number, boolean), table, or LuaObject.
ProgrammableSpeakerParameters | table |
ProgrammableSpeakerAlertParameters | table |
ProgrammableSpeakerCircuitParameters | table |
ProgrammableSpeakerInstrument | table |
Alignment | union | A string that specifies where a GUI element should be.
A string that specifies where a GUI element should be.
EventData | table | Information about the event that has been raised. [...]
Information about the event that has been raised. [...]
NthTickEventData | table |
ModChangeData | table |
ConfigurationChangedData | table |
CustomCommandData | table |
SelectedPrototypeData | table |
MouseButtonFlags | dictionary[union → `true`] | A set of flags. [...]
A set of flags. [...]
ForceCondition | union |
ItemStackLocation | table |
VehicleAutomaticTargetingParameters | table |
GuiElementType | union |
GuiArrowType | union | Used by GuiArrowSpecification.
Used by GuiArrowSpecification.
GuiDirection | union | Direction of a LuaGuiElement's layout.
Direction of a LuaGuiElement's layout.
ScrollPolicy | union | Scroll policy of a scroll pane.
Scroll policy of a scroll pane.
RailLocation | table |
WireConnection | table |
float | builtin | A floating-point number. [...]
A floating-point number. [...]
double | builtin | A double-precision floating-point number. [...]
A double-precision floating-point number. [...]
int | builtin | 32-bit signed integer. [...]
32-bit signed integer. [...]
int8 | builtin | 8-bit signed integer. [...]
8-bit signed integer. [...]
uint | builtin | 32-bit unsigned integer. [...]
32-bit unsigned integer. [...]
uint8 | builtin | 8-bit unsigned integer. [...]
8-bit unsigned integer. [...]
uint16 | builtin | 16-bit unsigned integer. [...]
16-bit unsigned integer. [...]
uint64 | builtin | 64-bit unsigned integer. [...]
64-bit unsigned integer. [...]
number | builtin | Any kind of integer or floating point number.
Any kind of integer or floating point number.
string | builtin | Strings are enclosed in double-quotes, like this `"hi"`.
Strings are enclosed in double-quotes, like this `"hi"`.
boolean | builtin | Either `true` or `false`.
Either `true` or `false`.
nil | builtin | Nil is the type of the value `nil`, whose main property is to be different from any other value. [...]
Nil is the type of the value `nil`, whose main property is to be different from any other value. [...]
table | builtin | Tables are enclosed in curly brackets, like this `{}`. [...]
Tables are enclosed in curly brackets, like this `{}`. [...]
LuaObject | builtin | Any LuaObject listed on the Classes page.
Any LuaObject listed on the Classes page.
ModSettingPrototypeFilter | table |
TilePrototypeFilter | table |
DecorativePrototypeFilter | table |
RecipePrototypeFilter | table |
AchievementPrototypeFilter | table |
TechnologyPrototypeFilter | table |
AsteroidChunkPrototypeFilter | table |
ItemPrototypeFilter | table |
EquipmentPrototypeFilter | table |
EntityPrototypeFilter | table |
SpaceLocationPrototypeFilter | table |
FluidPrototypeFilter | table |
LuaPrePlatformMinedEntityEventFilter | table |
LuaRobotMinedEntityEventFilter | table |
LuaEntityMarkedForUpgradeEventFilter | table |
LuaPreGhostUpgradedEventFilter | table |
LuaPlatformMinedEntityEventFilter | table |
LuaScriptRaisedDestroyEventFilter | table |
LuaPlayerBuiltEntityEventFilter | table |
LuaPlatformBuiltEntityEventFilter | table |
LuaPreGhostDeconstructedEventFilter | table |
LuaEntityClonedEventFilter | table |
LuaScriptRaisedTeleportedEventFilter | table |
LuaEntityDeconstructionCancelledEventFilter | table |
LuaRobotBuiltEntityEventFilter | table |
LuaScriptRaisedBuiltEventFilter | table |
LuaPrePlayerMinedEntityEventFilter | table |
LuaPlayerRepairedEntityEventFilter | table |
LuaUpgradeCancelledEventFilter | table |
LuaSectorScannedEventFilter | table |
LuaPostEntityDiedEventFilter | table |
LuaEntityMarkedForDeconstructionEventFilter | table |
LuaPlayerMinedEntityEventFilter | table |
LuaEntityDamagedEventFilter | table |
LuaScriptRaisedReviveEventFilter | table |
LuaEntityDiedEventFilter | table |
LuaPreRobotMinedEntityEventFilter | table |