Factorio Runtime DocsVersion 1.1.108

Classes

As described on the home page, it is necessary to have access to instances of classes to use the scripting API. Using the provided global classes, instances of all other classes can be accessed.

Example

This will print the first player's username, making use of LuaGameScript::get_player to gain access to players' information, and LuaPlayer::print to display a string in the player's game console.

local first_player = game.get_player(1)
first_player.print(first_player.name)
This is a list of all Lua classes defined by Factorio. Each class also has an individual page with details on its methods and attributes.
LuaAISettings

Collection of settings for overriding default ai behavior.

LuaAccumulatorControlBehavior

Control behavior for accumulators.

LuaAchievementPrototype

Prototype of a achievement.

LuaAmmoCategoryPrototype

Prototype of a ammo category.

LuaArithmeticCombinatorControlBehavior

Control behavior for arithmetic combinators.

LuaAutoplaceControlPrototype

Prototype of an autoplace control.

LuaBootstrap

Entry point for registering event handlers. [...]

LuaBurner

A reference to the burner energy source owned by a specific LuaEntity or LuaEquipment.

LuaBurnerPrototype

Prototype of a burner energy source.

LuaChunkIterator

A chunk iterator can be used for iterating chunks coordinates of a surface. [...]

LuaCircuitNetwork

A circuit network associated with a given entity, connector, and wire type.

LuaCombinatorControlBehavior
LuaCommandProcessor

Allows for the registration of custom console commands through the global object named commands. [...]

LuaConstantCombinatorControlBehavior

Control behavior for constant combinators.

LuaContainerControlBehavior

Control behavior for container entities.

LuaControl

This is an abstract base class containing the common functionality between LuaPlayer and entities (see LuaEntity). [...]

LuaControlBehavior

The control behavior for an entity. [...]

LuaCustomChartTag

A custom tag that shows on the map view.

LuaCustomInputPrototype

Prototype of a custom input.

LuaCustomTable

Lazily evaluated table. [...]

LuaDamagePrototype

Prototype of a damage.

LuaDeciderCombinatorControlBehavior

Control behavior for decider combinators.

LuaDecorativePrototype

Prototype of an optimized decorative.

LuaElectricEnergySourcePrototype

Prototype of an electric energy source.

LuaEntity

The primary interface for interacting with entities through the Lua API. [...]

LuaEntityPrototype

Prototype of an entity.

LuaEquipment

An item in a LuaEquipmentGrid, for example a fusion reactor placed in one's power armor. [...]

LuaEquipmentCategoryPrototype

Prototype of an equipment category.

LuaEquipmentGrid

An equipment grid is for example the inside of a power armor.

LuaEquipmentGridPrototype

Prototype of an equipment grid.

LuaEquipmentPrototype

Prototype of a modular equipment.

LuaFlowStatistics

Encapsulates statistic data for different parts of the game. [...]

LuaFluidBox

An array of fluid boxes of an entity. [...]

LuaFluidBoxPrototype

A prototype of a fluidbox owned by some LuaEntityPrototype.

LuaFluidEnergySourcePrototype

Prototype of a fluid energy source.

LuaFluidPrototype

Prototype of a fluid.

LuaFontPrototype

Prototype of a font.

LuaForce

LuaForce encapsulates data local to each "force" or "faction" of the game. [...]

LuaFuelCategoryPrototype

Prototype of a fuel category.

LuaGameScript

Main toplevel type, provides access to most of the API though its members. [...]

LuaGenericOnOffControlBehavior

An abstract base class for behaviors that support switching the entity on or off based on some condition.

LuaGroup

Item group or subgroup.

LuaGui

The root of the GUI. [...]

LuaGuiElement

An element of a custom GUI. [...]

LuaHeatBufferPrototype

Prototype of a heat buffer.

LuaHeatEnergySourcePrototype

Prototype of a heat energy source.

LuaInserterControlBehavior

Control behavior for inserters.

LuaInventory

A storage of item stacks.

LuaItemPrototype

Prototype of an item. [...]

LuaItemStack

A reference to an item and count owned by some external entity. [...]

LuaLampControlBehavior

Control behavior for lamps.

LuaLazyLoadedValue

A lazily loaded value. [...]

LuaLogisticCell

Logistic cell of a particular LuaEntity. [...]

LuaLogisticContainerControlBehavior

Control behavior for logistic chests.

LuaLogisticNetwork

A single logistic network of a given force on a given surface.

LuaLogisticPoint

Logistic point of a particular LuaEntity. [...]

LuaMiningDrillControlBehavior

Control behavior for mining drills.

LuaModSettingPrototype

Prototype of a mod setting.

LuaModuleCategoryPrototype

Prototype of a module category.

LuaNamedNoiseExpression

Prototype of a named noise expression.

LuaNoiseLayerPrototype

Prototype of a noise layer.

LuaParticlePrototype

Prototype of an optimized particle.

LuaPermissionGroup

A permission group that defines what players in this group are allowed to do.

LuaPermissionGroups

All permission groups.

LuaPlayer

A player in the game. [...]

LuaProfiler

An object used to measure script performance. [...]

LuaProgrammableSpeakerControlBehavior

Control behavior for programmable speakers.

LuaRCON

An interface to send messages to the calling RCON interface through the global object named rcon.

LuaRailChainSignalControlBehavior

Control behavior for rail chain signals.

LuaRailPath

A rail path.

LuaRailSignalControlBehavior

Control behavior for rail signals.

LuaRandomGenerator

A deterministic random generator independent from the core games random generator that can be seeded and re-seeded at will. [...]

LuaRecipe

A crafting recipe. [...]

LuaRecipeCategoryPrototype

Prototype of a recipe category.

LuaRecipePrototype

A crafting recipe prototype.

LuaRemote

Registry of interfaces between scripts. [...]

LuaRendering

Allows rendering of geometric shapes, text and sprites in the game world through the global object named rendering. [...]

LuaResourceCategoryPrototype

Prototype of a resource category.

LuaRoboportControlBehavior

Control behavior for roboports.

LuaSettings

Object containing mod settings of three distinct types: startup, global, and player. [...]

LuaShortcutPrototype

Prototype of a shortcut.

LuaStorageTankControlBehavior

Control behavior for storage tanks.

LuaStyle

Style of a GUI element. [...]

LuaSurface

A "domain" of the world. [...]

LuaTechnology

One research item.

LuaTechnologyPrototype

A Technology prototype.

LuaTile

A single "square" on the map.

LuaTilePrototype

Prototype of a tile.

LuaTrain

A train. [...]

LuaTrainStopControlBehavior

Control behavior for train stops.

LuaTransportBeltControlBehavior

Control behavior for transport belts.

LuaTransportLine

One line on a transport belt.

LuaTrivialSmokePrototype

Prototype of a trivial smoke.

LuaUnitGroup

A collection of units moving and attacking together. [...]

LuaVirtualSignalPrototype

Prototype of a virtual signal.

LuaVoidEnergySourcePrototype

Prototype of a void energy source.

LuaWallControlBehavior

Control behavior for walls.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

allow_destroy_when_commands_fail [RW] :: boolean

If enabled, units that repeatedly fail to succeed at commands will be destroyed.

If enabled, units that repeatedly fail to succeed at commands will be destroyed.

allow_try_return_to_spawner [RW] :: boolean

If enabled, units that have nothing else to do will attempt to return to a spawner.

If enabled, units that have nothing else to do will attempt to return to a spawner.

do_separation [RW] :: boolean

If enabled, units will try to separate themselves from nearby friendly units.

If enabled, units will try to separate themselves from nearby friendly units.

path_resolution_modifier [RW] :: int8

Defines how coarse the pathfinder's grid is, where smaller values mean a coarser grid. [...]

Defines how coarse the pathfinder's grid is, where smaller values mean a coarser grid. [...]

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

output_signal [RW] :: SignalID
valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
allowed_without_fight [R] :: boolean
hidden [R] :: boolean
valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
bonus_gui_order [R] :: string
valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

parameters [RW] :: ArithmeticCombinatorParameters

This arithmetic combinator's parameters. [...]

This arithmetic combinator's parameters. [...]

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
richness [R] :: boolean
can_be_disabled [R] :: boolean
control_order [R] :: string
category [R] :: string

Category name of this prototype.

Category name of this prototype.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

on_init(handler)

Register a function to be run on mod initialization. [...]

Register a function to be run on mod initialization. [...]

on_load(handler)

Register a function to be run on save load. [...]

Register a function to be run on save load. [...]

on_configuration_changed(handler)

Register a function to be run when mod configuration changes. [...]

Register a function to be run when mod configuration changes. [...]

on_event(event, handler, filters?)

Register a handler to run on the specified event(s). [...]

Register a handler to run on the specified event(s). [...]

on_nth_tick(tick, handler)

Register a handler to run every nth-tick(s). [...]

Register a handler to run every nth-tick(s). [...]

register_on_entity_destroyed(entity)  → uint64

Registers an entity so that after it's destroyed, on_entity_destroyed is called. [...]

Registers an entity so that after it's destroyed, on_entity_destroyed is called. [...]

register_metatable(name, metatable)

Register a metatable to have linkage recorded and restored when saving/loading. [...]

Register a metatable to have linkage recorded and restored when saving/loading. [...]

generate_event_name()  → uint

Generate a new, unique event ID that can be used to raise custom events with LuaBootstrap::raise_event.

Generate a new, unique event ID that can be used to raise custom events with LuaBootstrap::raise_event.

get_event_handler(event)  → function(EventData)?

Find the event handler for an event.

Find the event handler for an event.

get_event_order()  → string

Gets the mod event order as a string.

Gets the mod event order as a string.

set_event_filter(event, filters?)

Sets the filters for the given event. [...]

Sets the filters for the given event. [...]

get_event_filter(event)  → EventFilter?

Gets the filters for the given event.

Gets the filters for the given event.

get_prototype_history(type, name)  → PrototypeHistory

Gets the prototype history for the given type and name.

Gets the prototype history for the given type and name.

raise_event(event, data)

Raise an event. [...]

Raise an event. [...]

raise_console_chat{player_index=…, message=…}
raise_player_crafted_item{item_stack=…, player_index=…, recipe=…}
raise_player_fast_transferred{player_index=…, entity=…, from_player=…, is_split=…}
raise_biter_base_built{entity=…}
raise_market_item_purchased{player_index=…, market=…, offer_index=…, count=…}
raise_script_built{entity=…}
raise_script_destroy{entity=…}
raise_script_revive{entity=…, tags?=…}
raise_script_teleported{entity=…, old_surface_index=…, old_position=…}
raise_script_set_tiles{surface_index=…, tiles=…}
help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

mod_name [R] :: string

The name of the mod from the environment this is used in.

The name of the mod from the environment this is used in.

level [R] :: table

Information about the currently running scenario/campaign/tutorial.

Information about the currently running scenario/campaign/tutorial.

active_mods [R] :: dictionary[string → string]

A dictionary listing the names of all currently active mods and mapping them to their version.

A dictionary listing the names of all currently active mods and mapping them to their version.

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

owner [R] :: LuaEntity or LuaEquipment

The owner of this burner energy source

The owner of this burner energy source

inventory [R] :: LuaInventory

The fuel inventory.

The fuel inventory.

burnt_result_inventory [R] :: LuaInventory

The burnt result inventory.

The burnt result inventory.

heat [RW] :: double

The current heat (energy) stored in this burner.

The current heat (energy) stored in this burner.

heat_capacity [R] :: double

The maximum heat (maximum energy) that this burner can store.

The maximum heat (maximum energy) that this burner can store.

remaining_burning_fuel [RW] :: double

The amount of energy left in the currently-burning fuel item. [...]

The amount of energy left in the currently-burning fuel item. [...]

currently_burning [RW] :: LuaItemPrototype?

The currently burning item. [...]

The currently burning item. [...]

fuel_categories [R] :: dictionary[string → true]

The fuel categories this burner uses. [...]

The fuel categories this burner uses. [...]

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

emissions [R] :: double

The emissions of this energy source in pollution/Joule. [...]

The emissions of this energy source in pollution/Joule. [...]

render_no_network_icon [R] :: boolean
render_no_power_icon [R] :: boolean
effectivity [R] :: double
fuel_inventory_size [R] :: uint
burnt_inventory_size [R] :: uint
smoke [R] :: array[SmokeSource]?

The smoke sources for this burner prototype.

The smoke sources for this burner prototype.

light_flicker [R] :: table?

The light flicker definition for this burner prototype.

The light flicker definition for this burner prototype.

fuel_categories [R] :: dictionary[string → true]

The value in the dictionary is meaningless and exists just to allow for easy lookup.

The value in the dictionary is meaningless and exists just to allow for easy lookup.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

() (call)  → ChunkPositionAndArea?

Gets the next chunk position if the iterator is not yet done and increments the iterator.

Gets the next chunk position if the iterator is not yet done and increments the iterator.

get_signal(signal)  → int
help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

entity [R] :: LuaEntity

The entity this circuit network reference is associated with.

The entity this circuit network reference is associated with.

wire_type [R] :: defines.wire_type

The wire type this network is associated with.

The wire type this network is associated with.

circuit_connector_id [R] :: defines.circuit_connector_id

The circuit connector ID on the associated entity this network was gotten from.

The circuit connector ID on the associated entity this network was gotten from.

signals [R] :: array[Signal]?

The circuit network signals last tick. [...]

The circuit network signals last tick. [...]

network_id [R] :: uint

The circuit networks ID.

The circuit networks ID.

connected_circuit_count [R] :: uint

The number of circuits connected to this network.

The number of circuits connected to this network.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

get_signal_last_tick(signal)  → int?

Gets the value of a specific signal sent by this combinator behavior last tick or nil if the signal didn't exist.

Gets the value of a specific signal sent by this combinator behavior last tick or nil if the signal didn't exist.

signals_last_tick [R] :: array[Signal]

The circuit network signals sent by this combinator last tick.

The circuit network signals sent by this combinator last tick.

add_command(name, help, function)

Add a custom console command. [...]

Add a custom console command. [...]

remove_command(name)  → boolean

Remove a custom console command.

Remove a custom console command.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

commands [R] :: dictionary[string → LocalisedString]

Lists the custom commands registered by scripts through LuaCommandProcessor.

Lists the custom commands registered by scripts through LuaCommandProcessor.

game_commands [R] :: dictionary[string → LocalisedString]

Lists the built-in commands of the core game. [...]

Lists the built-in commands of the core game. [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

set_signal(index, signal?)

Sets the signal at the given index.

Sets the signal at the given index.

get_signal(index)  → Signal

Gets the signal at the given index. [...]

Gets the signal at the given index. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

parameters [RW] :: array[ConstantCombinatorParameters]?

This constant combinator's parameters. [...]

This constant combinator's parameters. [...]

enabled [RW] :: boolean

Turns this constant combinator on and off.

Turns this constant combinator on and off.

signals_count [R] :: uint

The number of signals this constant combinator supports.

The number of signals this constant combinator supports.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

ClassLuaControlabstract

get_inventory(inventory)  → LuaInventory?

Get an inventory belonging to this entity. [...]

Get an inventory belonging to this entity. [...]

get_max_inventory_index()  → defines.inventory

The highest index of all inventories this entity can use. [...]

The highest index of all inventories this entity can use. [...]

get_main_inventory()  → LuaInventory?

Gets the main inventory for this character or player if this is a character or player.

Gets the main inventory for this character or player if this is a character or player.

can_insert(items)  → boolean

Can at least some items be inserted?

Can at least some items be inserted?

insert(items)  → uint

Insert items into this entity. [...]

Insert items into this entity. [...]

set_gui_arrow{type=…}

Create an arrow which points at this entity. [...]

Create an arrow which points at this entity. [...]

clear_gui_arrow()

Removes the arrow created by set_gui_arrow.

Removes the arrow created by set_gui_arrow.

get_item_count(item?)  → uint

Get the number of all or some items in this entity.

Get the number of all or some items in this entity.

has_items_inside()  → boolean

Does this entity have any item inside it?

Does this entity have any item inside it?

can_reach_entity(entity)  → boolean

Can a given entity be opened or accessed?

Can a given entity be opened or accessed?

clear_items_inside()

Remove all items from this entity.

Remove all items from this entity.

remove_item(items)  → uint

Remove items from this entity.

Remove items from this entity.

teleport(position, surface?, raise_teleported?)  → boolean

Teleport the entity to a given position, possibly on another surface. [...]

Teleport the entity to a given position, possibly on another surface. [...]

update_selected_entity(position)

Select an entity, as if by hovering the mouse above it.

Select an entity, as if by hovering the mouse above it.

clear_selected_entity()

Unselect any selected entity.

Unselect any selected entity.

disable_flashlight()

Disable the flashlight.

Disable the flashlight.

enable_flashlight()

Enable the flashlight.

Enable the flashlight.

is_flashlight_enabled()  → boolean

Is the flashlight enabled.

Is the flashlight enabled.

get_craftable_count(recipe)  → uint

Gets the count of the given recipe that can be crafted.

Gets the count of the given recipe that can be crafted.

begin_crafting{count=…, recipe=…, silent?=…}  → uint

Begins crafting the given count of the given recipe.

Begins crafting the given count of the given recipe.

cancel_crafting{index=…, count=…}

Cancels crafting the given count of the given crafting queue index.

Cancels crafting the given count of the given crafting queue index.

mine_entity(entity, force?)  → boolean

Mines the given entity as if this player (or character) mined it.

Mines the given entity as if this player (or character) mined it.

mine_tile(tile)  → boolean

Mines the given tile as if this player (or character) mined it.

Mines the given tile as if this player (or character) mined it.

is_player()  → boolean

When true control adapter is a LuaPlayer object, false for entities including characters with players.

When true control adapter is a LuaPlayer object, false for entities including characters with players.

open_technology_gui(technology?)

Open the technology GUI and select a given technology.

Open the technology GUI and select a given technology.

set_personal_logistic_slot(slot_index, value)  → boolean

Sets a personal logistic request and auto-trash slot to the given value. [...]

Sets a personal logistic request and auto-trash slot to the given value. [...]

set_vehicle_logistic_slot(slot_index, value)  → boolean

Sets a vehicle logistic request and auto-trash slot to the given value. [...]

Sets a vehicle logistic request and auto-trash slot to the given value. [...]

get_personal_logistic_slot(slot_index)  → LogisticParameters

Gets the parameters of a personal logistic request and auto-trash slot.

Gets the parameters of a personal logistic request and auto-trash slot.

get_vehicle_logistic_slot(slot_index)  → LogisticParameters

Gets the parameters of a vehicle logistic request and auto-trash slot. [...]

Gets the parameters of a vehicle logistic request and auto-trash slot. [...]

clear_personal_logistic_slot(slot_index)

This will silently fail if personal logistics are not researched yet.

This will silently fail if personal logistics are not researched yet.

clear_vehicle_logistic_slot(slot_index)

This will silently fail if the vehicle does not use logistics.

This will silently fail if the vehicle does not use logistics.

is_cursor_blueprint()  → boolean

Returns whether the player is holding a blueprint. [...]

Returns whether the player is holding a blueprint. [...]

get_blueprint_entities()  → array[BlueprintEntity]?

Gets the entities that are part of the currently selected blueprint, regardless of it being in a blueprint book or picked from the blueprint library.

Gets the entities that are part of the currently selected blueprint, regardless of it being in a blueprint book or picked from the blueprint library.

is_cursor_empty()  → boolean

Returns whether the player is holding something in the cursor. [...]

Returns whether the player is holding something in the cursor. [...]

surface [R] :: LuaSurface

The surface this entity is currently on.

The surface this entity is currently on.

surface_index [R] :: uint

Unique index (ID) associated with the surface this entity is currently on.

Unique index (ID) associated with the surface this entity is currently on.

position [R] :: MapPosition

The current position of the entity.

The current position of the entity.

vehicle [R] :: LuaEntity?

The vehicle the player is currently sitting in.

The vehicle the player is currently sitting in.

force [RW] :: ForceIdentification

The force of this entity. [...]

The force of this entity. [...]

force_index [R] :: uint

Unique index (ID) associated with the force of this entity.

Unique index (ID) associated with the force of this entity.

selected [RW] :: LuaEntity?

The currently selected entity. [...]

The currently selected entity. [...]

opened [RW] :: LuaEntity or LuaItemStack or LuaEquipment or LuaEquipmentGrid or LuaPlayer or LuaGuiElement or LuaInventory or LuaTechnology or defines.gui_type?

The GUI the player currently has open. [...]

The GUI the player currently has open. [...]

crafting_queue_size [R] :: uint

Size of the crafting queue.

Size of the crafting queue.

crafting_queue_progress [RW] :: double

The crafting queue progress in the range [0-1]. [...]

The crafting queue progress in the range [0-1]. [...]

walking_state [RW] :: table

Current walking state.

Current walking state.

riding_state [RW] :: RidingState

Current riding state of this car, or of the car this player is riding in.

Current riding state of this car, or of the car this player is riding in.

mining_state [RW] :: table

Current mining state. [...]

Current mining state. [...]

shooting_state [RW] :: table

Current shooting state.

Current shooting state.

picking_state [RW] :: boolean

Current item-picking state.

Current item-picking state.

repair_state [RW] :: table

Current repair state.

Current repair state.

cursor_stack [R] :: LuaItemStack?

The player's cursor stack. [...]

The player's cursor stack. [...]

cursor_ghost [RW] :: ItemPrototypeIdentification?

The ghost prototype in the player's cursor. [...]

The ghost prototype in the player's cursor. [...]

driving [RW] :: boolean

true if the player is in a vehicle. [...]

true if the player is in a vehicle. [...]

crafting_queue [R] :: array[CraftingQueueItem]

The current crafting queue items.

The current crafting queue items.

following_robots [R] :: array[LuaEntity]

The current combat robots following the character. [...]

The current combat robots following the character. [...]

cheat_mode [RW] :: boolean

When true hand crafting is free and instant.

When true hand crafting is free and instant.

character_crafting_speed_modifier [RW] :: double

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_mining_speed_modifier [RW] :: double

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_additional_mining_categories [RW] :: array[string]

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_running_speed_modifier [RW] :: double

Modifies the running speed of this character by the given value as a percentage. [...]

Modifies the running speed of this character by the given value as a percentage. [...]

character_build_distance_bonus [RW] :: uint

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_item_drop_distance_bonus [RW] :: uint

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_reach_distance_bonus [RW] :: uint

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_resource_reach_distance_bonus [RW] :: uint

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_item_pickup_distance_bonus [RW] :: uint

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_loot_pickup_distance_bonus [RW] :: uint

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_inventory_slots_bonus [RW] :: uint

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_trash_slot_count_bonus [RW] :: uint

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_maximum_following_robot_count_bonus [RW] :: uint

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_health_bonus [RW] :: float

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character).

character_personal_logistic_requests_enabled [RW] :: boolean

If personal logistic requests are enabled for this character or players character.

If personal logistic requests are enabled for this character or players character.

vehicle_logistic_requests_enabled [RW] :: boolean

If personal logistic requests are enabled for this vehicle (spidertron).

If personal logistic requests are enabled for this vehicle (spidertron).

opened_gui_type [R] :: defines.gui_type?
build_distance [R] :: uint

The build distance of this character or max uint when not a character or player connected to a character.

The build distance of this character or max uint when not a character or player connected to a character.

drop_item_distance [R] :: uint

The item drop distance of this character or max uint when not a character or player connected to a character.

The item drop distance of this character or max uint when not a character or player connected to a character.

reach_distance [R] :: uint

The reach distance of this character or max uint when not a character or player connected to a character.

The reach distance of this character or max uint when not a character or player connected to a character.

item_pickup_distance [R] :: double

The item pickup distance of this character or max double when not a character or player connected to a character.

The item pickup distance of this character or max double when not a character or player connected to a character.

loot_pickup_distance [R] :: double

The loot pickup distance of this character or max double when not a character or player connected to a character.

The loot pickup distance of this character or max double when not a character or player connected to a character.

resource_reach_distance [R] :: double

The resource reach distance of this character or max double when not a character or player connected to a character.

The resource reach distance of this character or max double when not a character or player connected to a character.

in_combat [R] :: boolean

Whether this character entity is in combat.

Whether this character entity is in combat.

character_running_speed [R] :: double

The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.

The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.

character_mining_progress [R] :: double

The current mining progress between 0 and 1 of this character, or 0 if they aren't mining.

The current mining progress between 0 and 1 of this character, or 0 if they aren't mining.

ClassLuaControlBehaviorabstract

get_circuit_network(wire, circuit_connector?)  → LuaCircuitNetwork
type [R] :: defines.control_behavior.type

The concrete type of this control behavior.

The concrete type of this control behavior.

entity [R] :: LuaEntity

The entity this control behavior belongs to.

The entity this control behavior belongs to.

destroy()

Destroys this tag.

Destroys this tag.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

icon [RW] :: SignalID

This tag's icon, if it has one. [...]

This tag's icon, if it has one. [...]

last_user [RW] :: LuaPlayer?

The player who last edited this tag.

The player who last edited this tag.

position [R] :: MapPosition

The position of this tag.

The position of this tag.

text [RW] :: string
tag_number [R] :: uint

The unique ID for this tag on this force.

The unique ID for this tag on this force.

force [R] :: LuaForce

The force this tag belongs to.

The force this tag belongs to.

surface [R] :: LuaSurface

The surface this tag belongs to.

The surface this tag belongs to.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
key_sequence [R] :: string

The default key sequence for this custom input.

The default key sequence for this custom input.

alternative_key_sequence [R] :: string?

The default alternative key sequence for this custom input, if any

The default alternative key sequence for this custom input, if any

controller_key_sequence [R] :: string?

The default controller key sequence for this custom input, if any

The default controller key sequence for this custom input, if any

controller_alternative_key_sequence [R] :: string?

The default controller alternative key sequence for this custom input, if any

The default controller alternative key sequence for this custom input, if any

linked_game_control [R] :: string?

The linked game control name, if any.

The linked game control name, if any.

consuming [R] :: "none" or "game-only"

The consuming type.

The consuming type.

action [R] :: string

The action that happens when this custom input is triggered.

The action that happens when this custom input is triggered.

enabled [R] :: boolean

Whether this custom input is enabled. [...]

Whether this custom input is enabled. [...]

enabled_while_spectating [R] :: boolean

Whether this custom input is enabled while using the spectator controller.

Whether this custom input is enabled while using the spectator controller.

enabled_while_in_cutscene [R] :: boolean

Whether this custom input is enabled while using the cutscene controller.

Whether this custom input is enabled while using the cutscene controller.

include_selected_prototype [R] :: boolean

Whether this custom input will include the selected prototype (if any) when triggered.

Whether this custom input will include the selected prototype (if any) when triggered.

item_to_spawn [R] :: LuaItemPrototype?

The item that gets spawned when this custom input is fired, if any.

The item that gets spawned when this custom input is fired, if any.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

[] (index) [R] :: Any

Access an element of this custom table.

Access an element of this custom table.

# (length) [R] :: uint

Number of elements in this table.

Number of elements in this table.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
hidden [R] :: boolean

Whether this damage type is hidden from entity tooltips.

Whether this damage type is hidden from entity tooltips.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

parameters [RW] :: DeciderCombinatorParameters

This decider combinator's parameters. [...]

This decider combinator's parameters. [...]

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
collision_box [R] :: BoundingBox

The bounding box used for collision checking.

The bounding box used for collision checking.

collision_mask [R] :: CollisionMask

The collision masks this decorative uses

The collision masks this decorative uses

collision_mask_with_flags [R] :: CollisionMaskWithFlags
autoplace_specification [R] :: AutoplaceSpecification?

Autoplace specification for this decorative prototype, if any.

Autoplace specification for this decorative prototype, if any.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

buffer_capacity [R] :: double
usage_priority [R] :: string
input_flow_limit [R] :: double
output_flow_limit [R] :: double
drain [R] :: double
emissions [R] :: double

The emissions of this energy source in pollution/Joule. [...]

The emissions of this energy source in pollution/Joule. [...]

render_no_network_icon [R] :: boolean
render_no_power_icon [R] :: boolean
valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

ClassLuaEntity extends LuaControl

get_output_inventory()  → LuaInventory?

Gets the entity's output inventory if it has one.

Gets the entity's output inventory if it has one.

get_module_inventory()  → LuaInventory?

Inventory for storing modules of this entity; nil if this entity has no module inventory.

Inventory for storing modules of this entity; nil if this entity has no module inventory.

get_fuel_inventory()  → LuaInventory?

The fuel inventory for this entity or nil if this entity doesn't have a fuel inventory.

The fuel inventory for this entity or nil if this entity doesn't have a fuel inventory.

get_burnt_result_inventory()  → LuaInventory?

The burnt result inventory for this entity or nil if this entity doesn't have a burnt result inventory.

The burnt result inventory for this entity or nil if this entity doesn't have a burnt result inventory.

damage(damage, force, type?, dealer?)  → float

Damages the entity.

Damages the entity.

can_be_destroyed()  → boolean

Whether the entity can be destroyed

Whether the entity can be destroyed

destroy{do_cliff_correction?=…, raise_destroy?=…}  → boolean

Destroys the entity. [...]

Destroys the entity. [...]

set_command(command)

Give the entity a command.

Give the entity a command.

set_distraction_command(command)

Give the entity a distraction command.

Give the entity a distraction command.

has_command()  → boolean

Has this unit been assigned a command?

Has this unit been assigned a command?

die(force?, cause?)  → boolean

Immediately kills the entity. [...]

Immediately kills the entity. [...]

has_flag(flag)  → boolean

Test whether this entity's prototype has a certain flag set. [...]

Test whether this entity's prototype has a certain flag set. [...]

ghost_has_flag(flag)  → boolean

Same as LuaEntity::has_flag, but targets the inner entity on a entity ghost.

Same as LuaEntity::has_flag, but targets the inner entity on a entity ghost.

add_market_item(offer)

Offer a thing on the market.

Offer a thing on the market.

remove_market_item(offer)  → boolean

Remove an offer from a market. [...]

Remove an offer from a market. [...]

get_market_items()  → array[Offer]

Get all offers in a market as an array.

Get all offers in a market as an array.

clear_market_items()

Removes all offers from a market.

Removes all offers from a market.

connect_neighbour(target)  → boolean

Connect two devices with a circuit wire or copper cable. [...]

Connect two devices with a circuit wire or copper cable. [...]

disconnect_neighbour(target?)

Disconnect circuit wires or copper cables between devices. [...]

Disconnect circuit wires or copper cables between devices. [...]

order_deconstruction(force, player?)  → boolean

Sets the entity to be deconstructed by construction robots.

Sets the entity to be deconstructed by construction robots.

cancel_deconstruction(force, player?)

Cancels deconstruction if it is scheduled, does nothing otherwise.

Cancels deconstruction if it is scheduled, does nothing otherwise.

to_be_deconstructed()  → boolean

Is this entity marked for deconstruction?

Is this entity marked for deconstruction?

order_upgrade{force=…, target=…, player?=…, direction?=…}  → boolean

Sets the entity to be upgraded by construction robots.

Sets the entity to be upgraded by construction robots.

cancel_upgrade(force, player?)  → boolean

Cancels upgrade if it is scheduled, does nothing otherwise.

Cancels upgrade if it is scheduled, does nothing otherwise.

to_be_upgraded()  → boolean

Is this entity marked for upgrade?

Is this entity marked for upgrade?

get_request_slot(slot)  → SimpleItemStack?

Get a logistic requester slot. [...]

Get a logistic requester slot. [...]

set_request_slot(request, slot)  → boolean

Set a logistic requester slot. [...]

Set a logistic requester slot. [...]

clear_request_slot(slot)

Clear a logistic requester slot. [...]

Clear a logistic requester slot. [...]

is_crafting()  → boolean

Returns whether a craft is currently in process. [...]

Returns whether a craft is currently in process. [...]

is_opened()  → boolean
is_opening()  → boolean
is_closed()  → boolean
is_closing()  → boolean
request_to_open(force, extra_time?)
request_to_close(force)
get_transport_line(index)  → LuaTransportLine

Get a transport line of a belt or belt connectable entity.

Get a transport line of a belt or belt connectable entity.

get_max_transport_line_index()  → uint

Get the maximum transport line index of a belt or belt connectable entity.

Get the maximum transport line index of a belt or belt connectable entity.

launch_rocket()  → boolean
revive{return_item_request_proxy?=…, raise_revive?=…}  → dictionary[string → uint]?, LuaEntity?, LuaEntity?

Revive a ghost, which turns it from a ghost into a real entity or tile.

Revive a ghost, which turns it from a ghost into a real entity or tile.

silent_revive{return_item_request_proxy?=…, raise_revive?=…}  → dictionary[string → uint]?, LuaEntity?, LuaEntity?

Revives a ghost silently, so the revival makes no sound and no smoke is created.

Revives a ghost silently, so the revival makes no sound and no smoke is created.

get_connected_rail{rail_direction=…, rail_connection_direction=…}  → LuaEntity?, defines.rail_direction?, defines.rail_connection_direction?
get_connected_rails()  → array[LuaEntity]

Get the rails that this signal is connected to.

Get the rails that this signal is connected to.

get_rail_segment_entity(direction, in_else_out)  → LuaEntity?

Get the rail signal or train stop at the start/end of the rail segment this rail is in. [...]

Get the rail signal or train stop at the start/end of the rail segment this rail is in. [...]

get_rail_segment_end(direction)  → LuaEntity, defines.rail_direction

Get the rail at the end of the rail segment this rail is in. [...]

Get the rail at the end of the rail segment this rail is in. [...]

get_rail_segment_rails(direction)  → array[LuaEntity]

Get all rails of a rail segment this rail is in. [...]

Get all rails of a rail segment this rail is in. [...]

get_rail_segment_length()  → double

Get the length of the rail segment this rail is in. [...]

Get the length of the rail segment this rail is in. [...]

get_rail_segment_overlaps()  → array[LuaEntity]

Get a rail from each rail segment that overlaps with this rail's rail segment. [...]

Get a rail from each rail segment that overlaps with this rail's rail segment. [...]

is_rail_in_same_rail_segment_as(other_rail)  → boolean

Checks if this rail and other rail both belong to the same rail segment.

Checks if this rail and other rail both belong to the same rail segment.

is_rail_in_same_rail_block_as(other_rail)  → boolean

Checks if this rail and other rail both belong to the same rail block.

Checks if this rail and other rail both belong to the same rail block.

get_parent_signals()  → array[LuaEntity]

Returns all parent signals. [...]

Returns all parent signals. [...]

get_child_signals()  → array[LuaEntity]

Returns all child signals. [...]

Returns all child signals. [...]

get_inbound_signals()  → array[LuaEntity]

Returns all signals guarding entrance to a rail block this rail belongs to.

Returns all signals guarding entrance to a rail block this rail belongs to.

get_outbound_signals()  → array[LuaEntity]

Returns all signals guarding exit from a rail block this rail belongs to.

Returns all signals guarding exit from a rail block this rail belongs to.

get_filter(slot_index)  → string?

Get the filter for a slot in an inserter, loader, or logistic storage container. [...]

Get the filter for a slot in an inserter, loader, or logistic storage container. [...]

set_filter(slot_index, item)

Set the filter for a slot in an inserter, loader, or logistic storage container. [...]

Set the filter for a slot in an inserter, loader, or logistic storage container. [...]

get_infinity_container_filter(index)  → InfinityInventoryFilter?

Gets the filter for this infinity container at the given index, or nil if the filter index doesn't exist or is empty.

Gets the filter for this infinity container at the given index, or nil if the filter index doesn't exist or is empty.

set_infinity_container_filter(index, filter)

Sets the filter for this infinity container at the given index.

Sets the filter for this infinity container at the given index.

get_infinity_pipe_filter()  → InfinityPipeFilter?

Gets the filter for this infinity pipe, or nil if the filter is empty.

Gets the filter for this infinity pipe, or nil if the filter is empty.

set_infinity_pipe_filter(filter)

Sets the filter for this infinity pipe.

Sets the filter for this infinity pipe.

get_heat_setting()  → HeatSetting

Gets the heat setting for this heat interface.

Gets the heat setting for this heat interface.

set_heat_setting(filter)

Sets the heat setting for this heat interface.

Sets the heat setting for this heat interface.

get_control_behavior()  → LuaControlBehavior?

Gets the control behavior of the entity (if any).

Gets the control behavior of the entity (if any).

get_or_create_control_behavior()  → LuaControlBehavior?

Gets (and or creates if needed) the control behavior of the entity.

Gets (and or creates if needed) the control behavior of the entity.

get_circuit_network(wire, circuit_connector?)  → LuaCircuitNetwork?
get_merged_signal(signal, circuit_connector?)  → int

Read a single signal from the combined circuit networks.

Read a single signal from the combined circuit networks.

get_merged_signals(circuit_connector?)  → array[Signal]?

The merged circuit network signals or nil if there are no signals.

The merged circuit network signals or nil if there are no signals.

supports_backer_name()  → boolean

Whether this entity supports a backer name.

Whether this entity supports a backer name.

copy_settings(entity, by_player?)  → dictionary[string → uint]

Copies settings from the given entity onto this entity.

Copies settings from the given entity onto this entity.

get_logistic_point(index?)  → LuaLogisticPoint or dictionary[defines.logistic_member_index → LuaLogisticPoint]?

Gets all the LuaLogisticPoints that this entity owns. [...]

Gets all the LuaLogisticPoints that this entity owns. [...]

play_note(instrument, note)  → boolean

Plays a note with the given instrument and note.

Plays a note with the given instrument and note.

connect_rolling_stock(direction)  → boolean

Connects the rolling stock in the given direction.

Connects the rolling stock in the given direction.

disconnect_rolling_stock(direction)  → boolean

Tries to disconnect this rolling stock in the given direction.

Tries to disconnect this rolling stock in the given direction.

update_connections()

Reconnect loader, beacon, cliff and mining drill connections to entities that might have been teleported out or in by the script. [...]

Reconnect loader, beacon, cliff and mining drill connections to entities that might have been teleported out or in by the script. [...]

get_recipe()  → LuaRecipe?

Current recipe being assembled by this machine, if any.

Current recipe being assembled by this machine, if any.

set_recipe(recipe)  → dictionary[string → uint]

Sets the given recipe in this assembly machine.

Sets the given recipe in this assembly machine.

rotate{reverse?=…, by_player?=…, spill_items?=…, enable_looted?=…, force?=…}  → boolean, dictionary[string → uint]?

Rotates this entity as if the player rotated it.

Rotates this entity as if the player rotated it.

get_driver()  → LuaEntity or LuaPlayer?

Gets the driver of this vehicle if any.

Gets the driver of this vehicle if any.

set_driver(driver?)

Sets the driver of this vehicle. [...]

Sets the driver of this vehicle. [...]

get_passenger()  → LuaEntity or LuaPlayer?

Gets the passenger of this car or spidertron if any. [...]

Gets the passenger of this car or spidertron if any. [...]

set_passenger(passenger?)

Sets the passenger of this car or spidertron. [...]

Sets the passenger of this car or spidertron. [...]

is_connected_to_electric_network()  → boolean

Returns true if this entity produces or consumes electricity and is connected to an electric network that has at least one entity that can produce power.

Returns true if this entity produces or consumes electricity and is connected to an electric network that has at least one entity that can produce power.

get_train_stop_trains()  → array[LuaTrain]

The trains scheduled to stop at this train stop.

The trains scheduled to stop at this train stop.

get_stopped_train()  → LuaTrain?

The train currently stopped at this train stop, if any.

The train currently stopped at this train stop, if any.

clone{position=…, surface?=…, force?=…, create_build_effect_smoke?=…}  → LuaEntity?

Clones this entity.

Clones this entity.

get_fluid_count(fluid?)  → double

Get the amount of all or some fluid in this entity. [...]

Get the amount of all or some fluid in this entity. [...]

get_fluid_contents()  → dictionary[string → double]

Get amounts of all fluids in this entity. [...]

Get amounts of all fluids in this entity. [...]

remove_fluid{name=…, amount=…, minimum_temperature?=…, maximum_temperature?=…, temperature?=…}  → double

Remove fluid from this entity. [...]

Remove fluid from this entity. [...]

insert_fluid(fluid)  → double

Insert fluid into this entity. [...]

Insert fluid into this entity. [...]

clear_fluid_inside()

Remove all fluids from this entity.

Remove all fluids from this entity.

get_beam_source()  → BeamTarget?

Get the source of this beam.

Get the source of this beam.

set_beam_source(source)

Set the source of this beam.

Set the source of this beam.

get_beam_target()  → BeamTarget?

Get the target of this beam.

Get the target of this beam.

set_beam_target(target)

Set the target of this beam.

Set the target of this beam.

get_radius()  → double

The radius of this entity.

The radius of this entity.

get_health_ratio()  → float?

The health ratio of this entity between 1 and 0 (for full health and no health respectively).

The health ratio of this entity between 1 and 0 (for full health and no health respectively).

create_build_effect_smoke()

Creates the same smoke that is created when you place a building by hand. [...]

Creates the same smoke that is created when you place a building by hand. [...]

release_from_spawner()

Release the unit from the spawner which spawned it. [...]

Release the unit from the spawner which spawned it. [...]

toggle_equipment_movement_bonus()

Toggle this entity's equipment movement bonus. [...]

Toggle this entity's equipment movement bonus. [...]

can_shoot(target, position)  → boolean

Whether this character can shoot the given entity or position.

Whether this character can shoot the given entity or position.

start_fading_out()

Only works if the entity is a speech-bubble, with an "effect" defined in its wrapper_flow_style. [...]

Only works if the entity is a speech-bubble, with an "effect" defined in its wrapper_flow_style. [...]

get_upgrade_target()  → LuaEntityPrototype?

Returns the new entity prototype.

Returns the new entity prototype.

get_upgrade_direction()  → defines.direction?

Returns the new entity direction after upgrading.

Returns the new entity direction after upgrading.

get_damage_to_be_taken()  → float?

Returns the amount of damage to be taken by this entity.

Returns the amount of damage to be taken by this entity.

deplete()

Depletes and destroys this resource entity.

Depletes and destroys this resource entity.

mine{inventory?=…, force?=…, raise_destroyed?=…, ignore_minable?=…}  → boolean

Mines this entity. [...]

Mines this entity. [...]

spawn_decorations()

Triggers spawn_decoration actions defined in the entity prototype or does nothing if entity is not "turret" or "unit-spawner".

Triggers spawn_decoration actions defined in the entity prototype or does nothing if entity is not "turret" or "unit-spawner".

can_wires_reach(entity)  → boolean

Can wires reach between these entities.

Can wires reach between these entities.

get_connected_rolling_stock(direction)  → LuaEntity?, defines.rail_direction?

Gets rolling stock connected to the given end of this stock.

Gets rolling stock connected to the given end of this stock.

is_registered_for_construction()  → boolean

Is this entity or tile ghost or item request proxy registered for construction? [...]

Is this entity or tile ghost or item request proxy registered for construction? [...]

is_registered_for_deconstruction(force)  → boolean

Is this entity registered for deconstruction with this force? [...]

Is this entity registered for deconstruction with this force? [...]

is_registered_for_upgrade()  → boolean

Is this entity registered for upgrade? [...]

Is this entity registered for upgrade? [...]

is_registered_for_repair()  → boolean

Is this entity registered for repair? [...]

Is this entity registered for repair? [...]

add_autopilot_destination(position)

Adds the given position to this spidertron's autopilot's queue of destinations.

Adds the given position to this spidertron's autopilot's queue of destinations.

connect_linked_belts(neighbour)

Connects current linked belt with another one. [...]

Connects current linked belt with another one. [...]

disconnect_linked_belts()

Disconnects linked belt from its neighbour. [...]

Disconnects linked belt from its neighbour. [...]

get_spider_legs()  → array[LuaEntity]

Gets legs of given SpiderVehicle.

Gets legs of given SpiderVehicle.

stop_spider()

Sets the speed of the given SpiderVehicle to zero. [...]

Sets the speed of the given SpiderVehicle to zero. [...]

get_beacons()  → array[LuaEntity]?

Returns a table with all beacons affecting this effect receiver. [...]

Returns a table with all beacons affecting this effect receiver. [...]

get_beacon_effect_receivers()  → array[LuaEntity]

Returns a table with all entities affected by this beacon

Returns a table with all entities affected by this beacon

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of the entity prototype. [...]

Name of the entity prototype. [...]

ghost_name [R] :: string

Name of the entity or tile contained in this ghost

Name of the entity or tile contained in this ghost

localised_name [R] :: LocalisedString

Localised name of the entity.

Localised name of the entity.

localised_description [R] :: LocalisedString
ghost_localised_name [R] :: LocalisedString

Localised name of the entity or tile contained in this ghost.

Localised name of the entity or tile contained in this ghost.

ghost_localised_description [R] :: LocalisedString
type [R] :: string

The entity prototype type of this entity.

The entity prototype type of this entity.

ghost_type [R] :: string

The prototype type of the entity or tile contained in this ghost.

The prototype type of the entity or tile contained in this ghost.

active [RW] :: boolean

Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will stop moving etc). [...]

Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will stop moving etc). [...]

destructible [RW] :: boolean

If set to false, this entity can't be damaged and won't be attacked automatically. [...]

If set to false, this entity can't be damaged and won't be attacked automatically. [...]

minable [RW] :: boolean

Not minable entities can still be destroyed. [...]

Not minable entities can still be destroyed. [...]

rotatable [RW] :: boolean

When entity is not to be rotatable (inserter, transport belt etc), it can't be rotated by player using the R key. [...]

When entity is not to be rotatable (inserter, transport belt etc), it can't be rotated by player using the R key. [...]

operable [RW] :: boolean

Player can't open gui of this entity and he can't quick insert/input stuff in to the entity when it is not operable.

Player can't open gui of this entity and he can't quick insert/input stuff in to the entity when it is not operable.

health [RW] :: float?

The current health of the entity, if any. [...]

The current health of the entity, if any. [...]

direction [RW] :: defines.direction

The current direction this entity is facing.

The current direction this entity is facing.

supports_direction [R] :: boolean

Whether the entity has direction. [...]

Whether the entity has direction. [...]

orientation [RW] :: RealOrientation

The smooth orientation of this entity.

The smooth orientation of this entity.

cliff_orientation [R] :: CliffOrientation

The orientation of this cliff.

The orientation of this cliff.

relative_turret_orientation [RW] :: RealOrientation?

The relative orientation of the vehicle turret, artillery turret, artillery wagon. [...]

The relative orientation of the vehicle turret, artillery turret, artillery wagon. [...]

torso_orientation [RW] :: RealOrientation

The torso orientation of this spider vehicle.

The torso orientation of this spider vehicle.

amount [RW] :: uint

Count of resource units contained.

Count of resource units contained.

initial_amount [RW] :: uint?

Count of initial resource units contained. [...]

Count of initial resource units contained. [...]

effectivity_modifier [RW] :: float

Multiplies the acceleration the vehicle can create for one unit of energy. [...]

Multiplies the acceleration the vehicle can create for one unit of energy. [...]

consumption_modifier [RW] :: float

Multiplies the energy consumption.

Multiplies the energy consumption.

friction_modifier [RW] :: float

Multiplies the car friction rate.

Multiplies the car friction rate.

driver_is_gunner [RW] :: boolean?

Whether the driver of this car or spidertron is the gunner. [...]

Whether the driver of this car or spidertron is the gunner. [...]

vehicle_automatic_targeting_parameters [RW] :: VehicleAutomaticTargetingParameters

Read when this spidertron auto-targets enemies

Read when this spidertron auto-targets enemies

speed [RW] :: float?

The current speed if this is a car, rolling stock, projectile or spidertron, or the maximum speed if this is a unit. [...]

The current speed if this is a car, rolling stock, projectile or spidertron, or the maximum speed if this is a unit. [...]

effective_speed [R] :: float?

The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the tile the unit is standing on. [...]

The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the tile the unit is standing on. [...]

stack [R] :: LuaItemStack
prototype [R] :: LuaEntityPrototype

The entity prototype of this entity.

The entity prototype of this entity.

ghost_prototype [R] :: LuaEntityPrototype or LuaTilePrototype

The prototype of the entity or tile contained in this ghost.

The prototype of the entity or tile contained in this ghost.

drop_position [RW] :: MapPosition

Position where the entity puts its stuff. [...]

Position where the entity puts its stuff. [...]

pickup_position [RW] :: MapPosition

Where the inserter will pick up items from. [...]

Where the inserter will pick up items from. [...]

drop_target [RW] :: LuaEntity?

The entity this entity is putting its items to. [...]

The entity this entity is putting its items to. [...]

pickup_target [RW] :: LuaEntity?

The entity this inserter will attempt to pick up items from. [...]

The entity this inserter will attempt to pick up items from. [...]

selected_gun_index [RW] :: uint?

Index of the currently selected weapon slot of this character, car, or spidertron. [...]

Index of the currently selected weapon slot of this character, car, or spidertron. [...]

energy [RW] :: double

Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.). [...]

Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.). [...]

temperature [RW] :: double?

The temperature of this entity's heat energy source. [...]

The temperature of this entity's heat energy source. [...]

previous_recipe [R] :: LuaRecipe?

The previous recipe this furnace was using, if any.

The previous recipe this furnace was using, if any.

held_stack [R] :: LuaItemStack

The item stack currently held in an inserter's hand.

The item stack currently held in an inserter's hand.

held_stack_position [R] :: MapPosition

Current position of the inserter's "hand".

Current position of the inserter's "hand".

train [R] :: LuaTrain?

The train this rolling stock belongs to, if any. [...]

The train this rolling stock belongs to, if any. [...]

neighbours [R] :: dictionary[string → array[LuaEntity]] or array[array[LuaEntity]] or LuaEntity

A list of neighbours for certain types of entities. [...]

A list of neighbours for certain types of entities. [...]

belt_neighbours [R] :: table

The belt connectable neighbours of this belt connectable entity. [...]

The belt connectable neighbours of this belt connectable entity. [...]

fluidbox [W] :: LuaFluidBox

Fluidboxes of this entity.

Fluidboxes of this entity.

backer_name [RW] :: string?

The backer name assigned to this entity. [...]

The backer name assigned to this entity. [...]

entity_label [RW] :: string?

The label on this spider-vehicle entity, if any. [...]

The label on this spider-vehicle entity, if any. [...]

time_to_live [RW] :: uint

The ticks left before a ghost, combat robot, highlight box, smoke with trigger or sticker is destroyed. [...]

The ticks left before a ghost, combat robot, highlight box, smoke with trigger or sticker is destroyed. [...]

color [RW] :: Color?

The color of this character, rolling stock, train stop, car, spider-vehicle, flying text, corpse or simple-entity-with-owner. [...]

The color of this character, rolling stock, train stop, car, spider-vehicle, flying text, corpse or simple-entity-with-owner. [...]

text [RW] :: LocalisedString

The text of this flying-text entity.

The text of this flying-text entity.

signal_state [R] :: defines.signal_state

The state of this rail signal.

The state of this rail signal.

chain_signal_state [R] :: defines.chain_signal_state

The state of this chain signal.

The state of this chain signal.

to_be_looted [RW] :: boolean

Will this entity be picked up automatically when the player walks over it?

Will this entity be picked up automatically when the player walks over it?

crafting_speed [R] :: double

The current crafting speed, including speed bonuses from modules and beacons.

The current crafting speed, including speed bonuses from modules and beacons.

crafting_progress [RW] :: float

The current crafting progress, as a number in range [0, 1].

The current crafting progress, as a number in range [0, 1].

bonus_progress [RW] :: double

The current productivity bonus progress, as a number in range [0, 1].

The current productivity bonus progress, as a number in range [0, 1].

productivity_bonus [R] :: double

The productivity bonus of this entity. [...]

The productivity bonus of this entity. [...]

pollution_bonus [R] :: double

The pollution bonus of this entity.

The pollution bonus of this entity.

speed_bonus [R] :: double

The speed bonus of this entity. [...]

The speed bonus of this entity. [...]

consumption_bonus [R] :: double

The consumption bonus of this entity.

The consumption bonus of this entity.

belt_to_ground_type [R] :: "input" or "output"

Whether this underground belt goes into or out of the ground.

Whether this underground belt goes into or out of the ground.

loader_type [RW] :: "input" or "output"

Whether this loader gets items from or puts item into a container.

Whether this loader gets items from or puts item into a container.

rocket_parts [RW] :: uint

Number of rocket parts in the silo.

Number of rocket parts in the silo.

logistic_network [RW] :: LuaLogisticNetwork

The logistic network this entity is a part of, or nil if this entity is not a part of any logistic network.

The logistic network this entity is a part of, or nil if this entity is not a part of any logistic network.

logistic_cell [R] :: LuaLogisticCell

The logistic cell this entity is a part of. [...]

The logistic cell this entity is a part of. [...]

item_requests [RW] :: dictionary[string → uint]

Items this ghost will request when revived or items this item request proxy is requesting. [...]

Items this ghost will request when revived or items this item request proxy is requesting. [...]

player [R] :: LuaPlayer?

The player connected to this character, if any.

The player connected to this character, if any.

unit_group [R] :: LuaUnitGroup?

The unit group this unit is a member of, if any.

The unit group this unit is a member of, if any.

damage_dealt [RW] :: double

The damage dealt by this turret, artillery turret, or artillery wagon.

The damage dealt by this turret, artillery turret, or artillery wagon.

kills [RW] :: uint

The number of units killed by this turret, artillery turret, or artillery wagon.

The number of units killed by this turret, artillery turret, or artillery wagon.

last_user [RW] :: LuaPlayer or PlayerIdentification?

The last player that changed any setting on this entity. [...]

The last player that changed any setting on this entity. [...]

electric_buffer_size [RW] :: double?

The buffer size for the electric energy source. [...]

The buffer size for the electric energy source. [...]

electric_input_flow_limit [R] :: double?

The input flow limit for the electric energy source. [...]

The input flow limit for the electric energy source. [...]

electric_output_flow_limit [R] :: double?

The output flow limit for the electric energy source. [...]

The output flow limit for the electric energy source. [...]

electric_drain [R] :: double?

The electric drain for the electric energy source. [...]

The electric drain for the electric energy source. [...]

electric_emissions [R] :: double?

The emissions for the electric energy source. [...]

The emissions for the electric energy source. [...]

unit_number [R] :: uint?

A unique number identifying this entity for the lifetime of the save. [...]

A unique number identifying this entity for the lifetime of the save. [...]

ghost_unit_number [R] :: uint?

The unit_number of the entity contained in this ghost. [...]

The unit_number of the entity contained in this ghost. [...]

mining_progress [RW] :: double?

The mining progress for this mining drill. [...]

The mining progress for this mining drill. [...]

bonus_mining_progress [RW] :: double?

The bonus mining progress for this mining drill. [...]

The bonus mining progress for this mining drill. [...]

power_production [RW] :: double

The power production specific to the ElectricEnergyInterface entity type.

The power production specific to the ElectricEnergyInterface entity type.

power_usage [RW] :: double

The power usage specific to the ElectricEnergyInterface entity type.

The power usage specific to the ElectricEnergyInterface entity type.

bounding_box [R] :: BoundingBox

LuaEntityPrototype::collision_box around entity's given position and respecting the current entity orientation.

LuaEntityPrototype::collision_box around entity's given position and respecting the current entity orientation.

secondary_bounding_box [R] :: BoundingBox?

The secondary bounding box of this entity or nil if it doesn't have one. [...]

The secondary bounding box of this entity or nil if it doesn't have one. [...]

selection_box [R] :: BoundingBox

LuaEntityPrototype::selection_box around entity's given position and respecting the current entity orientation.

LuaEntityPrototype::selection_box around entity's given position and respecting the current entity orientation.

secondary_selection_box [R] :: BoundingBox?

The secondary selection box of this entity or nil if it doesn't have one. [...]

The secondary selection box of this entity or nil if it doesn't have one. [...]

mining_target [R] :: LuaEntity?

The mining target, if any.

The mining target, if any.

circuit_connected_entities [R] :: table?

Entities that are directly connected to this entity via the circuit network. [...]

Entities that are directly connected to this entity via the circuit network. [...]

circuit_connection_definitions [R] :: array[CircuitConnectionDefinition]?

The connection definition for entities that are directly connected to this entity via the circuit network. [...]

The connection definition for entities that are directly connected to this entity via the circuit network. [...]

copper_connection_definitions [R] :: array[CopperConnectionDefinition]

The connection definition for entities that are directly connected to this entity via copper cables. [...]

The connection definition for entities that are directly connected to this entity via copper cables. [...]

request_slot_count [R] :: uint

The index of the configured request with the highest index for this entity. [...]

The index of the configured request with the highest index for this entity. [...]

filter_slot_count [R] :: uint

The number of filter slots this inserter, loader, or logistic storage container has. [...]

The number of filter slots this inserter, loader, or logistic storage container has. [...]

loader_container [R] :: LuaEntity?

The container entity this loader is pointing at/pulling from depending on the LuaEntity::loader_type, if any.

The container entity this loader is pointing at/pulling from depending on the LuaEntity::loader_type, if any.

grid [R] :: LuaEquipmentGrid?

This entity's equipment grid, if any.

This entity's equipment grid, if any.

graphics_variation [RW] :: uint8?

The graphics variation for this entity. [...]

The graphics variation for this entity. [...]

tree_color_index [RW] :: uint8

Index of the tree color.

Index of the tree color.

tree_color_index_max [R] :: uint8

Maximum index of the tree colors.

Maximum index of the tree colors.

tree_stage_index [RW] :: uint8

Index of the tree stage.

Index of the tree stage.

tree_stage_index_max [R] :: uint8

Maximum index of the tree stages.

Maximum index of the tree stages.

tree_gray_stage_index [RW] :: uint8

Index of the tree gray stage

Index of the tree gray stage

tree_gray_stage_index_max [R] :: uint8

Maximum index of the tree gray stages.

Maximum index of the tree gray stages.

burner [R] :: LuaBurner?

The burner energy source for this entity, if any.

The burner energy source for this entity, if any.

shooting_target [RW] :: LuaEntity?

The shooting target for this turret, if any. [...]

The shooting target for this turret, if any. [...]

proxy_target [R] :: LuaEntity?

The target entity for this item-request-proxy, if any.

The target entity for this item-request-proxy, if any.

stickers [R] :: array[LuaEntity]?

The sticker entities attached to this entity, if any.

The sticker entities attached to this entity, if any.

sticked_to [R] :: LuaEntity

The entity this sticker is sticked to.

The entity this sticker is sticked to.

sticker_vehicle_modifiers [R] :: table?

The vehicle modifiers applied to this entity through the attached stickers.

The vehicle modifiers applied to this entity through the attached stickers.

parameters [RW] :: ProgrammableSpeakerParameters
alert_parameters [RW] :: ProgrammableSpeakerAlertParameters
electric_network_statistics [R] :: LuaFlowStatistics

The electric network statistics for this electric pole.

The electric network statistics for this electric pole.

inserter_target_pickup_count [R] :: uint

Returns the current target pickup count of the inserter. [...]

Returns the current target pickup count of the inserter. [...]

inserter_stack_size_override [RW] :: uint

Sets the stack size limit on this inserter. [...]

Sets the stack size limit on this inserter. [...]

products_finished [RW] :: uint

The number of products this machine finished crafting in its lifetime.

The number of products this machine finished crafting in its lifetime.

spawner [R] :: LuaEntity?

The spawner associated with this unit entity, if any.

The spawner associated with this unit entity, if any.

spawning_cooldown [R] :: double
absorbed_pollution [R] :: double
spawn_shift [R] :: double
units [R] :: array[LuaEntity]

The units associated with this spawner entity.

The units associated with this spawner entity.

power_switch_state [RW] :: boolean

The state of this power switch.

The state of this power switch.

effects [R] :: ModuleEffects?

The effects being applied to this entity, if any. [...]

The effects being applied to this entity, if any. [...]

beacons_count [R] :: uint?

Number of beacons affecting this effect receiver. [...]

Number of beacons affecting this effect receiver. [...]

infinity_container_filters [RW] :: array[InfinityInventoryFilter]

The filters for this infinity container.

The filters for this infinity container.

remove_unfiltered_items [RW] :: boolean

Whether items not included in this infinity container filters should be removed from the container.

Whether items not included in this infinity container filters should be removed from the container.

character_corpse_player_index [RW] :: uint

The player index associated with this character corpse. [...]

The player index associated with this character corpse. [...]

character_corpse_tick_of_death [RW] :: uint

The tick this character corpse died at.

The tick this character corpse died at.

character_corpse_death_cause [RW] :: LocalisedString

The reason this character corpse character died. [...]

The reason this character corpse character died. [...]

associated_player [RW] :: LuaPlayer or PlayerIdentification?

The player this character is associated with, if any. [...]

The player this character is associated with, if any. [...]

tick_of_last_attack [RW] :: uint

The last tick this character entity was attacked.

The last tick this character entity was attacked.

tick_of_last_damage [RW] :: uint

The last tick this character entity was damaged.

The last tick this character entity was damaged.

splitter_filter [RW] :: LuaItemPrototype?

The filter for this splitter, if any is set.

The filter for this splitter, if any is set.

inserter_filter_mode [RW] :: "whitelist" or "blacklist"?

The filter mode for this filter inserter. [...]

The filter mode for this filter inserter. [...]

splitter_input_priority [RW] :: "left" or "none" or "right"

The input priority for this splitter.

The input priority for this splitter.

splitter_output_priority [RW] :: "left" or "none" or "right"

The output priority for this splitter.

The output priority for this splitter.

armed [R] :: boolean

Whether this land mine is armed.

Whether this land mine is armed.

recipe_locked [RW] :: boolean

When locked; the recipe in this assembling machine can't be changed by the player.

When locked; the recipe in this assembling machine can't be changed by the player.

connected_rail [R] :: LuaEntity?

The rail entity this train stop is connected to, if any.

The rail entity this train stop is connected to, if any.

connected_rail_direction [R] :: defines.rail_direction

Rail direction to which this train stop is binding. [...]

Rail direction to which this train stop is binding. [...]

trains_in_block [R] :: uint

The number of trains in this rail block for this rail entity.

The number of trains in this rail block for this rail entity.

timeout [RW] :: uint

The timeout that's left on this landmine in ticks. [...]

The timeout that's left on this landmine in ticks. [...]

neighbour_bonus [R] :: double

The current total neighbour bonus of this reactor.

The current total neighbour bonus of this reactor.

ai_settings [R] :: LuaAISettings

The ai settings of this unit.

The ai settings of this unit.

highlight_box_type [RW] :: CursorBoxRenderType

The highlight box type of this highlight box entity.

The highlight box type of this highlight box entity.

highlight_box_blink_interval [RW] :: uint

The blink interval of this highlight box entity. [...]

The blink interval of this highlight box entity. [...]

status [R] :: defines.entity_status?

The status of this entity, if any.

The status of this entity, if any.

enable_logistics_while_moving [RW] :: boolean

Whether equipment grid logistics are enabled while this vehicle is moving.

Whether equipment grid logistics are enabled while this vehicle is moving.

render_player [RW] :: LuaPlayer or PlayerIdentification?

The player that this simple-entity-with-owner, simple-entity-with-force, flying-text, or highlight-box is visible to. [...]

The player that this simple-entity-with-owner, simple-entity-with-force, flying-text, or highlight-box is visible to. [...]

render_to_forces [RW] :: array[ForceIdentification]?

The forces that this simple-entity-with-owner, simple-entity-with-force, or flying-text is visible to. [...]

The forces that this simple-entity-with-owner, simple-entity-with-force, or flying-text is visible to. [...]

pump_rail_target [R] :: LuaEntity?

The rail target of this pump, if any.

The rail target of this pump, if any.

moving [R] :: boolean

Returns true if this unit is moving.

Returns true if this unit is moving.

electric_network_id [R] :: uint?

Returns the id of the electric network that this entity is connected to, if any.

Returns the id of the electric network that this entity is connected to, if any.

allow_dispatching_robots [RW] :: boolean

Whether this character's personal roboports are allowed to dispatch robots.

Whether this character's personal roboports are allowed to dispatch robots.

auto_launch [RW] :: boolean

Whether this rocket silo automatically launches the rocket when cargo is inserted.

Whether this rocket silo automatically launches the rocket when cargo is inserted.

energy_generated_last_tick [R] :: double

How much energy this generator generated in the last tick.

How much energy this generator generated in the last tick.

storage_filter [RW] :: LuaItemPrototype?

The storage filter for this logistic storage container.

The storage filter for this logistic storage container.

request_from_buffers [RW] :: boolean

Whether this requester chest is set to also request from buffer chests. [...]

Whether this requester chest is set to also request from buffer chests. [...]

corpse_expires [RW] :: boolean

Whether this corpse will ever fade away.

Whether this corpse will ever fade away.

corpse_immune_to_entity_placement [RW] :: boolean

If true, corpse won't be destroyed when entities are placed over it. [...]

If true, corpse won't be destroyed when entities are placed over it. [...]

tags [RW] :: Tags?

The tags associated with this entity ghost. [...]

The tags associated with this entity ghost. [...]

command [R] :: Command?

The command given to this unit, if any.

The command given to this unit, if any.

distraction_command [R] :: Command?

The distraction command given to this unit, if any.

The distraction command given to this unit, if any.

time_to_next_effect [RW] :: uint

The ticks until the next trigger effect of this smoke-with-trigger.

The ticks until the next trigger effect of this smoke-with-trigger.

autopilot_destination [RW] :: MapPosition?

Destination of this spidertron's autopilot, if any. [...]

Destination of this spidertron's autopilot, if any. [...]

autopilot_destinations [R] :: array[MapPosition]

The queued destination positions of spidertron's autopilot.

The queued destination positions of spidertron's autopilot.

trains_count [R] :: uint

Amount of trains related to this particular train stop. [...]

Amount of trains related to this particular train stop. [...]

trains_limit [RW] :: uint

Amount of trains above which no new trains will be sent to this train stop. [...]

Amount of trains above which no new trains will be sent to this train stop. [...]

is_entity_with_force [R] :: boolean

(deprecated by 1.1.51) If this entity is a MilitaryTarget. [...]

(deprecated by 1.1.51) If this entity is a MilitaryTarget. [...]

is_military_target [RW] :: boolean

Whether this entity is a MilitaryTarget. [...]

Whether this entity is a MilitaryTarget. [...]

is_entity_with_owner [R] :: boolean

If this entity is EntityWithOwner

If this entity is EntityWithOwner

is_entity_with_health [R] :: boolean

If this entity is EntityWithHealth

If this entity is EntityWithHealth

combat_robot_owner [RW] :: LuaEntity?

The owner of this combat robot, if any.

The owner of this combat robot, if any.

link_id [RW] :: uint

The link ID this linked container is using.

The link ID this linked container is using.

follow_target [RW] :: LuaEntity?

The follow target of this spidertron, if any.

The follow target of this spidertron, if any.

follow_offset [RW] :: Vector?

The follow offset of this spidertron, if any entity is being followed. [...]

The follow offset of this spidertron, if any entity is being followed. [...]

linked_belt_type [RW] :: "input" or "output"

Type of linked belt. [...]

Type of linked belt. [...]

linked_belt_neighbour [R] :: LuaEntity?

Neighbour to which this linked belt is connected to, if any. [...]

Neighbour to which this linked belt is connected to, if any. [...]

radar_scan_progress [R] :: float

The current radar scan progress, as a number in range [0, 1].

The current radar scan progress, as a number in range [0, 1].

rocket_silo_status [R] :: defines.rocket_silo_status

The status of this rocket silo entity.

The status of this rocket silo entity.

tile_width [R] :: uint

Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). [...]

Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). [...]

tile_height [R] :: uint

Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). [...]

Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). [...]

is_headed_to_trains_front [R] :: boolean

If the rolling stock is facing train's front.

If the rolling stock is facing train's front.

draw_data [R] :: RollingStockDrawData

Gives a draw data of the given entity if it supports such data.

Gives a draw data of the given entity if it supports such data.

belt_shape [R] :: "straight" or "left" or "right"

Gives what is the current shape of a transport-belt. [...]

Gives what is the current shape of a transport-belt. [...]

gps_tag [R] :: string

Returns a rich text string containing this entity's position and surface name as a gps tag. [...]

Returns a rich text string containing this entity's position and surface name as a gps tag. [...]

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

has_flag(flag)  → boolean

Test whether this entity prototype has a certain flag set.

Test whether this entity prototype has a certain flag set.

get_inventory_size(index)  → uint?

Gets the base size of the given inventory on this entity or nil if the given inventory doesn't exist.

Gets the base size of the given inventory on this entity or nil if the given inventory doesn't exist.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

type [R] :: string

Type of this prototype.

Type of this prototype.

name [R] :: string

Name of this prototype.

Name of this prototype.

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
max_health [R] :: float

Max health of this entity. [...]

Max health of this entity. [...]

infinite_resource [R] :: boolean?

Whether this resource is infinite.

Whether this resource is infinite.

minimum_resource_amount [R] :: uint?

Minimum amount of this resource.

Minimum amount of this resource.

normal_resource_amount [R] :: uint?

The normal amount for this resource.

The normal amount for this resource.

infinite_depletion_resource_amount [R] :: uint?

Every time this infinite resource 'ticks' down, it is reduced by this amount. [...]

Every time this infinite resource 'ticks' down, it is reduced by this amount. [...]

resource_category [R] :: string?

Name of the category of this resource. [...]

Name of the category of this resource. [...]

mineable_properties [R] :: table

Whether this entity is minable and what can be obtained by mining it.

Whether this entity is minable and what can be obtained by mining it.

items_to_place_this [R] :: array[ItemStackDefinition]?

Items that when placed will produce this entity, if any. [...]

Items that when placed will produce this entity, if any. [...]

collision_box [R] :: BoundingBox

The bounding box used for collision checking.

The bounding box used for collision checking.

secondary_collision_box [R] :: BoundingBox?

The secondary bounding box used for collision checking, if any. [...]

The secondary bounding box used for collision checking, if any. [...]

map_generator_bounding_box [R] :: BoundingBox

The bounding box used for map generator collision checking.

The bounding box used for map generator collision checking.

selection_box [R] :: BoundingBox

The bounding box used for drawing selection.

The bounding box used for drawing selection.

drawing_box [R] :: BoundingBox

The bounding box used for drawing the entity icon.

The bounding box used for drawing the entity icon.

sticker_box [R] :: BoundingBox

The bounding box used to attach sticker type entities.

The bounding box used to attach sticker type entities.

collision_mask [R] :: CollisionMask

The collision masks this entity uses

The collision masks this entity uses

collision_mask_with_flags [R] :: CollisionMaskWithFlags
default_collision_mask_with_flags [R] :: CollisionMaskWithFlags

The hardcoded default collision mask (with flags) for this entity prototype type.

The hardcoded default collision mask (with flags) for this entity prototype type.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

group [R] :: LuaGroup

Group of this entity.

Group of this entity.

subgroup [R] :: LuaGroup

Subgroup of this entity.

Subgroup of this entity.

healing_per_tick [R] :: float?

Amount this entity can heal per tick, if any.

Amount this entity can heal per tick, if any.

emissions_per_second [R] :: double

Amount of pollution emissions per second this entity will create.

Amount of pollution emissions per second this entity will create.

corpses [R] :: dictionary[string → LuaEntityPrototype]?

Corpses used when this entity is destroyed. [...]

Corpses used when this entity is destroyed. [...]

selectable_in_game [R] :: boolean

Is this entity selectable?

Is this entity selectable?

selection_priority [R] :: uint

The selection priority of this entity - a value between 0 and 255

The selection priority of this entity - a value between 0 and 255

weight [R] :: double?

The weight of this vehicle prototype.

The weight of this vehicle prototype.

resistances [R] :: dictionary[string → Resistance]?

List of resistances towards each damage type. [...]

List of resistances towards each damage type. [...]

fast_replaceable_group [R] :: string?

The group of mutually fast-replaceable entities, if any.

The group of mutually fast-replaceable entities, if any.

next_upgrade [R] :: LuaEntityPrototype?

The next upgrade for this entity, if any.

The next upgrade for this entity, if any.

loot [R] :: array[Loot]?

Loot that will be dropped when this entity is killed, if any.

Loot that will be dropped when this entity is killed, if any.

repair_speed_modifier [R] :: uint?

Repair-speed modifier for this entity, if any. [...]

Repair-speed modifier for this entity, if any. [...]

turret_range [R] :: uint?

The range of this turret.

The range of this turret.

autoplace_specification [R] :: AutoplaceSpecification?

Autoplace specification for this entity prototype, if any.

Autoplace specification for this entity prototype, if any.

belt_speed [R] :: double?

The speed of this transport belt.

The speed of this transport belt.

result_units [R] :: array[UnitSpawnDefinition]?

The result units and spawn points with weight and evolution factor for a biter spawner entity.

The result units and spawn points with weight and evolution factor for a biter spawner entity.

attack_result [R] :: array[TriggerItem]?

The attack result of this entity, if any.

The attack result of this entity, if any.

final_attack_result [R] :: array[TriggerItem]?

The final attack result for this projectile.

The final attack result for this projectile.

attack_parameters [R] :: AttackParameters?

The attack parameters for this entity, if any.

The attack parameters for this entity, if any.

spawn_cooldown [R] :: table?

The spawning cooldown for this enemy spawner prototype.

The spawning cooldown for this enemy spawner prototype.

mining_drill_radius [R] :: double?

The mining radius of this mining drill prototype.

The mining radius of this mining drill prototype.

mining_speed [R] :: double?

The mining speed of this mining drill/character prototype.

The mining speed of this mining drill/character prototype.

logistic_mode [R] :: "requester" or "active-provider" or "passive-provider" or "buffer" or "storage" or "none"?

The logistic mode of this logistic container.

The logistic mode of this logistic container.

max_underground_distance [R] :: uint8?

The max underground distance for underground belts and underground pipes.

The max underground distance for underground belts and underground pipes.

flags [R] :: EntityPrototypeFlags

The flags for this entity prototype.

The flags for this entity prototype.

remains_when_mined [R] :: array[LuaEntityPrototype]

The remains left behind when this entity is mined.

The remains left behind when this entity is mined.

additional_pastable_entities [R] :: array[LuaEntityPrototype]

Entities this entity can be pasted onto in addition to the normal allowed ones.

Entities this entity can be pasted onto in addition to the normal allowed ones.

allow_copy_paste [R] :: boolean

When false copy-paste is not allowed for this entity.

When false copy-paste is not allowed for this entity.

shooting_cursor_size [R] :: float

The cursor size used when shooting at this entity.

The cursor size used when shooting at this entity.

created_smoke [R] :: table?

The smoke trigger run when this entity is built, if any.

The smoke trigger run when this entity is built, if any.

created_effect [R] :: array[TriggerItem]?

The trigger to run when this entity is created, if any.

The trigger to run when this entity is created, if any.

map_color [R] :: Color?

The map color used when charting this entity if a friendly or enemy color isn't defined, if any.

The map color used when charting this entity if a friendly or enemy color isn't defined, if any.

friendly_map_color [R] :: Color

The friendly map color used when charting this entity.

The friendly map color used when charting this entity.

enemy_map_color [R] :: Color

The enemy map color used when charting this entity.

The enemy map color used when charting this entity.

build_base_evolution_requirement [R] :: double

The evolution requirement to build this entity as a base when expanding enemy bases.

The evolution requirement to build this entity as a base when expanding enemy bases.

instruments [R] :: array[ProgrammableSpeakerInstrument]?

The instruments for this programmable speaker.

The instruments for this programmable speaker.

max_polyphony [R] :: uint?

The maximum polyphony for this programmable speaker.

The maximum polyphony for this programmable speaker.

module_inventory_size [R] :: uint?

The module inventory size. [...]

The module inventory size. [...]

ingredient_count [R] :: uint?

The max number of ingredients this crafting machine prototype supports.

The max number of ingredients this crafting machine prototype supports.

crafting_speed [R] :: double?

The crafting speed.

The crafting speed.

crafting_categories [R] :: dictionary[string → true]?

The crafting categories this entity prototype supports. [...]

The crafting categories this entity prototype supports. [...]

resource_categories [R] :: dictionary[string → true]?

The resource categories this character or mining drill supports. [...]

The resource categories this character or mining drill supports. [...]

supply_area_distance [R] :: double?

The supply area of this electric pole or beacon prototype.

The supply area of this electric pole or beacon prototype.

max_wire_distance [R] :: double

The maximum wire distance for this entity. [...]

The maximum wire distance for this entity. [...]

max_circuit_wire_distance [R] :: double

The maximum circuit wire distance for this entity. [...]

The maximum circuit wire distance for this entity. [...]

energy_usage [R] :: double?

The direct energy usage of this entity, if any.

The direct energy usage of this entity, if any.

max_energy_usage [R] :: double

The theoretical maximum energy usage for this entity.

The theoretical maximum energy usage for this entity.

max_energy_production [R] :: double

The theoretical maximum energy production for this this entity.

The theoretical maximum energy production for this this entity.

effectivity [R] :: double?

The effectivity of this car prototype, generator prototype.

The effectivity of this car prototype, generator prototype.

consumption [R] :: double?

The energy consumption of this car prototype.

The energy consumption of this car prototype.

friction_force [R] :: double?

The friction of this vehicle prototype.

The friction of this vehicle prototype.

braking_force [R] :: double?

The braking force of this vehicle prototype.

The braking force of this vehicle prototype.

air_resistance [R] :: double?

The air resistance of this rolling stock prototype.

The air resistance of this rolling stock prototype.

tank_driving [R] :: boolean?

If this car prototype uses tank controls to drive.

If this car prototype uses tank controls to drive.

rotation_speed [R] :: double?

The rotation speed of this car prototype.

The rotation speed of this car prototype.

turret_rotation_speed [R] :: float?

The turret rotation speed of this car prototype.

The turret rotation speed of this car prototype.

guns [R] :: dictionary[string → LuaItemPrototype]?

A mapping of the gun name to the gun prototype this prototype uses. [...]

A mapping of the gun name to the gun prototype this prototype uses. [...]

indexed_guns [R] :: array[LuaItemPrototype]?

A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.

A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.

speed [R] :: double?

The default speed of this flying robot, rolling stock or unit. [...]

The default speed of this flying robot, rolling stock or unit. [...]

speed_multiplier_when_out_of_energy [R] :: float?

The speed multiplier when this flying robot is out of energy.

The speed multiplier when this flying robot is out of energy.

max_payload_size [R] :: uint?

The max payload size of this logistics or construction robot.

The max payload size of this logistics or construction robot.

draw_cargo [R] :: boolean?

Whether this logistics or construction robot renders its cargo when flying.

Whether this logistics or construction robot renders its cargo when flying.

energy_per_move [R] :: double?

The energy consumed per tile moved for this flying robot.

The energy consumed per tile moved for this flying robot.

energy_per_tick [R] :: double?

The energy consumed per tick for this flying robot.

The energy consumed per tick for this flying robot.

max_energy [R] :: double?

The max energy for this flying robot.

The max energy for this flying robot.

min_to_charge [R] :: float?

The minimum energy for this flying robot before it tries to recharge.

The minimum energy for this flying robot before it tries to recharge.

max_to_charge [R] :: float?

The maximum energy for this flying robot above which it won't try to recharge when stationing.

The maximum energy for this flying robot above which it won't try to recharge when stationing.

burner_prototype [R] :: LuaBurnerPrototype?

The burner energy source prototype this entity uses, if any.

The burner energy source prototype this entity uses, if any.

electric_energy_source_prototype [R] :: LuaElectricEnergySourcePrototype?

The electric energy source prototype this entity uses, if any.

The electric energy source prototype this entity uses, if any.

heat_energy_source_prototype [R] :: LuaHeatEnergySourcePrototype?

The heat energy source prototype this entity uses, if any.

The heat energy source prototype this entity uses, if any.

fluid_energy_source_prototype [R] :: LuaFluidEnergySourcePrototype?

The fluid energy source prototype this entity uses, if any.

The fluid energy source prototype this entity uses, if any.

void_energy_source_prototype [R] :: LuaVoidEnergySourcePrototype?

The void energy source prototype this entity uses, if any.

The void energy source prototype this entity uses, if any.

heat_buffer_prototype [R] :: LuaHeatBufferPrototype?

The heat buffer prototype this entity uses, if any.

The heat buffer prototype this entity uses, if any.

building_grid_bit_shift [R] :: uint

The log2 of grid size of the building

The log2 of grid size of the building

fluid_usage_per_tick [R] :: double?

The fluid usage of this generator prototype.

The fluid usage of this generator prototype.

maximum_temperature [R] :: double?

The maximum fluid temperature of this generator prototype.

The maximum fluid temperature of this generator prototype.

burns_fluid [R] :: boolean?

Whether this generator prototype burns fluid.

Whether this generator prototype burns fluid.

scale_fluid_usage [R] :: boolean?

Whether this generator prototype scales fluid usage.

Whether this generator prototype scales fluid usage.

destroy_non_fuel_fluid [R] :: boolean?

Whether this generator prototype destroys non-fuel fluids.

Whether this generator prototype destroys non-fuel fluids.

max_power_output [R] :: double?

The default maximum power output of this generator prototype.

The default maximum power output of this generator prototype.

target_temperature [R] :: double?

The target temperature of this boiler prototype.

The target temperature of this boiler prototype.

boiler_mode [R] :: "heat-water-inside" or "output-to-separate-pipe"?

The boiler operation mode of this boiler prototype.

The boiler operation mode of this boiler prototype.

fluid [R] :: LuaFluidPrototype?

The fluid this offshore pump produces.

The fluid this offshore pump produces.

fluid_capacity [R] :: double

The fluid capacity of this entity or 0 if this entity doesn't support fluids. [...]

The fluid capacity of this entity or 0 if this entity doesn't support fluids. [...]

pumping_speed [R] :: double?

The pumping speed of this offshore or normal pump.

The pumping speed of this offshore or normal pump.

stack [R] :: boolean?

Whether this inserter is a stack-type.

Whether this inserter is a stack-type.

allow_custom_vectors [R] :: boolean?

Whether this inserter allows custom pickup and drop vectors.

Whether this inserter allows custom pickup and drop vectors.

allow_burner_leech [R] :: boolean?

Whether this inserter allows burner leeching.

Whether this inserter allows burner leeching.

inserter_extension_speed [R] :: double?

The extension speed of this inserter.

The extension speed of this inserter.

inserter_rotation_speed [R] :: double?

The rotation speed of this inserter.

The rotation speed of this inserter.

inserter_pickup_position [R] :: Vector?

The pickup position for this inserter.

The pickup position for this inserter.

inserter_drop_position [R] :: Vector?

The drop position for this inserter.

The drop position for this inserter.

inserter_chases_belt_items [R] :: boolean?

True if this inserter chases items on belts for pickup.

True if this inserter chases items on belts for pickup.

count_as_rock_for_filtered_deconstruction [R] :: boolean?

If this simple-entity is counted as a rock for the deconstruction planner "trees and rocks only" filter.

If this simple-entity is counted as a rock for the deconstruction planner "trees and rocks only" filter.

filter_count [R] :: uint?

The filter count of this inserter, loader, or logistic chest. [...]

The filter count of this inserter, loader, or logistic chest. [...]

time_to_live [R] :: uint

The time to live for this prototype or 0 if prototype doesn't have time_to_live or time_before_removed.

The time to live for this prototype or 0 if prototype doesn't have time_to_live or time_before_removed.

distribution_effectivity [R] :: double?

The distribution effectivity for this beacon prototype.

The distribution effectivity for this beacon prototype.

explosion_beam [R] :: double?

Whether this explosion has a beam.

Whether this explosion has a beam.

explosion_rotate [R] :: double?

Whether this explosion rotates.

Whether this explosion rotates.

tree_color_count [R] :: uint8?

If it is a tree, return the number of colors it supports.

If it is a tree, return the number of colors it supports.

alert_when_damaged [R] :: boolean?

Whether this entity raises an alert when damaged.

Whether this entity raises an alert when damaged.

alert_when_attacking [R] :: boolean?

Whether this turret raises an alert when attacking

Whether this turret raises an alert when attacking

color [R] :: Color?

The color of the prototype, if any.

The color of the prototype, if any.

collision_mask_collides_with_self [R] :: boolean

Does this prototype collision mask collide with itself?

Does this prototype collision mask collide with itself?

collision_mask_collides_with_tiles_only [R] :: boolean

Does this prototype collision mask collide with tiles only?

Does this prototype collision mask collide with tiles only?

collision_mask_considers_tile_transitions [R] :: boolean

Does this prototype collision mask consider tile transitions?

Does this prototype collision mask consider tile transitions?

allowed_effects [R] :: dictionary[string → boolean]?

The allowed module effects for this entity, if any.

The allowed module effects for this entity, if any.

rocket_parts_required [R] :: uint?

The rocket parts required for this rocket silo prototype.

The rocket parts required for this rocket silo prototype.

rocket_rising_delay [R] :: uint8?

The rocket rising delay for this rocket silo prototype.

The rocket rising delay for this rocket silo prototype.

launch_wait_time [R] :: uint8?

The rocket launch delay for this rocket silo prototype.

The rocket launch delay for this rocket silo prototype.

light_blinking_speed [R] :: double?

The light blinking speed for this rocket silo prototype.

The light blinking speed for this rocket silo prototype.

door_opening_speed [R] :: double?

The door opening speed for this rocket silo prototype.

The door opening speed for this rocket silo prototype.

rising_speed [R] :: double?

The rising speed for this rocket silo rocket prototype.

The rising speed for this rocket silo rocket prototype.

engine_starting_speed [R] :: double?

The engine starting speed for this rocket silo rocket prototype.

The engine starting speed for this rocket silo rocket prototype.

flying_speed [R] :: double?

The flying speed for this rocket silo rocket prototype.

The flying speed for this rocket silo rocket prototype.

flying_acceleration [R] :: double?

The flying acceleration for this rocket silo rocket prototype.

The flying acceleration for this rocket silo rocket prototype.

fixed_recipe [R] :: string?

The fixed recipe name for this assembling machine prototype, if any.

The fixed recipe name for this assembling machine prototype, if any.

construction_radius [R] :: double?

The construction radius for this roboport prototype.

The construction radius for this roboport prototype.

logistic_radius [R] :: double?

The logistic radius for this roboport prototype.

The logistic radius for this roboport prototype.

energy_per_hit_point [R] :: double?

The energy used per hitpoint taken for this vehicle during collisions.

The energy used per hitpoint taken for this vehicle during collisions.

create_ghost_on_death [R] :: boolean

If this prototype will attempt to create a ghost of itself on death. [...]

If this prototype will attempt to create a ghost of itself on death. [...]

ammo_category [R] :: string?

Name of the ammo category of this land mine.

Name of the ammo category of this land mine.

timeout [R] :: uint?

The time it takes this land mine to arm.

The time it takes this land mine to arm.

trigger_collision_mask [R] :: CollisionMaskWithFlags?

The collision mask entities must collide with to make this landmine blow up.

The collision mask entities must collide with to make this landmine blow up.

fluidbox_prototypes [R] :: array[LuaFluidBoxPrototype]

The fluidbox prototypes for this entity.

The fluidbox prototypes for this entity.

neighbour_bonus [R] :: double?
container_distance [R] :: double?
belt_distance [R] :: double?
belt_length [R] :: double?
is_building [R] :: boolean
automated_ammo_count [R] :: uint?

The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret.

The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret.

max_speed [R] :: double?

The max speed of this projectile or flying robot prototype.

The max speed of this projectile or flying robot prototype.

darkness_for_all_lamps_on [R] :: float?

Value between 0 and 1 darkness where all lamps of this lamp prototype are on.

Value between 0 and 1 darkness where all lamps of this lamp prototype are on.

darkness_for_all_lamps_off [R] :: float?

Value between 0 and 1 darkness where all lamps of this lamp prototype are off.

Value between 0 and 1 darkness where all lamps of this lamp prototype are off.

always_on [R] :: boolean?

Whether the lamp is always on (except when out of power or turned off by the circuit network).

Whether the lamp is always on (except when out of power or turned off by the circuit network).

min_darkness_to_spawn [R] :: float?

The minimum darkness at which this unit spawner can spawn entities.

The minimum darkness at which this unit spawner can spawn entities.

max_darkness_to_spawn [R] :: float?

The maximum darkness at which this unit spawner can spawn entities.

The maximum darkness at which this unit spawner can spawn entities.

call_for_help_radius [R] :: double?
max_count_of_owned_units [R] :: double?

Count of enemies this spawner can sustain.

Count of enemies this spawner can sustain.

max_friends_around_to_spawn [R] :: double?

How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units.

How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units.

spawning_radius [R] :: double?

How far from the spawner can the units be spawned.

How far from the spawner can the units be spawned.

spawning_spacing [R] :: double?

What spaces should be between the spawned units.

What spaces should be between the spawned units.

radius [R] :: double

The radius of this entity prototype.

The radius of this entity prototype.

cliff_explosive_prototype [R] :: string?

The item prototype name used to destroy this cliff.

The item prototype name used to destroy this cliff.

rocket_entity_prototype [R] :: LuaEntityPrototype?

The rocket entity prototype associated with this rocket silo prototype.

The rocket entity prototype associated with this rocket silo prototype.

has_belt_immunity [R] :: boolean?

Whether this unit, car, or character prototype has belt immunity.

Whether this unit, car, or character prototype has belt immunity.

vision_distance [R] :: double?

The vision distance of this unit prototype.

The vision distance of this unit prototype.

pollution_to_join_attack [R] :: float?

The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution.

The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution.

min_pursue_time [R] :: uint?

The minimum pursue time of this unit prototype.

The minimum pursue time of this unit prototype.

max_pursue_distance [R] :: double?

The maximum pursue distance of this unit prototype.

The maximum pursue distance of this unit prototype.

radar_range [R] :: uint?

The radar range of this unit prototype.

The radar range of this unit prototype.

move_while_shooting [R] :: boolean?

Whether this unit prototype can move while shooting.

Whether this unit prototype can move while shooting.

can_open_gates [R] :: boolean?

Whether this unit prototype can open gates.

Whether this unit prototype can open gates.

affected_by_tiles [R] :: boolean?

Whether this unit prototype is affected by tile walking speed modifiers.

Whether this unit prototype is affected by tile walking speed modifiers.

distraction_cooldown [R] :: uint?

The distraction cooldown of this unit prototype.

The distraction cooldown of this unit prototype.

spawning_time_modifier [R] :: double?

The spawning time modifier of this unit prototype.

The spawning time modifier of this unit prototype.

alert_icon_shift [R] :: Vector

The alert icon shift of this entity prototype.

The alert icon shift of this entity prototype.

alert_icon_scale [R] :: float

The alert icon scale of this entity prototype.

The alert icon scale of this entity prototype.

lab_inputs [R] :: array[string]?

The item prototype names that are the inputs of this lab prototype.

The item prototype names that are the inputs of this lab prototype.

researching_speed [R] :: double?

The base researching speed of this lab prototype.

The base researching speed of this lab prototype.

item_slot_count [R] :: uint?

The item slot count of this constant combinator prototype.

The item slot count of this constant combinator prototype.

base_productivity [R] :: double?

The base productivity of this crafting machine, lab, or mining drill.

The base productivity of this crafting machine, lab, or mining drill.

allow_access_to_all_forces [R] :: boolean?

Whether this market allows access to all forces or just friendly ones.

Whether this market allows access to all forces or just friendly ones.

supports_direction [R] :: boolean

Whether this entity prototype could possibly ever be rotated.

Whether this entity prototype could possibly ever be rotated.

terrain_friction_modifier [R] :: float?

The terrain friction modifier for this vehicle.

The terrain friction modifier for this vehicle.

allow_passengers [R] :: boolean?

Whether this vehicle allows passengers.

Whether this vehicle allows passengers.

max_distance_of_sector_revealed [R] :: uint?

The radius of the area this radar can chart, in chunks.

The radius of the area this radar can chart, in chunks.

max_distance_of_nearby_sector_revealed [R] :: uint?

The radius of the area constantly revealed by this radar, in chunks.

The radius of the area constantly revealed by this radar, in chunks.

adjacent_tile_collision_box [R] :: BoundingBox?

The bounding box that specifies which tiles adjacent to the offshore pump should be checked.

The bounding box that specifies which tiles adjacent to the offshore pump should be checked.

adjacent_tile_collision_mask [R] :: CollisionMask?

Tiles adjacent to the offshore pump must not collide with this collision mask.

Tiles adjacent to the offshore pump must not collide with this collision mask.

adjacent_tile_collision_test [R] :: CollisionMask?

If this mask is not empty, tiles adjacent to the offshore pump must not collide with this collision mask.

If this mask is not empty, tiles adjacent to the offshore pump must not collide with this collision mask.

center_collision_mask [R] :: CollisionMask?

The collision mask used only for collision test with tile directly at offshore pump position.

The collision mask used only for collision test with tile directly at offshore pump position.

grid_prototype [R] :: LuaEquipmentGridPrototype?

The equipment grid prototype for this entity, if any.

The equipment grid prototype for this entity, if any.

remove_decoratives [R] :: "automatic" or "true" or "false"

Whether this entity should remove decoratives that collide with it when this entity is built.

Whether this entity should remove decoratives that collide with it when this entity is built.

related_underground_belt [R] :: LuaEntityPrototype?
inserter_stack_size_bonus [R] :: uint?

The built-in stack size bonus of this inserter prototype.

The built-in stack size bonus of this inserter prototype.

protected_from_tile_building [R] :: boolean

True if this entity prototype should be included during tile collision checks with LuaTilePrototype::check_collision_with_entities enabled.

True if this entity prototype should be included during tile collision checks with LuaTilePrototype::check_collision_with_entities enabled.

is_entity_with_owner [R] :: boolean

True if this is entity-with-owner

True if this is entity-with-owner

is_military_target [R] :: boolean?

True if this entity-with-owner is military target

True if this entity-with-owner is military target

allow_run_time_change_of_is_military_target [R] :: boolean?

True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)

True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)

logistic_parameters [R] :: table?

The logistic parameters for this roboport. [...]

The logistic parameters for this roboport. [...]

height [R] :: double?

The height of this spider vehicle prototype.

The height of this spider vehicle prototype.

torso_rotation_speed [R] :: double?

The torso rotation speed of this spider vehicle prototype.

The torso rotation speed of this spider vehicle prototype.

torso_bob_speed [R] :: double?

The torso bob speed of this spider vehicle prototype.

The torso bob speed of this spider vehicle prototype.

automatic_weapon_cycling [R] :: boolean?

Whether this spider vehicle prototype automatically cycles weapons.

Whether this spider vehicle prototype automatically cycles weapons.

chain_shooting_cooldown_modifier [R] :: double?

The chain shooting cooldown modifier of this spider vehicle prototype.

The chain shooting cooldown modifier of this spider vehicle prototype.

chunk_exploration_radius [R] :: double?

The chunk exploration radius of this spider vehicle prototype.

The chunk exploration radius of this spider vehicle prototype.

animation_speed_coefficient [R] :: double?

The animation speed coefficient of this belt connectable prototype.

The animation speed coefficient of this belt connectable prototype.

manual_range_modifier [R] :: double?

The manual range modifier for this artillery turret or wagon prototype.

The manual range modifier for this artillery turret or wagon prototype.

dying_speed [R] :: float?

The dying time of this corpse prototype.

The dying time of this corpse prototype.

active_energy_usage [R] :: double?

The active energy usage of this rocket silo or combinator prototype.

The active energy usage of this rocket silo or combinator prototype.

lamp_energy_usage [R] :: double?

The lamp energy usage of this rocket silo prototype.

The lamp energy usage of this rocket silo prototype.

use_exact_mode [R] :: boolean?

Whether this logistic container prototype uses exact mode

Whether this logistic container prototype uses exact mode

tile_width [R] :: uint

Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension)

Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension)

tile_height [R] :: uint

Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension)

Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension)

vertical_selection_shift [R] :: double?

Vertical selection shift used by rolling stocks. [...]

Vertical selection shift used by rolling stocks. [...]

spawn_decoration [R] :: array[TriggerEffectItem]?
spawn_decorations_on_expansion [R] :: boolean?
connection_distance [R] :: double?
joint_distance [R] :: double?
radius_visualisation_specification [R] :: RadiusVisualisationSpecification?
vector_to_place_result [R] :: Vector?
running_speed [R] :: double?

The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.

The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.

maximum_corner_sliding_distance [R] :: double?
build_distance [R] :: uint?
drop_item_distance [R] :: uint?
reach_distance [R] :: uint?
reach_resource_distance [R] :: double?
item_pickup_distance [R] :: double?
loot_pickup_distance [R] :: double?
enter_vehicle_distance [R] :: double?
ticks_to_keep_gun [R] :: uint?
ticks_to_keep_aiming_direction [R] :: uint?
ticks_to_stay_in_combat [R] :: uint?
respawn_time [R] :: uint?
damage_hit_tint [R] :: Color?
character_corpse [R] :: LuaEntityPrototype?
valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this equipment.

Name of this equipment.

type [R] :: string

Type of this equipment.

Type of this equipment.

position [R] :: EquipmentPosition

Position of this equipment in the equipment grid.

Position of this equipment in the equipment grid.

shape [R] :: table

Shape of this equipment.

Shape of this equipment.

shield [RW] :: double

Current shield value of the equipment. [...]

Current shield value of the equipment. [...]

max_shield [R] :: double

Maximum shield value.

Maximum shield value.

max_solar_power [R] :: double

Maximum solar power generated.

Maximum solar power generated.

movement_bonus [R] :: double

Movement speed bonus.

Movement speed bonus.

generator_power [R] :: double

Energy generated per tick.

Energy generated per tick.

energy [RW] :: double

Current available energy.

Current available energy.

max_energy [R] :: double

Maximum amount of energy that can be stored in this equipment.

Maximum amount of energy that can be stored in this equipment.

prototype [R] :: LuaEquipmentPrototype
burner [R] :: LuaBurner?

The burner energy source for this equipment, if any.

The burner energy source for this equipment, if any.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

take{position?=…, equipment?=…, by_player?=…}  → SimpleItemStack?

Remove an equipment from the grid.

Remove an equipment from the grid.

take_all(by_player?)  → dictionary[string → uint]

Remove all equipment from the grid.

Remove all equipment from the grid.

clear(by_player?)

Clear all equipment from the grid, removing it without actually returning it.

Clear all equipment from the grid, removing it without actually returning it.

put{name=…, position?=…, by_player?=…}  → LuaEquipment?

Insert an equipment into the grid.

Insert an equipment into the grid.

can_move{equipment=…, position=…}  → boolean

Check whether moving an equipment would succeed.

Check whether moving an equipment would succeed.

move{equipment=…, position=…}  → boolean

Move an equipment within this grid.

Move an equipment within this grid.

get(position)  → LuaEquipment?

Find equipment in the Equipment Grid based off a position.

Find equipment in the Equipment Grid based off a position.

get_contents()  → dictionary[string → uint]

Get counts of all equipment in this grid.

Get counts of all equipment in this grid.

find(equipment)  → LuaEquipment?

Find equipment by name.

Find equipment by name.

count(equipment?)  → uint

Get the number of all or some equipment in this grid.

Get the number of all or some equipment in this grid.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

prototype [R] :: LuaEquipmentGridPrototype
width [R] :: uint

Width of the equipment grid.

Width of the equipment grid.

height [R] :: uint

Height of the equipment grid.

Height of the equipment grid.

equipment [R] :: array[LuaEquipment]

All the equipment in this grid.

All the equipment in this grid.

generator_energy [R] :: double

Total energy per tick generated by the equipment inside this grid.

Total energy per tick generated by the equipment inside this grid.

max_solar_energy [R] :: double

Maximum energy per tick that can be created by any solar panels in the equipment grid. [...]

Maximum energy per tick that can be created by any solar panels in the equipment grid. [...]

available_in_batteries [R] :: double

The total energy stored in all batteries in the equipment grid.

The total energy stored in all batteries in the equipment grid.

battery_capacity [R] :: double

Total energy storage capacity of all batteries in the equipment grid.

Total energy storage capacity of all batteries in the equipment grid.

shield [R] :: float

The amount of shields this equipment grid has.

The amount of shields this equipment grid has.

max_shield [R] :: float

The maximum amount of shields this equipment grid has.

The maximum amount of shields this equipment grid has.

inhibit_movement_bonus [RW] :: boolean

Whether this grid's equipment movement bonus is active.

Whether this grid's equipment movement bonus is active.

unique_id [R] :: uint

Unique identifier of this equipment grid.

Unique identifier of this equipment grid.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
equipment_categories [R] :: array[string]

Equipment category names for the categories that may be inserted into this equipment grid. [...]

Equipment category names for the categories that may be inserted into this equipment grid. [...]

width [R] :: uint
height [R] :: uint
locked [R] :: boolean

If the player can move equipment into or out of this grid.

If the player can move equipment into or out of this grid.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

type [R] :: string

Type of this equipment prototype.

Type of this equipment prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
shape [R] :: table

Shape of this equipment prototype.

Shape of this equipment prototype.

take_result [R] :: LuaItemPrototype?

The result item when taking this equipment out of an equipment grid, if any.

The result item when taking this equipment out of an equipment grid, if any.

energy_production [R] :: double

The max power generated by this equipment.

The max power generated by this equipment.

shield [R] :: float

The shield value of this equipment. [...]

The shield value of this equipment. [...]

energy_per_shield [R] :: double

The energy per shield point restored. [...]

The energy per shield point restored. [...]

logistic_parameters [R] :: table?

The logistic parameters for this roboport equipment. [...]

The logistic parameters for this roboport equipment. [...]

energy_consumption [R] :: double
movement_bonus [R] :: float?
energy_source [R] :: LuaElectricEnergySourcePrototype

The energy source prototype for the equipment.

The energy source prototype for the equipment.

equipment_categories [R] :: array[string]

Category names for this equipment. [...]

Category names for this equipment. [...]

burner_prototype [R] :: LuaBurnerPrototype?

The burner energy source prototype this equipment uses, if any.

The burner energy source prototype this equipment uses, if any.

electric_energy_source_prototype [R] :: LuaElectricEnergySourcePrototype?

The electric energy source prototype this equipment uses, if any.

The electric energy source prototype this equipment uses, if any.

background_color [R] :: Color

The background color of this equipment prototype.

The background color of this equipment prototype.

attack_parameters [R] :: AttackParameters?

The equipment attack parameters.

The equipment attack parameters.

automatic [R] :: boolean

Whether this active defense equipment is automatic. [...]

Whether this active defense equipment is automatic. [...]

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

get_input_count(name)  → uint64 or double

Gets the total input count for a given prototype.

Gets the total input count for a given prototype.

set_input_count(name, count)

Sets the total input count for a given prototype.

Sets the total input count for a given prototype.

get_output_count(name)  → uint64 or double

Gets the total output count for a given prototype.

Gets the total output count for a given prototype.

set_output_count(name, count)

Sets the total output count for a given prototype.

Sets the total output count for a given prototype.

get_flow_count{name=…, input=…, precision_index=…, sample_index?=…, count?=…}  → double

Gets the flow count value for the given time frame. [...]

Gets the flow count value for the given time frame. [...]

on_flow(name, count)

Adds a value to this flow statistics.

Adds a value to this flow statistics.

clear()

Reset all the statistics data to 0.

Reset all the statistics data to 0.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

input_counts [R] :: dictionary[string → uint64 or double]

List of input counts indexed by prototype name. [...]

List of input counts indexed by prototype name. [...]

output_counts [R] :: dictionary[string → uint64 or double]

List of output counts indexed by prototype name. [...]

List of output counts indexed by prototype name. [...]

force [R] :: LuaForce?

The force these statistics belong to. [...]

The force these statistics belong to. [...]

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

get_prototype(index)  → LuaFluidBoxPrototype or array[LuaFluidBoxPrototype]

The prototype of this fluidbox index. [...]

The prototype of this fluidbox index. [...]

get_capacity(index)  → double

The capacity of the given fluidbox index.

The capacity of the given fluidbox index.

get_connections(index)  → array[LuaFluidBox]

The fluidboxes to which the fluidbox at the given index is connected.

The fluidboxes to which the fluidbox at the given index is connected.

get_pipe_connections(index)  → array[PipeConnection]

Get the fluid box's connections and associated data.

Get the fluid box's connections and associated data.

get_filter(index)  → FluidBoxFilter?

Get a fluid box filter

Get a fluid box filter

set_filter(index, filter)  → boolean

Set a fluid box filter. [...]

Set a fluid box filter. [...]

get_flow(index)  → double

Flow through the fluidbox in the last tick. [...]

Flow through the fluidbox in the last tick. [...]

get_locked_fluid(index)  → string?

Returns the fluid the fluidbox is locked onto.

Returns the fluid the fluidbox is locked onto.

get_fluid_system_id(index)  → uint?

Gets unique fluid system identifier of selected fluid box. [...]

Gets unique fluid system identifier of selected fluid box. [...]

get_fluid_system_contents(index)  → dictionary[string → uint]?

Gets counts of all fluids in the fluid system. [...]

Gets counts of all fluids in the fluid system. [...]

flush(index, fluid?)  → dictionary[string → float]

Flushes all fluid from this fluidbox and its fluid system.

Flushes all fluid from this fluidbox and its fluid system.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

owner [R] :: LuaEntity

The entity that owns this fluidbox.

The entity that owns this fluidbox.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

[] (index) [R] :: Fluid?

Access, set or clear a fluid box. [...]

Access, set or clear a fluid box. [...]

# (length) [R] :: uint

Number of fluid boxes.

Number of fluid boxes.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

entity [R] :: LuaEntityPrototype

The entity that this belongs to.

The entity that this belongs to.

index [R] :: uint

The index of this fluidbox prototype in the owning entity.

The index of this fluidbox prototype in the owning entity.

pipe_connections [R] :: array[FluidBoxConnection]

The pipe connection points.

The pipe connection points.

production_type [R] :: "input" or "input-output" or "output" or "none"

The production type.

The production type.

base_area [R] :: double
base_level [R] :: float
height [R] :: double
volume [R] :: double
filter [R] :: LuaFluidPrototype?

The filter, if any is set.

The filter, if any is set.

minimum_temperature [R] :: double?

The minimum temperature, if any is set.

The minimum temperature, if any is set.

maximum_temperature [R] :: double?

The maximum temperature, if any is set.

The maximum temperature, if any is set.

secondary_draw_orders [R] :: array[int]

The secondary draw orders for the 4 possible connection directions.

The secondary draw orders for the 4 possible connection directions.

render_layer [R] :: string

The render layer.

The render layer.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

emissions [R] :: double

The emissions of this energy source in pollution/Joule. [...]

The emissions of this energy source in pollution/Joule. [...]

render_no_network_icon [R] :: boolean
render_no_power_icon [R] :: boolean
effectivity [R] :: double
burns_fluid [R] :: boolean
scale_fluid_usage [R] :: boolean
destroy_non_fuel_fluid [R] :: boolean
fluid_usage_per_tick [R] :: double
smoke [R] :: array[SmokeSource]

The smoke sources for this prototype, if any.

The smoke sources for this prototype, if any.

maximum_temperature [R] :: double
fluid_box [R] :: LuaFluidBoxPrototype

The fluid box for this energy source.

The fluid box for this energy source.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
default_temperature [R] :: double

Default temperature of this fluid.

Default temperature of this fluid.

max_temperature [R] :: double

Maximum temperature this fluid can reach.

Maximum temperature this fluid can reach.

heat_capacity [R] :: double

The amount of energy in Joules required to heat one unit of this fluid by 1°C.

The amount of energy in Joules required to heat one unit of this fluid by 1°C.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

group [R] :: LuaGroup

Group of this prototype.

Group of this prototype.

subgroup [R] :: LuaGroup

Subgroup of this prototype.

Subgroup of this prototype.

base_color [R] :: Color
flow_color [R] :: Color
gas_temperature [R] :: double

The temperature above which this fluid will be shown as gaseous inside tanks and pipes.

The temperature above which this fluid will be shown as gaseous inside tanks and pipes.

emissions_multiplier [R] :: double

A multiplier on the amount of emissions produced when this fluid is burnt in a generator. [...]

A multiplier on the amount of emissions produced when this fluid is burnt in a generator. [...]

fuel_value [R] :: double

The amount of energy in Joules one unit of this fluid will produce when burnt in a generator. [...]

The amount of energy in Joules one unit of this fluid will produce when burnt in a generator. [...]

hidden [R] :: boolean

Whether this fluid is hidden from the fluid and signal selectors.

Whether this fluid is hidden from the fluid and signal selectors.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

from [R] :: string
size [R] :: int
spacing [R] :: float
border [R] :: boolean
filtered [R] :: boolean
border_color [R] :: Color?

The border color, if any.

The border color, if any.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

get_entity_count(name)  → uint

Count entities of given type. [...]

Count entities of given type. [...]

disable_research()

Disable research for this force.

Disable research for this force.

enable_research()

Enable research for this force.

Enable research for this force.

disable_all_prototypes()

Disable all recipes and technologies. [...]

Disable all recipes and technologies. [...]

enable_all_prototypes()

Enables all recipes and technologies. [...]

Enables all recipes and technologies. [...]

reset_recipes()

Load the original version of all recipes from the prototypes.

Load the original version of all recipes from the prototypes.

enable_all_recipes()

Unlock all recipes.

Unlock all recipes.

enable_all_technologies()

Unlock all technologies.

Unlock all technologies.

research_all_technologies(include_disabled_prototypes?)

Research all technologies.

Research all technologies.

reset_technologies()

Load the original versions of technologies from prototypes. [...]

Load the original versions of technologies from prototypes. [...]

reset()

Reset everything. [...]

Reset everything. [...]

reset_technology_effects()

Reapplies all possible research effects, including unlocked recipes. [...]

Reapplies all possible research effects, including unlocked recipes. [...]

chart(surface, area)

Chart a portion of the map. [...]

Chart a portion of the map. [...]

clear_chart(surface?)

Erases chart data for this force.

Erases chart data for this force.

rechart(surface?)

Force a rechart of the whole chart.

Force a rechart of the whole chart.

chart_all(surface?)

Chart all generated chunks.

Chart all generated chunks.

is_chunk_charted(surface, position)  → boolean

Has a chunk been charted?

Has a chunk been charted?

is_chunk_visible(surface, position)  → boolean

Is the given chunk currently charted and visible (not covered by fog of war) on the map.

Is the given chunk currently charted and visible (not covered by fog of war) on the map.

is_chunk_requested_for_charting(surface, position)  → boolean

Has a chunk been requested for charting?

Has a chunk been requested for charting?

cancel_charting(surface?)

Cancels pending chart requests for the given surface or all surfaces.

Cancels pending chart requests for the given surface or all surfaces.

get_ammo_damage_modifier(ammo)  → double
set_ammo_damage_modifier(ammo, modifier)
get_gun_speed_modifier(ammo)  → double
set_gun_speed_modifier(ammo, modifier)
get_turret_attack_modifier(turret)  → double
set_turret_attack_modifier(turret, modifier)
set_cease_fire(other, cease_fire)

Add other force to this force's cease fire list. [...]

Add other force to this force's cease fire list. [...]

get_cease_fire(other)  → boolean

Is other force in this force's cease fire list?

Is other force in this force's cease fire list?

set_friend(other, friend)

Add other force to this force's friends list. [...]

Add other force to this force's friends list. [...]

get_friend(other)  → boolean

Is other force in this force's friends list.

Is other force in this force's friends list.

is_pathfinder_busy()  → boolean

Is pathfinder busy? [...]

Is pathfinder busy? [...]

kill_all_units()

Kill all units and flush the pathfinder.

Kill all units and flush the pathfinder.

find_logistic_network_by_position(position, surface)  → LuaLogisticNetwork?
set_spawn_position(position, surface)
get_spawn_position(surface)  → MapPosition
unchart_chunk(position, surface)
get_item_launched(item)  → uint

Gets the count of a given item launched in rockets.

Gets the count of a given item launched in rockets.

set_item_launched(item, count)

Sets the count of a given item launched in rockets.

Sets the count of a given item launched in rockets.

print(message, print_settings?)

Print text to the chat console of all players on this force. [...]

Print text to the chat console of all players on this force. [...]

get_trains(surface?)  → array[LuaTrain]
add_chart_tag(surface, tag)  → LuaCustomChartTag?

Adds a custom chart tag to the given surface and returns the new tag or nil if the given position isn't valid for a chart tag. [...]

Adds a custom chart tag to the given surface and returns the new tag or nil if the given position isn't valid for a chart tag. [...]

find_chart_tags(surface, area?)  → array[LuaCustomChartTag]

Finds all custom chart tags within the given bounding box on the given surface.

Finds all custom chart tags within the given bounding box on the given surface.

get_saved_technology_progress(technology)  → double?

Gets the saved progress for the given technology or nil if there is no saved progress.

Gets the saved progress for the given technology or nil if there is no saved progress.

set_saved_technology_progress(technology, progress)

Sets the saved progress for the given technology. [...]

Sets the saved progress for the given technology. [...]

reset_evolution()

Resets evolution for this force to zero.

Resets evolution for this force to zero.

play_sound{path=…, position?=…, volume_modifier?=…, override_sound_type?=…}

Play a sound for every player in this force. [...]

Play a sound for every player in this force. [...]

get_train_stops{name?=…, surface?=…}  → array[LuaEntity]

Gets train stops matching the given filters.

Gets train stops matching the given filters.

get_hand_crafting_disabled_for_recipe(recipe)  → boolean

Gets if the given recipe is explicitly disabled from being hand crafted.

Gets if the given recipe is explicitly disabled from being hand crafted.

set_hand_crafting_disabled_for_recipe(recipe, hand_crafting_disabled)

Sets if the given recipe can be hand-crafted. [...]

Sets if the given recipe can be hand-crafted. [...]

add_research(technology)  → boolean

Add this technology to the back of the research queue if the queue is enabled. [...]

Add this technology to the back of the research queue if the queue is enabled. [...]

cancel_current_research()

Stop the research currently in progress. [...]

Stop the research currently in progress. [...]

get_linked_inventory(prototype, link_id)  → LuaInventory?

Gets the linked inventory for the given prototype and link ID if it exists or nil.

Gets the linked inventory for the given prototype and link ID if it exists or nil.

is_friend(other)  → boolean

Is this force a friend? [...]

Is this force a friend? [...]

is_enemy(other)  → boolean

Is this force an enemy? [...]

Is this force an enemy? [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of the force.

Name of the force.

technologies [R] :: LuaCustomTable[string → LuaTechnology]

Technologies owned by this force, indexed by name.

Technologies owned by this force, indexed by name.

recipes [R] :: LuaCustomTable[string → LuaRecipe]

Recipes available to this force, indexed by name.

Recipes available to this force, indexed by name.

manual_mining_speed_modifier [RW] :: double

Multiplier of the manual mining speed. [...]

Multiplier of the manual mining speed. [...]

manual_crafting_speed_modifier [RW] :: double

Multiplier of the manual crafting speed. [...]

Multiplier of the manual crafting speed. [...]

laboratory_speed_modifier [RW] :: double
laboratory_productivity_bonus [RW] :: double
worker_robots_speed_modifier [RW] :: double
worker_robots_battery_modifier [RW] :: double
worker_robots_storage_bonus [RW] :: double
current_research [R] :: LuaTechnology?

The currently ongoing technology research, if any.

The currently ongoing technology research, if any.

research_progress [RW] :: double

Progress of current research, as a number in range [0, 1].

Progress of current research, as a number in range [0, 1].

previous_research [RW] :: LuaTechnology?

The previous research, if any.

The previous research, if any.

inserter_stack_size_bonus [RW] :: double

The inserter stack size bonus for non stack inserters

The inserter stack size bonus for non stack inserters

stack_inserter_capacity_bonus [RW] :: uint

Number of items that can be transferred by stack inserters. [...]

Number of items that can be transferred by stack inserters. [...]

character_trash_slot_count [RW] :: double

Number of character trash slots.

Number of character trash slots.

maximum_following_robot_count [RW] :: uint

Maximum number of follower robots.

Maximum number of follower robots.

following_robots_lifetime_modifier [RW] :: double

Additional lifetime for following robots.

Additional lifetime for following robots.

ghost_time_to_live [RW] :: uint

The time, in ticks, before a placed ghost disappears.

The time, in ticks, before a placed ghost disappears.

players [R] :: array[LuaPlayer]

Players belonging to this force.

Players belonging to this force.

ai_controllable [RW] :: boolean

Enables some higher-level AI behaviour for this force. [...]

Enables some higher-level AI behaviour for this force. [...]

logistic_networks [R] :: dictionary[string → array[LuaLogisticNetwork]]

List of logistic networks, grouped by surface.

List of logistic networks, grouped by surface.

item_production_statistics [R] :: LuaFlowStatistics

The item production statistics for this force.

The item production statistics for this force.

fluid_production_statistics [R] :: LuaFlowStatistics

The fluid production statistics for this force.

The fluid production statistics for this force.

kill_count_statistics [R] :: LuaFlowStatistics

The kill counter statistics for this force.

The kill counter statistics for this force.

entity_build_count_statistics [R] :: LuaFlowStatistics

The entity build statistics for this force (built and mined)

The entity build statistics for this force (built and mined)

character_running_speed_modifier [RW] :: double

Modifies the running speed of all characters in this force by the given value as a percentage. [...]

Modifies the running speed of all characters in this force by the given value as a percentage. [...]

artillery_range_modifier [RW] :: double
character_build_distance_bonus [RW] :: uint
character_item_drop_distance_bonus [RW] :: uint
character_reach_distance_bonus [RW] :: uint
character_resource_reach_distance_bonus [RW] :: double
character_item_pickup_distance_bonus [RW] :: double
character_loot_pickup_distance_bonus [RW] :: double
character_inventory_slots_bonus [RW] :: uint

The number of additional inventory slots the character main inventory has.

The number of additional inventory slots the character main inventory has.

deconstruction_time_to_live [RW] :: uint

The time, in ticks, before a deconstruction order is removed.

The time, in ticks, before a deconstruction order is removed.

character_health_bonus [RW] :: double
max_successful_attempts_per_tick_per_construction_queue [RW] :: uint
max_failed_attempts_per_tick_per_construction_queue [RW] :: uint
zoom_to_world_enabled [RW] :: boolean

Ability to use zoom-to-world on map.

Ability to use zoom-to-world on map.

zoom_to_world_ghost_building_enabled [RW] :: boolean

Ability to build ghosts through blueprint or direct ghost placement, or "mine" ghosts when using zoom-to-world.

Ability to build ghosts through blueprint or direct ghost placement, or "mine" ghosts when using zoom-to-world.

zoom_to_world_blueprint_enabled [RW] :: boolean

Ability to create new blueprints using empty blueprint item when using zoom-to-world.

Ability to create new blueprints using empty blueprint item when using zoom-to-world.

zoom_to_world_deconstruction_planner_enabled [RW] :: boolean

Ability to use deconstruction planner when using zoom-to-world.

Ability to use deconstruction planner when using zoom-to-world.

zoom_to_world_selection_tool_enabled [RW] :: boolean

Ability to use custom selection tools when using zoom-to-world.

Ability to use custom selection tools when using zoom-to-world.

character_logistic_requests [RW] :: boolean

true if character requester logistics is enabled.

true if character requester logistics is enabled.

rockets_launched [RW] :: uint

The number of rockets launched.

The number of rockets launched.

items_launched [R] :: dictionary[string → uint]

All of the items that have been launched in rockets. [...]

All of the items that have been launched in rockets. [...]

connected_players [R] :: array[LuaPlayer]

The connected players belonging to this force. [...]

The connected players belonging to this force. [...]

mining_drill_productivity_bonus [RW] :: double
train_braking_force_bonus [RW] :: double
evolution_factor [RW] :: double

Evolution factor of this force.

Evolution factor of this force.

evolution_factor_by_pollution [RW] :: double
evolution_factor_by_time [RW] :: double
evolution_factor_by_killing_spawners [RW] :: double
friendly_fire [RW] :: boolean

If friendly fire is enabled for this force.

If friendly fire is enabled for this force.

share_chart [RW] :: boolean

If sharing chart data is enabled for this force.

If sharing chart data is enabled for this force.

research_queue_enabled [RW] :: boolean

Whether the research queue is available for this force.

Whether the research queue is available for this force.

index [R] :: uint

This force's index in LuaGameScript::forces (unique ID). [...]

This force's index in LuaGameScript::forces (unique ID). [...]

research_queue [RW] :: array[TechnologyIdentification]

The research queue of this force. [...]

The research queue of this force. [...]

research_enabled [R] :: boolean

Whether research is enabled for this force, see LuaForce::enable_research and LuaForce::disable_research

Whether research is enabled for this force, see LuaForce::enable_research and LuaForce::disable_research

custom_color [RW] :: Color?

Custom color for this force. [...]

Custom color for this force. [...]

color [R] :: Color

Effective color of this force.

Effective color of this force.

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string

Name of this prototype.

Name of this prototype.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

localised_name [R] :: LocalisedString
localised_description [R] :: LocalisedString
valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

set_game_state{game_finished?=…, player_won?=…, next_level?=…, can_continue?=…, victorious_force?=…}

Set scenario state. [...]

Set scenario state. [...]

reset_game_state()

Reset scenario state (game_finished, player_won, etc.).

Reset scenario state (game_finished, player_won, etc.).

get_entity_by_tag(tag)  → LuaEntity?

Gets an entity by its name tag. [...]

Gets an entity by its name tag. [...]

show_message_dialog{text=…, image?=…, point_to?=…, style?=…, wrapper_frame_style?=…}

Show an in-game message dialog. [...]

Show an in-game message dialog. [...]

is_demo()  → boolean

Is this the demo version of Factorio?

Is this the demo version of Factorio?

reload_script()

Forces a reload of the scenario script from the original scenario location. [...]

Forces a reload of the scenario script from the original scenario location. [...]

reload_mods()

Forces a reload of all mods. [...]

Forces a reload of all mods. [...]

save_atlas()

Saves the current configuration of Atlas to a file. [...]

Saves the current configuration of Atlas to a file. [...]

check_consistency()

Run internal consistency checks. [...]

Run internal consistency checks. [...]

regenerate_entity(entities)

Regenerate autoplacement of some entities on all surfaces. [...]

Regenerate autoplacement of some entities on all surfaces. [...]

take_screenshot{player?=…, by_player?=…, surface?=…, position?=…, resolution?=…, zoom?=…, path?=…, show_gui?=…, show_entity_info?=…, show_cursor_building_preview?=…, anti_alias?=…, quality?=…, allow_in_replay?=…, daytime?=…, water_tick?=…, force_render?=…}

Take a screenshot of the game and save it to the script-output folder, located in the game's user data directory. [...]

Take a screenshot of the game and save it to the script-output folder, located in the game's user data directory. [...]

set_wait_for_screenshots_to_finish()

Forces the screenshot saving system to wait until all queued screenshots have been written to disk.

Forces the screenshot saving system to wait until all queued screenshots have been written to disk.

take_technology_screenshot{force?=…, path?=…, by_player?=…, selected_technology?=…, skip_disabled?=…, quality?=…}

Take a screenshot of the technology screen and save it to the script-output folder, located in the game's user data directory. [...]

Take a screenshot of the technology screen and save it to the script-output folder, located in the game's user data directory. [...]

table_to_json(data)  → string

Convert a table to a JSON string

Convert a table to a JSON string

json_to_table(json)  → AnyBasic?

Convert a JSON string to a table.

Convert a JSON string to a table.

write_file(filename, data, append?, for_player?)

Write a file to the script-output folder, located in the game's user data directory. [...]

Write a file to the script-output folder, located in the game's user data directory. [...]

remove_path(path)

Remove a file or directory in the script-output folder, located in the game's user data directory. [...]

Remove a file or directory in the script-output folder, located in the game's user data directory. [...]

remove_offline_players(players?)

Remove players who are currently not connected from the map.

Remove players who are currently not connected from the map.

force_crc()

Force a CRC check. [...]

Force a CRC check. [...]

create_force(force)  → LuaForce

Create a new force. [...]

Create a new force. [...]

merge_forces(source, destination)

Marks two forces to be merged together. [...]

Marks two forces to be merged together. [...]

create_surface(name, settings?)  → LuaSurface

Create a new surface. [...]

Create a new surface. [...]

server_save(name?)

Instruct the server to save the map. [...]

Instruct the server to save the map. [...]

auto_save(name?)

Instruct the game to perform an auto-save. [...]

Instruct the game to perform an auto-save. [...]

delete_surface(surface)

Deletes the given surface and all entities on it.

Deletes the given surface and all entities on it.

disable_replay()

Disables replay saving for the current save file. [...]

Disables replay saving for the current save file. [...]

disable_tutorial_triggers()

Disables tutorial triggers, that unlock new tutorials and show notices about unlocked tutorials.

Disables tutorial triggers, that unlock new tutorials and show notices about unlocked tutorials.

direction_to_string(direction)  → string

Converts the given direction into the string version of the direction.

Converts the given direction into the string version of the direction.

print(message, print_settings?)

Print text to the chat console all players. [...]

Print text to the chat console all players. [...]

create_random_generator(seed?)  → LuaRandomGenerator

Creates a deterministic standalone random generator with the given seed or if a seed is not provided the initial map seed is used. [...]

Creates a deterministic standalone random generator with the given seed or if a seed is not provided the initial map seed is used. [...]

check_prototype_translations()

Goes over all items, entities, tiles, recipes, technologies among other things and logs if the locale is incorrect. [...]

Goes over all items, entities, tiles, recipes, technologies among other things and logs if the locale is incorrect. [...]

play_sound{path=…, position?=…, volume_modifier?=…, override_sound_type?=…}

Play a sound for every player in the game. [...]

Play a sound for every player in the game. [...]

is_valid_sound_path(sound_path)  → boolean

Checks if the given SoundPath is valid.

Checks if the given SoundPath is valid.

is_valid_sprite_path(sprite_path)  → boolean

Checks if the given SpritePath is valid and contains a loaded sprite. [...]

Checks if the given SpritePath is valid and contains a loaded sprite. [...]

kick_player(player, reason?)

Kicks the given player from this multiplayer game. [...]

Kicks the given player from this multiplayer game. [...]

ban_player(player, reason?)

Bans the given player from this multiplayer game. [...]

Bans the given player from this multiplayer game. [...]

unban_player(player)

Unbans the given player from this multiplayer game. [...]

Unbans the given player from this multiplayer game. [...]

purge_player(player)

Purges the given players messages from the game. [...]

Purges the given players messages from the game. [...]

mute_player(player)

Mutes the given player. [...]

Mutes the given player. [...]

unmute_player(player)

Unmutes the given player. [...]

Unmutes the given player. [...]

count_pipe_groups()

Counts how many distinct groups of pipes exist in the world.

Counts how many distinct groups of pipes exist in the world.

is_multiplayer()  → boolean

Whether the save is loaded as a multiplayer map.

Whether the save is loaded as a multiplayer map.

get_active_entities_count(surface?)  → uint

Gets the number of entities that are active (updated each tick). [...]

Gets the number of entities that are active (updated each tick). [...]

get_map_exchange_string()  → string

Gets the map exchange string for the map generation settings that were used to create this map.

Gets the map exchange string for the map generation settings that were used to create this map.

parse_map_exchange_string(map_exchange_string)  → MapExchangeStringData

Convert a map exchange string to map gen settings and map settings.

Convert a map exchange string to map gen settings and map settings.

get_train_stops{name?=…, surface?=…, force?=…}  → array[LuaEntity]

Gets train stops matching the given filters.

Gets train stops matching the given filters.

get_player(player)  → LuaPlayer?

Gets the given player or returns nil if no player is found.

Gets the given player or returns nil if no player is found.

get_surface(surface)  → LuaSurface?

Gets the given surface or returns nil if no surface is found. [...]

Gets the given surface or returns nil if no surface is found. [...]

create_profiler(stopped?)  → LuaProfiler

Creates a LuaProfiler, which is used for measuring script performance. [...]

Creates a LuaProfiler, which is used for measuring script performance. [...]

evaluate_expression(expression, variables?)  → double

Evaluate an expression, substituting variables as provided. [...]

Evaluate an expression, substituting variables as provided. [...]

get_filtered_entity_prototypes(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_filtered_item_prototypes(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_filtered_equipment_prototypes(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_filtered_mod_setting_prototypes(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_filtered_achievement_prototypes(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_filtered_tile_prototypes(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_filtered_decorative_prototypes(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_filtered_fluid_prototypes(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_filtered_recipe_prototypes(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_filtered_technology_prototypes(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. [...]

create_inventory(size)  → LuaInventory

Creates an inventory that is not owned by any game object. [...]

Creates an inventory that is not owned by any game object. [...]

get_script_inventories(mod?)  → dictionary[string → array[LuaInventory]]

Gets the inventories created through LuaGameScript::create_inventory. [...]

Gets the inventories created through LuaGameScript::create_inventory. [...]

reset_time_played()

Resets the amount of time played for this map.

Resets the amount of time played for this map.

encode_string(string)  → string?

Deflates and base64 encodes the given string.

Deflates and base64 encodes the given string.

decode_string(string)  → string?

Base64 decodes and inflates the given string.

Base64 decodes and inflates the given string.

get_train_by_id(train_id)  → LuaTrain?

Searches for a train with given ID.

Searches for a train with given ID.

request_train_path{goals=…, in_chain_signal_section?=…, train?=…, type?=…, return_path?=…, from_front?=…, allow_path_within_segment_front?=…, from_back?=…, allow_path_within_segment_back?=…, search_direction?=…, steps_limit?=…}  → TrainPathFinderPathResult or TrainPathAnyGoalResult or TrainPathAllGoalsResult

Direct access to Trains Pathfinder. [...]

Direct access to Trains Pathfinder. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

player [R] :: LuaPlayer?

This property is only populated inside custom command handlers and when writing Lua console commands. [...]

This property is only populated inside custom command handlers and when writing Lua console commands. [...]

players [R] :: LuaCustomTable[uint or string → LuaPlayer]

Get a table of all the players that currently exist. [...]

Get a table of all the players that currently exist. [...]

map_settings [R] :: MapSettings

The currently active set of map settings. [...]

The currently active set of map settings. [...]

difficulty_settings [R] :: DifficultySettings

The currently active set of difficulty settings. [...]

The currently active set of difficulty settings. [...]

difficulty [R] :: defines.difficulty

Current scenario difficulty.

Current scenario difficulty.

forces [R] :: LuaCustomTable[uint or string → LuaForce]

Get a table of all the forces that currently exist. [...]

Get a table of all the forces that currently exist. [...]

entity_prototypes [R] :: LuaCustomTable[string → LuaEntityPrototype]

A dictionary containing every LuaEntityPrototype indexed by name.

A dictionary containing every LuaEntityPrototype indexed by name.

item_prototypes [R] :: LuaCustomTable[string → LuaItemPrototype]

A dictionary containing every LuaItemPrototype indexed by name.

A dictionary containing every LuaItemPrototype indexed by name.

fluid_prototypes [R] :: LuaCustomTable[string → LuaFluidPrototype]

A dictionary containing every LuaFluidPrototype indexed by name.

A dictionary containing every LuaFluidPrototype indexed by name.

tile_prototypes [R] :: LuaCustomTable[string → LuaTilePrototype]

A dictionary containing every LuaTilePrototype indexed by name.

A dictionary containing every LuaTilePrototype indexed by name.

equipment_prototypes [R] :: LuaCustomTable[string → LuaEquipmentPrototype]

A dictionary containing every LuaEquipmentPrototype indexed by name.

A dictionary containing every LuaEquipmentPrototype indexed by name.

damage_prototypes [R] :: LuaCustomTable[string → LuaDamagePrototype]

A dictionary containing every LuaDamagePrototype indexed by name.

A dictionary containing every LuaDamagePrototype indexed by name.

virtual_signal_prototypes [R] :: LuaCustomTable[string → LuaVirtualSignalPrototype]

A dictionary containing every LuaVirtualSignalPrototype indexed by name.

A dictionary containing every LuaVirtualSignalPrototype indexed by name.

equipment_grid_prototypes [R] :: LuaCustomTable[string → LuaEquipmentGridPrototype]

A dictionary containing every LuaEquipmentGridPrototype indexed by name.

A dictionary containing every LuaEquipmentGridPrototype indexed by name.

recipe_prototypes [R] :: LuaCustomTable[string → LuaRecipePrototype]

A dictionary containing every LuaRecipePrototype indexed by name.

A dictionary containing every LuaRecipePrototype indexed by name.

technology_prototypes [R] :: LuaCustomTable[string → LuaTechnologyPrototype]

A dictionary containing every LuaTechnologyPrototype indexed by name.

A dictionary containing every LuaTechnologyPrototype indexed by name.

decorative_prototypes [R] :: LuaCustomTable[string → LuaDecorativePrototype]

A dictionary containing every LuaDecorativePrototype indexed by name.

A dictionary containing every LuaDecorativePrototype indexed by name.

particle_prototypes [R] :: LuaCustomTable[string → LuaParticlePrototype]

A dictionary containing every LuaParticlePrototype indexed by name.

A dictionary containing every LuaParticlePrototype indexed by name.

autoplace_control_prototypes [R] :: LuaCustomTable[string → LuaAutoplaceControlPrototype]

A dictionary containing every LuaAutoplaceControlPrototype indexed by name.

A dictionary containing every LuaAutoplaceControlPrototype indexed by name.

noise_layer_prototypes [R] :: LuaCustomTable[string → LuaNoiseLayerPrototype]

A dictionary containing every LuaNoiseLayerPrototype indexed by name.

A dictionary containing every LuaNoiseLayerPrototype indexed by name.

mod_setting_prototypes [R] :: LuaCustomTable[string → LuaModSettingPrototype]

A dictionary containing every LuaModSettingPrototype indexed by name.

A dictionary containing every LuaModSettingPrototype indexed by name.

custom_input_prototypes [R] :: LuaCustomTable[string → LuaCustomInputPrototype]

A dictionary containing every LuaCustomInputPrototype indexed by name.

A dictionary containing every LuaCustomInputPrototype indexed by name.

ammo_category_prototypes [R] :: LuaCustomTable[string → LuaAmmoCategoryPrototype]

A dictionary containing every LuaAmmoCategoryPrototype indexed by name.

A dictionary containing every LuaAmmoCategoryPrototype indexed by name.

named_noise_expressions [R] :: LuaCustomTable[string → LuaNamedNoiseExpression]

A dictionary containing every LuaNamedNoiseExpression indexed by name.

A dictionary containing every LuaNamedNoiseExpression indexed by name.

item_subgroup_prototypes [R] :: LuaCustomTable[string → LuaGroup]

A dictionary containing every ItemSubgroup indexed by name.

A dictionary containing every ItemSubgroup indexed by name.

item_group_prototypes [R] :: LuaCustomTable[string → LuaGroup]

A dictionary containing every ItemGroup indexed by name.

A dictionary containing every ItemGroup indexed by name.

fuel_category_prototypes [R] :: LuaCustomTable[string → LuaFuelCategoryPrototype]

A dictionary containing every LuaFuelCategoryPrototype indexed by name.

A dictionary containing every LuaFuelCategoryPrototype indexed by name.

resource_category_prototypes [R] :: LuaCustomTable[string → LuaResourceCategoryPrototype]

A dictionary containing every LuaResourceCategoryPrototype indexed by name.

A dictionary containing every LuaResourceCategoryPrototype indexed by name.

achievement_prototypes [R] :: LuaCustomTable[string → LuaAchievementPrototype]

A dictionary containing every LuaAchievementPrototype indexed by name.

A dictionary containing every LuaAchievementPrototype indexed by name.

module_category_prototypes [R] :: LuaCustomTable[string → LuaModuleCategoryPrototype]

A dictionary containing every LuaModuleCategoryPrototype indexed by name.

A dictionary containing every LuaModuleCategoryPrototype indexed by name.

equipment_category_prototypes [R] :: LuaCustomTable[string → LuaEquipmentCategoryPrototype]

A dictionary containing every LuaEquipmentCategoryPrototype indexed by name.

A dictionary containing every LuaEquipmentCategoryPrototype indexed by name.

trivial_smoke_prototypes [R] :: LuaCustomTable[string → LuaTrivialSmokePrototype]

A dictionary containing every LuaTrivialSmokePrototype indexed by name.

A dictionary containing every LuaTrivialSmokePrototype indexed by name.

shortcut_prototypes [R] :: LuaCustomTable[string → LuaShortcutPrototype]

A dictionary containing every LuaShortcutPrototype indexed by name.

A dictionary containing every LuaShortcutPrototype indexed by name.

recipe_category_prototypes [R] :: LuaCustomTable[string → LuaRecipeCategoryPrototype]

A dictionary containing every LuaRecipeCategoryPrototype indexed by name.

A dictionary containing every LuaRecipeCategoryPrototype indexed by name.

font_prototypes [R] :: LuaCustomTable[string → LuaFontPrototype]

A dictionary containing every LuaFontPrototype indexed by name.

A dictionary containing every LuaFontPrototype indexed by name.

map_gen_presets [R] :: LuaCustomTable[string → MapGenPreset]

A dictionary containing every MapGenPreset indexed by name. [...]

A dictionary containing every MapGenPreset indexed by name. [...]

console_command_used [R] :: boolean

Whether a console command has been used.

Whether a console command has been used.

styles [R] :: LuaCustomTable[string → string]

The styles that LuaGuiElement can use, indexed by name.

The styles that LuaGuiElement can use, indexed by name.

tick [R] :: uint

Current map tick.

Current map tick.

ticks_played [R] :: uint

The number of ticks since this game was created using either "new game" or "new game from scenario". [...]

The number of ticks since this game was created using either "new game" or "new game from scenario". [...]

tick_paused [RW] :: boolean

If the tick has been paused. [...]

If the tick has been paused. [...]

ticks_to_run [RW] :: uint

The number of ticks to be run while the tick is paused. [...]

The number of ticks to be run while the tick is paused. [...]

finished [R] :: boolean

True while the victory screen is shown.

True while the victory screen is shown.

finished_but_continuing [R] :: boolean

True after players finished the game and clicked "continue".

True after players finished the game and clicked "continue".

speed [RW] :: float

Speed to update the map at. [...]

Speed to update the map at. [...]

surfaces [R] :: LuaCustomTable[uint or string → LuaSurface]

Get a table of all the surfaces that currently exist. [...]

Get a table of all the surfaces that currently exist. [...]

active_mods [R] :: dictionary[string → string]

The active mods versions. [...]

The active mods versions. [...]

connected_players [R] :: array[LuaPlayer]

The players that are currently online. [...]

The players that are currently online. [...]

permissions [R] :: LuaPermissionGroups
backer_names [R] :: LuaCustomTable[uint → string]

Array of the names of all the backers that supported the game development early on. [...]

Array of the names of all the backers that supported the game development early on. [...]

default_map_gen_settings [R] :: MapGenSettings

The default map gen settings for this save.

The default map gen settings for this save.

enemy_has_vision_on_land_mines [RW] :: boolean

Determines if enemy land mines are completely invisible or not.

Determines if enemy land mines are completely invisible or not.

autosave_enabled [RW] :: boolean

True by default. [...]

True by default. [...]

draw_resource_selection [RW] :: boolean

True by default. [...]

True by default. [...]

pollution_statistics [R] :: LuaFlowStatistics

The pollution statistics for this map.

The pollution statistics for this map.

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] :: double
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

disabled [R] :: boolean

If the entity is currently disabled because of the control behavior.

If the entity is currently disabled because of the control behavior.

circuit_condition [RW] :: CircuitConditionDefinition

The circuit condition. [...]

The circuit condition. [...]

logistic_condition [RW] :: CircuitConditionDefinition

The logistic condition. [...]

The logistic condition. [...]

connect_to_logistic_network [RW] :: boolean

true if this should connect to the logistic network.

true if this should connect to the logistic network.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

name [R] :: string
localised_name [R] :: LocalisedString

Localised name of the group.

Localised name of the group.

type [R] :: string
group [R] :: LuaGroup

The parent group.

The parent group.

subgroups [R] :: array[LuaGroup]

Subgroups of this group.

Subgroups of this group.

order_in_recipe [R] :: string

The additional order value used in recipe ordering.

The additional order value used in recipe ordering.

order [R] :: string

The string used to alphabetically sort these prototypes. [...]

The string used to alphabetically sort these prototypes. [...]

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

ClassLuaGui

is_valid_sprite_path(sprite_path)  → boolean

Returns true if sprite_path is valid and contains loaded sprite, otherwise false. [...]

Returns true if sprite_path is valid and contains loaded sprite, otherwise false. [...]

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

player [R] :: LuaPlayer

The player who owns this gui.

The player who owns this gui.

children [R] :: dictionary[string → LuaGuiElement]

The children GUI elements mapped by name <> element.

The children GUI elements mapped by name <> element.

top [R] :: LuaGuiElement

The top part of the GUI. [...]

The top part of the GUI. [...]

left [R] :: LuaGuiElement

The left part of the GUI. [...]

The left part of the GUI. [...]

center [R] :: LuaGuiElement

The center part of the GUI. [...]

The center part of the GUI. [...]

goal [R] :: LuaGuiElement

The flow used in the objectives window. [...]

The flow used in the objectives window. [...]

screen [R] :: LuaGuiElement

For showing a GUI somewhere on the entire screen. [...]

For showing a GUI somewhere on the entire screen. [...]

relative [R] :: LuaGuiElement

For showing a GUI somewhere relative to one of the game GUIs. [...]

For showing a GUI somewhere relative to one of the game GUIs. [...]

valid [R] :: boolean

Is this object valid? [...]

Is this object valid? [...]

object_name [R] :: string

The class name of this object. [...]

The class name of this object. [...]

add{type=…, name?=…, caption?=…, tooltip?=…, elem_tooltip?=…, enabled?=…, visible?=…, ignored_by_interaction?=…, style?=…, tags?=…, index?=…, anchor?=…, game_controller_interaction?=…, raise_hover_events?=…}  → LuaGuiElement

Add a new child element to this GuiElement.

Add a new child element to this GuiElement.

clear()

Remove children of this element. [...]

Remove children of this element. [...]

destroy()

Remove this element, along with its children. [...]

Remove this element, along with its children. [...]

get_mod()  → string?

The mod that owns this Gui element or nil if it's owned by the scenario script. [...]

The mod that owns this Gui element or nil if it's owned by the scenario script. [...]

get_index_in_parent()  → uint

Gets the index that this element has in its parent element. [...]

Gets the index that this element has in its parent element. [...]

swap_children(index_1, index_2)

Swaps the children at the given indices in this element.

Swaps the children at the given indices in this element.

clear_items()

Removes the items in this dropdown or listbox.

Removes the items in this dropdown or listbox.

get_item(index)  → LocalisedString

Gets the item at the given index from this dropdown or listbox.

Gets the item at the given index from this dropdown or listbox.

set_item(index, string)

Sets the given string at the given index in this dropdown or listbox.

Sets the given string at the given index in this dropdown or listbox.

add_item(string, index?)

Inserts a string at the end or at the given index of this dropdown or listbox.

Inserts a string at the end or at the given index of this dropdown or listbox.

remove_item(index)

Removes the item at the given index from this dropdown or listbox.

Removes the item at the given index from this dropdown or listbox.

get_slider_minimum()  → double

Gets this sliders minimum value.

Gets this sliders minimum value.

get_slider_maximum()  → double

Gets this sliders maximum value.

Gets this sliders maximum value.

set_slider_minimum_maximum(minimum, maximum)

Sets this sliders minimum and maximum values. [...]

Sets this sliders minimum and maximum values. [...]

get_slider_value_step()  → double

Gets the minimum distance this slider can move.

Gets the minimum distance this slider can move.

get_slider_discrete_slider()  → boolean

Returns whether this slider only allows being moved to discrete positions.

Returns whether this slider only allows being moved to discrete positions.

get_slider_discrete_values()  → boolean

Returns whether this slider only allows discrete values.

Returns whether this slider only allows discrete values.

set_slider_value_step(value)

Sets the minimum distance this slider can move. [...]

Sets the minimum distance this slider can move. [...]

set_slider_discrete_slider(value)

Sets whether this slider only allows being moved to discrete positions.

Sets whether this slider only allows being moved to discrete positions.

set_slider_discrete_values(value)

Sets whether this slider only allows discrete values.

Sets whether this slider only allows discrete values.

focus()

Focuses this GUI element if possible.

Focuses this GUI element if possible.

scroll_to_top()

Scrolls this scroll bar to the top.

Scrolls this scroll bar to the top.

scroll_to_bottom()

Scrolls this scroll bar to the bottom.

Scrolls this scroll bar to the bottom.

scroll_to_left()

Scrolls this scroll bar to the left.

Scrolls this scroll bar to the left.

scroll_to_right()

Scrolls this scroll bar to the right.

Scrolls this scroll bar to the right.

scroll_to_element(element, scroll_mode?)

Scrolls this scroll bar such that the specified GUI element is visible to the player.

Scrolls this scroll bar such that the specified GUI element is visible to the player.

select_all()

Selects all the text in this textbox.

Selects all the text in this textbox.

select(start_index, end_index)

Selects a range of text in this textbox.

Selects a range of text in this textbox.

add_tab(tab, content)

Adds the given tab and content widgets to this tabbed pane as a new tab.

Adds the given tab and content widgets to this tabbed pane as a new tab.

remove_tab(tab)

Removes the given tab and its associated content from this tabbed pane. [...]

Removes the given tab and its associated content from this tabbed pane. [...]

force_auto_center()

Forces this frame to re-auto-center. [...]

Forces this frame to re-auto-center. [...]

scroll_to_item(index, scroll_mode?)

Scrolls the scroll bar such that the specified listbox item is visible to the player.

Scrolls the scroll bar such that the specified listbox item is visible to the player.

bring_to_front()

Moves this GUI element to the "front" so it will draw over other elements. [...]

Moves this GUI element to the "front" so it will draw over other elements. [...]

close_dropdown()

Closes the dropdown list if this is a dropdown and it is open.

Closes the dropdown list if this is a dropdown and it is open.

help()  → string

All methods and properties that this object supports.

All methods and properties that this object supports.

index [R] :: uint

The index of this GUI element (unique amongst the GUI elements of a LuaPlayer).

The index of this GUI element (unique amongst the GUI elements of a LuaPlayer).

gui [R] :: LuaGui

The GUI this element is a child of.

The GUI this element is a child of.

parent [R] :: LuaGuiElement?

The direct parent of this element. [...]

The direct parent of this element. [...]

name [RW] :: string

The name of this element. [...]

The name of this element. [...]

caption [RW] :: LocalisedString

The text displayed on this element. [...]

The text displayed on this element. [...]

value [RW] :: double

How much this progress bar is filled. [...]

How much this progress bar is filled. [...]

direction [R] :: GuiDirection

Direction of this element's layout.

Direction of this element's layout.

style [RW] :: LuaStyle or string

The style of this element. [...]

The style of this element. [...]

visible [RW] :: boolean

Sets whether this GUI element is visible or completely hidden, taking no space in the layout.

Sets whether this GUI element is visible or completely hidden, taking no space in the layout.

text [RW] :: string

The text contained in this textfield or text-box.

The text contained in this textfield or text-box.

children_names [R] :: array[string]

Names of all the children of this element. [...]

Names of all the children of this element. [...]

state [RW] :: boolean

Is this checkbox or radiobutton checked?

Is this checkbox or radiobutton checked?

player_index [R] :: uint

Index into LuaGameScript::players specifying the player who owns this element.

Index into LuaGameScript::players specifying the player who owns this element.

sprite [RW] :: SpritePath

The sprite to display on this sprite-button or sprite in the default state.

The sprite to display on this sprite-button or sprite in the default state.

resize_to_sprite [RW] :: boolean

Whether the sprite widget should resize according to the sprite in it. [...]

Whether the sprite widget should resize according to the sprite in it. [...]

hovered_sprite [RW] :: SpritePath

The sprite to display on this sprite-button when it is hovered.

The sprite to display on this sprite-button when it is hovered.

clicked_sprite [RW] :: SpritePath

The sprite to display on this sprite-button when it is clicked.

The sprite to display on this sprite-button when it is clicked.

tooltip [RW] :: LocalisedString

The text to display when hovering over this element. [...]

The text to display when hovering over this element. [...]

elem_tooltip [RW] :: ElemID?

The element tooltip to display when hovering over this element, or nil.

The element tooltip to display when hovering over this element, or nil.

horizontal_scroll_policy [RW] :: ScrollPolicy

Policy of the horizontal scroll bar.

Policy of the horizontal scroll bar.

vertical_scroll_policy [RW] :: ScrollPolicy

Policy of the vertical scroll bar.

Policy of the vertical scroll bar.

type [R] :: GuiElementType

The type of this GUI element.

The type of this GUI element.

children [R] :: array[LuaGuiElement]

The child-elements of this GUI element.

The child-elements of this GUI element.

items [RW] :: array[LocalisedString]

The items in this dropdown or listbox.

The items in this dropdown or listbox.

selected_index [RW] :: uint

The selected index for this dropdown or listbox. [...]

The selected index for this dropdown or listbox. [...]

number [RW] :: double

The number to be shown in the bottom right corner of this sprite-button. [...]

The number to be shown in the bottom right corner of this sprite-button. [...]

show_percent_for_small_numbers [RW] :: boolean

Related to the number to be shown in the bottom right corner of this sprite-button. [...]

Related to the number to be shown in the bottom right corner of this sprite-button. [...]

location [RW] :: GuiLocation?

The location of this widget when stored in LuaGui::screen. [...]

The location of this widget when stored in LuaGui::screen. [...]

auto_center [RW] :: boolean

Whether this frame auto-centers on window resize when stored in LuaGui::screen.

Whether this frame auto-centers on window resize when stored in LuaGui::screen.

badge_text [RW] :: LocalisedString

The text to display after the normal tab text (designed to work with numbers)

The text to display after the normal tab text (designed to work with numbers)

auto_toggle [RW] :: boolean

Whether this button will automatically toggle when clicked.

Whether this button will automatically toggle when clicked.

toggled [RW] :: boolean

Whether this button is currently toggled. [...]

Whether this button is currently toggled. [...]

game_controller_interaction [RW] :: defines.game_controller_interaction

How this element should interact with game controllers.

How this element should interact with game controllers.

position [RW] :: MapPosition

The position this camera or minimap is focused on, if any.

The position this camera or minimap is focused on, if any.

surface_index [RW] :: uint

The surface index this camera or minimap is using.

The surface index this camera or minimap is using.

zoom [RW] :: double

The zoom this camera or minimap is using. [...]

The zoom this camera or minimap is using. [...]

minimap_player_index [RW] :: uint

The player index this minimap is using.

The player index this minimap is using.

force [RW] :: string?

The force this minimap is using, if any.

The force this minimap is using, if any.

elem_type [R] :: ElemType

The elem type of this choose-elem-button.

The elem type of this choose-elem-button.

elem_value [RW] :: string or SignalID?

The elem value of this choose-elem-button, if any. [...]

The elem value of this choose-elem-button, if any. [...]

elem_filters [RW] :: PrototypeFilter?

The elem filters of this choose-elem-button, if any. [...]

The elem filters of this choose-elem-button, if any. [...]

selectable [RW] :: boolean

Whether the contents of this text-box are selectable. [...]

Whether the contents of this text-box are selectable. [...]

word_wrap [RW] :: boolean

Whether this text-box will word-wrap automatically. [...]

Whether this text-box will word-wrap automatically. [...]

read_only [RW] :: boolean

Whether this text-box is read-only. [...]

Whether this text-box is read-only. [...]

enabled [RW] :: boolean

Whether this GUI element is enabled. [...]

Whether this GUI element is enabled. [...]

ignored_by_interaction [RW]