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

# Factorio Runtime Docs Version 2.0.7

## Class LuaPrototypes new

Provides read-only access to prototypes. It is accessible through the global object named `prototypes`.

## Members

get_entity_filtered(filters) | → LuaCustomTable[string → LuaEntityPrototype] | Returns a dictionary of all LuaEntityPrototypes that fit the given filters. [...]
Returns a dictionary of all LuaEntityPrototypes that fit the given filters. [...]
get_item_filtered(filters) | → LuaCustomTable[string → LuaItemPrototype] | Returns a dictionary of all LuaItemPrototypes that fit the given filters. [...]
Returns a dictionary of all LuaItemPrototypes that fit the given filters. [...]
get_equipment_filtered(filters) | → LuaCustomTable[string → LuaEquipmentPrototype] | Returns a dictionary of all LuaEquipmentPrototypes that fit the given filters. [...]
Returns a dictionary of all LuaEquipmentPrototypes that fit the given filters. [...]
get_mod_setting_filtered(filters) | → LuaCustomTable[string → LuaModSettingPrototype] | Returns a dictionary of all LuaModSettingPrototypes that fit the given filters. [...]
Returns a dictionary of all LuaModSettingPrototypes that fit the given filters. [...]
get_achievement_filtered(filters) | → LuaCustomTable[string → LuaAchievementPrototype] | Returns a dictionary of all LuaAchievementPrototypes that fit the given filters. [...]
Returns a dictionary of all LuaAchievementPrototypes that fit the given filters. [...]
get_tile_filtered(filters) | → LuaCustomTable[string → LuaTilePrototype] | Returns a dictionary of all LuaTilePrototypes that fit the given filters. [...]
Returns a dictionary of all LuaTilePrototypes that fit the given filters. [...]
get_decorative_filtered(filters) | → LuaCustomTable[string → LuaDecorativePrototype] | Returns a dictionary of all LuaDecorativePrototypes that fit the given filters. [...]
Returns a dictionary of all LuaDecorativePrototypes that fit the given filters. [...]
get_fluid_filtered(filters) | → LuaCustomTable[string → LuaFluidPrototype] | Returns a dictionary of all LuaFluidPrototypes that fit the given filters. [...]
Returns a dictionary of all LuaFluidPrototypes that fit the given filters. [...]
get_recipe_filtered(filters) | → LuaCustomTable[string → LuaRecipePrototype] | Returns a dictionary of all LuaRecipePrototypes that fit the given filters. [...]
Returns a dictionary of all LuaRecipePrototypes that fit the given filters. [...]
get_technology_filtered(filters) | → LuaCustomTable[string → LuaTechnologyPrototype] | Returns a dictionary of all LuaTechnologyPrototypes that fit the given filters. [...]
Returns a dictionary of all LuaTechnologyPrototypes that fit the given filters. [...]
get_history(type, name) | → PrototypeHistory | Gets the prototype history for the given type and name.
Gets the prototype history for the given type and name.
object_name | :: R string | The class name of this object. [...]
The class name of this object. [...]
font | :: R LuaCustomTable[string → LuaFontPrototype] | A dictionary containing every LuaFontPrototype indexed by `name`.
A dictionary containing every LuaFontPrototype indexed by `name`.
map_gen_preset | :: R LuaCustomTable[string → MapGenPreset] | A dictionary containing every MapGenPreset indexed by `name`. [...]
A dictionary containing every MapGenPreset indexed by `name`. [...]
style | :: R LuaCustomTable[string → string] | The styles that LuaGuiElement can use, indexed by `name`.
The styles that LuaGuiElement can use, indexed by `name`.
entity | :: R LuaCustomTable[string → LuaEntityPrototype] | A dictionary containing every LuaEntityPrototype indexed by `name`.
A dictionary containing every LuaEntityPrototype indexed by `name`.
item | :: R LuaCustomTable[string → LuaItemPrototype] | A dictionary containing every LuaItemPrototype indexed by `name`.
A dictionary containing every LuaItemPrototype indexed by `name`.
fluid | :: R LuaCustomTable[string → LuaFluidPrototype] | A dictionary containing every LuaFluidPrototype indexed by `name`.
A dictionary containing every LuaFluidPrototype indexed by `name`.
tile | :: R LuaCustomTable[string → LuaTilePrototype] | A dictionary containing every LuaTilePrototype indexed by `name`.
A dictionary containing every LuaTilePrototype indexed by `name`.
equipment | :: R LuaCustomTable[string → LuaEquipmentPrototype] | A dictionary containing every LuaEquipmentPrototype indexed by `name`.
A dictionary containing every LuaEquipmentPrototype indexed by `name`.
damage | :: R LuaCustomTable[string → LuaDamagePrototype] | A dictionary containing every LuaDamagePrototype indexed by `name`.
A dictionary containing every LuaDamagePrototype indexed by `name`.
virtual_signal | :: R LuaCustomTable[string → LuaVirtualSignalPrototype] | A dictionary containing every LuaVirtualSignalPrototype indexed by `name`.
A dictionary containing every LuaVirtualSignalPrototype indexed by `name`.
equipment_grid | :: R LuaCustomTable[string → LuaEquipmentGridPrototype] | A dictionary containing every LuaEquipmentGridPrototype indexed by `name`.
A dictionary containing every LuaEquipmentGridPrototype indexed by `name`.
recipe | :: R LuaCustomTable[string → LuaRecipePrototype] | A dictionary containing every LuaRecipePrototype indexed by `name`.
A dictionary containing every LuaRecipePrototype indexed by `name`.
technology | :: R LuaCustomTable[string → LuaTechnologyPrototype] | A dictionary containing every LuaTechnologyPrototype indexed by `name`.
A dictionary containing every LuaTechnologyPrototype indexed by `name`.
decorative | :: R LuaCustomTable[string → LuaDecorativePrototype] | A dictionary containing every LuaDecorativePrototype indexed by `name`.
A dictionary containing every LuaDecorativePrototype indexed by `name`.
particle | :: R LuaCustomTable[string → LuaParticlePrototype] | A dictionary containing every LuaParticlePrototype indexed by `name`.
A dictionary containing every LuaParticlePrototype indexed by `name`.
autoplace_control | :: R LuaCustomTable[string → LuaAutoplaceControlPrototype] | A dictionary containing every LuaAutoplaceControlPrototype indexed by `name`.
A dictionary containing every LuaAutoplaceControlPrototype indexed by `name`.
mod_setting | :: R LuaCustomTable[string → LuaModSettingPrototype] | A dictionary containing every LuaModSettingPrototype indexed by `name`.
A dictionary containing every LuaModSettingPrototype indexed by `name`.
custom_input | :: R LuaCustomTable[string → LuaCustomInputPrototype] | A dictionary containing every LuaCustomInputPrototype indexed by `name`.
A dictionary containing every LuaCustomInputPrototype indexed by `name`.
ammo_category | :: R LuaCustomTable[string → LuaAmmoCategoryPrototype] | A dictionary containing every LuaAmmoCategoryPrototype indexed by `name`.
A dictionary containing every LuaAmmoCategoryPrototype indexed by `name`.
named_noise_expression | :: R LuaCustomTable[string → LuaNamedNoiseExpression] | A dictionary containing every LuaNamedNoiseExpression indexed by `name`.
A dictionary containing every LuaNamedNoiseExpression indexed by `name`.
named_noise_function | :: R LuaCustomTable[string → LuaNamedNoiseFunction] | A dictionary containing every LuaNamedNoiseFunction indexed by `name`.
A dictionary containing every LuaNamedNoiseFunction indexed by `name`.
item_subgroup | :: R LuaCustomTable[string → LuaGroup] | A dictionary containing every ItemSubgroup indexed by `name`.
A dictionary containing every ItemSubgroup indexed by `name`.
item_group | :: R LuaCustomTable[string → LuaGroup] | A dictionary containing every ItemGroup indexed by `name`.
A dictionary containing every ItemGroup indexed by `name`.
fuel_category | :: R LuaCustomTable[string → LuaFuelCategoryPrototype] | A dictionary containing every LuaFuelCategoryPrototype indexed by `name`.
A dictionary containing every LuaFuelCategoryPrototype indexed by `name`.
resource_category | :: R LuaCustomTable[string → LuaResourceCategoryPrototype] | A dictionary containing every LuaResourceCategoryPrototype indexed by `name`.
A dictionary containing every LuaResourceCategoryPrototype indexed by `name`.
achievement | :: R LuaCustomTable[string → LuaAchievementPrototype] | A dictionary containing every LuaAchievementPrototype indexed by `name`.
A dictionary containing every LuaAchievementPrototype indexed by `name`.
module_category | :: R LuaCustomTable[string → LuaModuleCategoryPrototype] | A dictionary containing every LuaModuleCategoryPrototype indexed by `name`.
A dictionary containing every LuaModuleCategoryPrototype indexed by `name`.
equipment_category | :: R LuaCustomTable[string → LuaEquipmentCategoryPrototype] | A dictionary containing every LuaEquipmentCategoryPrototype indexed by `name`.
A dictionary containing every LuaEquipmentCategoryPrototype indexed by `name`.
trivial_smoke | :: R LuaCustomTable[string → LuaTrivialSmokePrototype] | A dictionary containing every LuaTrivialSmokePrototype indexed by `name`.
A dictionary containing every LuaTrivialSmokePrototype indexed by `name`.
shortcut | :: R LuaCustomTable[string → LuaShortcutPrototype] | A dictionary containing every LuaShortcutPrototype indexed by `name`.
A dictionary containing every LuaShortcutPrototype indexed by `name`.
recipe_category | :: R LuaCustomTable[string → LuaRecipeCategoryPrototype] | A dictionary containing every LuaRecipeCategoryPrototype indexed by `name`.
A dictionary containing every LuaRecipeCategoryPrototype indexed by `name`.
quality | :: R LuaCustomTable[string → LuaQualityPrototype] |
surface_property | :: R LuaCustomTable[string → LuaSurfacePropertyPrototype] |
space_location | :: R LuaCustomTable[string → LuaSpaceLocationPrototype] |
space_connection | :: R LuaCustomTable[string → LuaSpaceConnectionPrototype] |
custom_event | :: R LuaCustomTable[string → LuaCustomEventPrototype] | A dictionary containing every defined custom event, indexed by `name`.
A dictionary containing every defined custom event, indexed by `name`.
active_trigger | :: R LuaCustomTable[string → LuaActiveTriggerPrototype] | A dictionary containing every LuaActiveTriggerPrototype indexed by `name`.
A dictionary containing every LuaActiveTriggerPrototype indexed by `name`.
asteroid_chunk | :: R LuaCustomTable[string → LuaAsteroidChunkPrototype] | A dictionary containing every LuaAsteroidChunkPrototype indexed by `name`.
A dictionary containing every LuaAsteroidChunkPrototype indexed by `name`.
collision_layer | :: R LuaCustomTable[string → LuaCollisionLayerPrototype] | A dictionary containing every LuaCollisionLayerPrototype indexed by `name`.
A dictionary containing every LuaCollisionLayerPrototype indexed by `name`.
airborne_pollutant | :: R LuaCustomTable[string → LuaAirbornePollutantPrototype] | A dictionary containing every LuaAirbornePollutantPrototype indexed by `name`.
A dictionary containing every LuaAirbornePollutantPrototype indexed by `name`.
burner_usage | :: R LuaCustomTable[string → LuaBurnerUsagePrototype] | A dictionary containing every LuaBurnerUsagePrototype indexed by `name`.
A dictionary containing every LuaBurnerUsagePrototype indexed by `name`.
surface | :: R LuaCustomTable[string → LuaSurfacePrototype] | A dictionary containing every LuaSurfacePrototype indexed by `name`.
A dictionary containing every LuaSurfacePrototype indexed by `name`.
procession | :: R LuaCustomTable[string → LuaProcessionPrototype] | A dictionary containing every LuaProcessionPrototype indexed by `name`.
A dictionary containing every LuaProcessionPrototype indexed by `name`.
procession_layer_inheritance_group | :: R LuaCustomTable[string → LuaProcessionLayerInheritanceGroupPrototype] | A dictionary containing every LuaProcessionLayerInheritanceGroupPrototype indexed by `name`.
A dictionary containing every LuaProcessionLayerInheritanceGroupPrototype indexed by `name`.
max_force_distraction_distance | :: R double |
max_force_distraction_chunk_distance | :: R uint |
max_electric_pole_supply_area_distance | :: R float |
max_electric_pole_connection_distance | :: R double |
max_beacon_supply_area_distance | :: R uint |
max_gate_activation_distance | :: R double |
max_inserter_reach_distance | :: R double |
max_pipe_to_ground_distance | :: R uint8 |
max_underground_belt_distance | :: R uint8 |

## Methods

### get_entity_filtered(filters) → LuaCustomTable[string → LuaEntityPrototype]

Returns a dictionary of all LuaEntityPrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[EntityPrototypeFilter] |

#### Example

    -- Get every entity prototype that can craft recipes involving fluids in the way some assembling machines can
    local prototypes = prototypes.get_entity_filtered{{filter="crafting-category", crafting_category="crafting-with-fluid"}}

### get_item_filtered(filters) → LuaCustomTable[string → LuaItemPrototype]

Returns a dictionary of all LuaItemPrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[ItemPrototypeFilter] |

#### Example

    -- Get every item prototype that has a fuel top speed multiplier larger than 1.
    local prototypes = prototypes.get_item_filtered{{filter = "fuel-top-speed-multiplier", comparison = ">", value = 1}}

### get_equipment_filtered(filters) → LuaCustomTable[string → LuaEquipmentPrototype]

Returns a dictionary of all LuaEquipmentPrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[EquipmentPrototypeFilter] |

#### Example

    -- Get every equipment prototype that functions as a battery.
    local prototypes = prototypes.get_equipment_filtered{{filter="type", type="battery-equipment"}}

### get_mod_setting_filtered(filters) → LuaCustomTable[string → LuaModSettingPrototype]

Returns a dictionary of all LuaModSettingPrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[ModSettingPrototypeFilter] |

#### Example

    -- Get every mod setting prototype that belongs to the specified mod.
    local prototypes = prototypes.get_mod_setting_filtered{{filter="mod", mod="space-exploration"}}

### get_achievement_filtered(filters) → LuaCustomTable[string → LuaAchievementPrototype]

Returns a dictionary of all LuaAchievementPrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[AchievementPrototypeFilter] |

#### Example

    -- Get every achievement prototype that is not allowed to be completed on the peaceful difficulty setting.
    local prototypes = prototypes.get_achievement_filtered{{filter="allowed-without-fight", invert=true}}

### get_tile_filtered(filters) → LuaCustomTable[string → LuaTilePrototype]

Returns a dictionary of all LuaTilePrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[TilePrototypeFilter] |

#### Example

    -- Get every tile prototype that improves a player's walking speed by at least 50%.
    local prototypes = prototypes.get_tile_filtered{{filter="walking-speed-modifier", comparison="≥", value=1.5}}

### get_decorative_filtered(filters) → LuaCustomTable[string → LuaDecorativePrototype]

Returns a dictionary of all LuaDecorativePrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[DecorativePrototypeFilter] |

#### Example

    -- Get every decorative prototype that is auto-placed.
    local prototypes = prototypes.get_decorative_filtered{{filter="autoplace"}}

### get_fluid_filtered(filters) → LuaCustomTable[string → LuaFluidPrototype]

Returns a dictionary of all LuaFluidPrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[FluidPrototypeFilter] |

#### Example

    -- Get every fluid prototype that has a heat capacity of exactly `100`.
    local prototypes = prototypes.get_fluid_filtered{{filter="heat-capacity", comparison="=", value=100}}

### get_recipe_filtered(filters) → LuaCustomTable[string → LuaRecipePrototype]

Returns a dictionary of all LuaRecipePrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[RecipePrototypeFilter] |

#### Example

    -- Get every recipe prototype that takes less than half a second to craft (at crafting speed `1`).
    local prototypes = prototypes.get_recipe_filtered{{filter="energy", comparison="<", value=0.5}}

### get_technology_filtered(filters) → LuaCustomTable[string → LuaTechnologyPrototype]

Returns a dictionary of all LuaTechnologyPrototypes that fit the given filters. The prototypes are indexed by `name`.

#### Parameters

filters | :: array[TechnologyPrototypeFilter] |

#### Example

    -- Get every technology prototype that can be researched at the start of the game.
    local prototypes = prototypes.get_technology_filtered{{filter="has-prerequisites", invert=true}}

### get_history(type, name) → PrototypeHistory

Gets the prototype history for the given type and name.

#### Parameters

type | :: string |
name | :: string |

## Attributes

### object_name :: Read string

The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.

### font :: Read LuaCustomTable[string → LuaFontPrototype]

A dictionary containing every LuaFontPrototype indexed by `name`.

### map_gen_preset :: Read LuaCustomTable[string → MapGenPreset]

A dictionary containing every MapGenPreset indexed by `name`.

A MapGenPreset is an exact copy of the prototype table provided from the data stage.

### style :: Read LuaCustomTable[string → string]

The styles that LuaGuiElement can use, indexed by `name`.

### entity :: Read LuaCustomTable[string → LuaEntityPrototype]

A dictionary containing every LuaEntityPrototype indexed by `name`.

### item :: Read LuaCustomTable[string → LuaItemPrototype]

A dictionary containing every LuaItemPrototype indexed by `name`.

### fluid :: Read LuaCustomTable[string → LuaFluidPrototype]

A dictionary containing every LuaFluidPrototype indexed by `name`.

### tile :: Read LuaCustomTable[string → LuaTilePrototype]

A dictionary containing every LuaTilePrototype indexed by `name`.

### equipment :: Read LuaCustomTable[string → LuaEquipmentPrototype]

A dictionary containing every LuaEquipmentPrototype indexed by `name`.

### damage :: Read LuaCustomTable[string → LuaDamagePrototype]

A dictionary containing every LuaDamagePrototype indexed by `name`.

### virtual_signal :: Read LuaCustomTable[string → LuaVirtualSignalPrototype]

A dictionary containing every LuaVirtualSignalPrototype indexed by `name`.

### equipment_grid :: Read LuaCustomTable[string → LuaEquipmentGridPrototype]

A dictionary containing every LuaEquipmentGridPrototype indexed by `name`.

### recipe :: Read LuaCustomTable[string → LuaRecipePrototype]

A dictionary containing every LuaRecipePrototype indexed by `name`.

### technology :: Read LuaCustomTable[string → LuaTechnologyPrototype]

A dictionary containing every LuaTechnologyPrototype indexed by `name`.

### decorative :: Read LuaCustomTable[string → LuaDecorativePrototype]

A dictionary containing every LuaDecorativePrototype indexed by `name`.

### particle :: Read LuaCustomTable[string → LuaParticlePrototype]

A dictionary containing every LuaParticlePrototype indexed by `name`.

### autoplace_control :: Read LuaCustomTable[string → LuaAutoplaceControlPrototype]

A dictionary containing every LuaAutoplaceControlPrototype indexed by `name`.

### mod_setting :: Read LuaCustomTable[string → LuaModSettingPrototype]

A dictionary containing every LuaModSettingPrototype indexed by `name`.

### custom_input :: Read LuaCustomTable[string → LuaCustomInputPrototype]

A dictionary containing every LuaCustomInputPrototype indexed by `name`.

### ammo_category :: Read LuaCustomTable[string → LuaAmmoCategoryPrototype]

A dictionary containing every LuaAmmoCategoryPrototype indexed by `name`.

### named_noise_expression :: Read LuaCustomTable[string → LuaNamedNoiseExpression]

A dictionary containing every LuaNamedNoiseExpression indexed by `name`.

### named_noise_function :: Read LuaCustomTable[string → LuaNamedNoiseFunction]

A dictionary containing every LuaNamedNoiseFunction indexed by `name`.

### item_subgroup :: Read LuaCustomTable[string → LuaGroup]

A dictionary containing every ItemSubgroup indexed by `name`.

### item_group :: Read LuaCustomTable[string → LuaGroup]

A dictionary containing every ItemGroup indexed by `name`.

### fuel_category :: Read LuaCustomTable[string → LuaFuelCategoryPrototype]

A dictionary containing every LuaFuelCategoryPrototype indexed by `name`.

### resource_category :: Read LuaCustomTable[string → LuaResourceCategoryPrototype]

A dictionary containing every LuaResourceCategoryPrototype indexed by `name`.

### achievement :: Read LuaCustomTable[string → LuaAchievementPrototype]

A dictionary containing every LuaAchievementPrototype indexed by `name`.

### module_category :: Read LuaCustomTable[string → LuaModuleCategoryPrototype]

A dictionary containing every LuaModuleCategoryPrototype indexed by `name`.

### equipment_category :: Read LuaCustomTable[string → LuaEquipmentCategoryPrototype]

A dictionary containing every LuaEquipmentCategoryPrototype indexed by `name`.

### trivial_smoke :: Read LuaCustomTable[string → LuaTrivialSmokePrototype]

A dictionary containing every LuaTrivialSmokePrototype indexed by `name`.

### shortcut :: Read LuaCustomTable[string → LuaShortcutPrototype]

A dictionary containing every LuaShortcutPrototype indexed by `name`.

### recipe_category :: Read LuaCustomTable[string → LuaRecipeCategoryPrototype]

A dictionary containing every LuaRecipeCategoryPrototype indexed by `name`.

### quality :: Read LuaCustomTable[string → LuaQualityPrototype]

### surface_property :: Read LuaCustomTable[string → LuaSurfacePropertyPrototype]

### space_location :: Read LuaCustomTable[string → LuaSpaceLocationPrototype]

### space_connection :: Read LuaCustomTable[string → LuaSpaceConnectionPrototype]

### custom_event :: Read LuaCustomTable[string → LuaCustomEventPrototype]

A dictionary containing every defined custom event, indexed by `name`.

### active_trigger :: Read LuaCustomTable[string → LuaActiveTriggerPrototype]

A dictionary containing every LuaActiveTriggerPrototype indexed by `name`.

### asteroid_chunk :: Read LuaCustomTable[string → LuaAsteroidChunkPrototype]

A dictionary containing every LuaAsteroidChunkPrototype indexed by `name`.

### collision_layer :: Read LuaCustomTable[string → LuaCollisionLayerPrototype]

A dictionary containing every LuaCollisionLayerPrototype indexed by `name`.

### airborne_pollutant :: Read LuaCustomTable[string → LuaAirbornePollutantPrototype]

A dictionary containing every LuaAirbornePollutantPrototype indexed by `name`.

### burner_usage :: Read LuaCustomTable[string → LuaBurnerUsagePrototype]

A dictionary containing every LuaBurnerUsagePrototype indexed by `name`.

### surface :: Read LuaCustomTable[string → LuaSurfacePrototype]

A dictionary containing every LuaSurfacePrototype indexed by `name`.

### procession :: Read LuaCustomTable[string → LuaProcessionPrototype]

A dictionary containing every LuaProcessionPrototype indexed by `name`.

### procession_layer_inheritance_group :: Read LuaCustomTable[string → LuaProcessionLayerInheritanceGroupPrototype]

A dictionary containing every LuaProcessionLayerInheritanceGroupPrototype indexed by `name`.

### max_force_distraction_distance :: Read double

### max_force_distraction_chunk_distance :: Read uint

### max_electric_pole_supply_area_distance :: Read float

### max_electric_pole_connection_distance :: Read double

### max_beacon_supply_area_distance :: Read uint

### max_gate_activation_distance :: Read double

### max_inserter_reach_distance :: Read double

### max_pipe_to_ground_distance :: Read uint8

### max_underground_belt_distance :: Read uint8