Factorio API Docs

1.1.50 <>

Classes

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.



LuaCommandProcessor

Allows for the registration of custom console 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 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.


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.


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.


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.


:: boolean
[RW]

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


:: boolean
[RW]

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


:: boolean
[RW]

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


:: int8
[RW]

The pathing resolution modifier, must be between -8 and 8.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.



:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Order string of this prototype.





:: boolean
[R]

:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Order string of this prototype.





:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


[RW]

The arithmetic combinator parameters.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.



help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Order string of this prototype.




:: boolean
[R]


:: string
[R]

Category name of this prototype.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaBootstrap

on_init(f)

Register a callback to be run on mod initialization.


on_load(f)

Register a function to be run on save load.


Register a function to be run when mod configuration changes.


on_event(event, f, filters)

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


on_nth_tick(tick, f)

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


uint64

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


uint

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


→ function(EventData)

Find the event handler for an event.


string

Gets the mod event order as a string.


set_event_filter(event, filters)

Sets the filters for the given event.


→ array[EventFilter]

Gets the filters for the given event.


raise_event(event, data)

Raise an event.


raise_console_chat{player_index, message}

Raises on_console_chat with the given parameters.


raise_player_crafted_item{item_stack, player_index, recipe}

Raises on_player_crafted_item with the given parameters.


raise_player_fast_transferred{player_index, entity, from_player}

Raises on_player_fast_transferred with the given parameters.


Raises on_biter_base_built with the given parameters.


raise_market_item_purchased{player_index, market, offer_index, count}

Raises on_market_item_purchased with the given parameters.


Raises script_raised_built with the given parameters.


Raises script_raised_destroy with the given parameters.


raise_script_revive{entity, tags}

Raises script_raised_revive with the given parameters.


raise_script_set_tiles{surface_index, tiles}

Raises script_raised_set_tiles with the given parameters.


:: string
[R]

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


:: table
[R]

Information about the currently running scenario/campaign/tutorial.


:: dictionary[stringstring]
[R]

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


:: string
[R]

This object's name.

Class LuaBurner

help()
string

All methods and properties that this object supports.


[R]

The owner of this burner energy source


[R]

The fuel inventory.


[R]

The burnt result inventory.


:: double
[RW]




:: dictionary[stringboolean]
[R]

The fuel categories this burner uses.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: double
[R]






:: array[SmokeSource]
[R]

The smoke sources for this burner prototype if any.


:: table
[R]

The light flicker definition for this burner prototype if any.


:: dictionary[stringboolean]
[R]

:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Get the next chunk position or nil, and increments the iterator.


help()
string

All methods and properties that this object supports.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

get_signal(signal)
int

help()
string

All methods and properties that this object supports.


[R]

The entity this circuit network reference is associated with


[R]

The wire type this network is associated with.


[R]

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


:: array[Signal]
[R]

The circuit network signals last tick.


:: uint
[R]

The circuit networks ID.


:: uint
[R]

The number of circuits connected to this network.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

int

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


:: array[Signal]
[R]

The circuit network signals sent by this combinator last tick.


add_command(name, help, function)

Add a custom console command.


boolean

Remove a custom console command.


:: dictionary[stringLocalisedString]
[R]

Lists the custom commands registered by scripts through LuaCommandProcessor.


:: dictionary[stringLocalisedString]
[R]

Lists the built-in commands of the core game.


:: string
[R]

This object's name.

set_signal(index, signal)

Sets the signal at the given index


get_signal(index)
Signal

Gets the signal at the given index.


help()
string

All methods and properties that this object supports.


[RW]

The constant combinator parameters


:: boolean
[RW]

Turns this constant combinator on and off.


:: uint
[R]

The number of signals this constant combinator supports


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


help()
string

All methods and properties that this object supports.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


Class LuaControl

get_inventory(inventory)

Get an inventory belonging to this entity.


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?


insert(items)
uint

Insert items into this entity.


Create an arrow which points at this entity.


Removes the arrow created by set_gui_arrow.


uint

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


boolean

Does this entity have any item inside it?


boolean

Can a given entity be opened or accessed?


Remove all items from this entity.


remove_item(items)
uint

Remove items from this entity.


teleport(position, surface)
boolean

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


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


Unselect any selected entity.


Disable the flashlight.


Enable the flashlight.


Is the flashlight enabled.


uint

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.


cancel_crafting{index, count}

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.


mine_tile(tile)
boolean

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


boolean

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.


set_personal_logistic_slot(slot_index, value)
boolean

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.


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


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




boolean

Returns whether the player is holding a blueprint.


→ 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.


boolean

Returns whether the player is holding something in the cursor.


[R]

The surface this entity is currently on.


[R]

Current position of the entity.


[R]

The vehicle the player is currently sitting in; nil if none.


[RW]

The force of this entity.


[RW]

The currently selected entity; nil if none.


[RW]

The GUI the player currently has open, or nil if no GUI is open.


:: uint
[R]

Size of the crafting queue.


:: double
[R]

The crafting queue progress [0-1] 0 when no recipe is being crafted.


:: table
[RW]

Current walking state.


[RW]

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


:: table
[RW]

Current mining state.


:: table
[RW]

Current shooting state.


:: boolean
[RW]

Current item-picking state.


:: table
[RW]

Current repair state.


[R]

The player's cursor stack, or nil if the player controller is a spectator.


[RW]

The ghost prototype in the player's cursor.


:: boolean
[RW]

true if the player is in a vehicle.


:: array[CraftingQueueItem]
[R]

Gets the current crafting queue items.


:: array[LuaEntity]
[R]

The current combat robots following the character


:: boolean
[RW]

When true hand crafting is free and instant





:: double
[RW]

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












:: boolean
[RW]

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


:: boolean
[RW]

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



:: uint
[R]

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


:: uint
[R]

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


:: uint
[R]

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


:: double
[R]

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


:: double
[R]

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


:: double
[R]

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


:: boolean
[R]

If this character entity is in combat.


:: double
[R]

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


:: double
[R]

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

get_circuit_network(wire, circuit_connector)

[R]

The concrete type of this control behavior.


[R]

The entity this control behavior belongs to.

Destroys this tag.


help()
string

All methods and properties that this object supports.


[RW]

This tag's icon, if it has one.


[RW]

The player who last edited this tag.


[R]

The position of this tag.


:: string
[RW]

:: uint
[R]

The unique ID for this tag on this force.


[R]

The force this tag belongs to.


[R]

The surface this tag belongs to.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Order string of this prototype.




:: string
[R]

The default key sequence for this custom input.


:: string
[R]

The default alternative key sequence for this custom input.


:: string
[R]

The linked game control name or nil.


:: string
[R]

The consuming type: "none" or "game-only".


:: string
[R]

The action that happens when this custom input is triggered.


:: boolean
[R]

If this custom input is enabled.


:: boolean
[R]

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


:: boolean
[R]

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


:: boolean
[R]

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


[R]

The item that gets spawned when this custom input is fired or nil.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

:: Any
[RW]

Access an element of this custom table.


:: uint
[R]

Number of elements in this table.


help()
string

All methods and properties that this object supports.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Order string of this prototype.




:: boolean
[R]

Whether this damage type is hidden from entity tooltips.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


[RW]

The decider combinator parameters


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.



help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Order string of this prototype.




[R]

The bounding box used for collision checking.


[R]

The collision masks this decorative uses



[R]

Autoplace specification for this decorative prototype.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.






:: double
[R]

:: double
[R]



:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaEntity extends LuaControl

Gets the entities output inventory if it has one.



The fuel inventory for this entity or nil if this entity doesn't have a fuel 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.


boolean

Checks if the entity can be destroyed


destroy{do_cliff_correction, raise_destroy}
boolean

Destroys the entity.


set_command(command)

Give the entity a command.


Give the entity a distraction command.


boolean

Has this unit been assigned a command?


die(force, cause)
boolean

Immediately kills the entity.


has_flag(flag)
boolean

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


boolean

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


Offer a thing on the market.


boolean

Remove an offer from a market.


→ array[Offer]

Get all offers in a market as an array.


Removes all offers from a market.


boolean

Connect two devices with a circuit wire or copper cable.


Disconnect circuit wires or copper cables between devices.


order_deconstruction(force, player)
boolean

Sets the entity to be deconstructed by construction robots.


cancel_deconstruction(force, player)

Cancels deconstruction if it is scheduled, does nothing otherwise.


boolean

Is this entity marked for deconstruction?


order_upgrade{force, target, player, direction}
boolean

Sets the entity to be upgraded by construction robots.


cancel_upgrade(force, player)
boolean

Cancels upgrade if it is scheduled, does nothing otherwise.


boolean

Is this entity marked for upgrade?


Get a logistic requester slot.


set_request_slot(request, slot)
boolean

Set a logistic requester slot.


Clear a logistic requester slot.


Returns whether a craft is currently in process.






request_to_open(force, extra_time)


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


uint

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



revive{return_item_request_proxy, raise_revive}
→ dictionary[stringuint]

Revive a ghost.


silent_revive{return_item_request_proxy, raise_revive}
→ dictionary[stringuint]

Revives a ghost silently.


get_connected_rail{rail_direction, rail_connection_direction}
LuaEntity

→ array[LuaEntity]

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, or nil if the rail segment doesn't start/end with a signal nor a train stop.


LuaEntity

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


double

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


→ array[LuaEntity]

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


get_filter(slot_index)
string

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.


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


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


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


Sets the filter for this infinity pipe.


Gets the heat setting for this heat interface.


Sets the heat setting for this heat interface.


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


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


get_circuit_network(wire, circuit_connector)

get_merged_signal(signal, circuit_connector)
int

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.


boolean

Whether this entity supports a backer name.


copy_settings(entity, by_player)
→ dictionary[stringuint]

Copies settings from the given entity onto this entity.


Gets all the LuaLogisticPoints that this entity owns.


play_note(instrument, note)
boolean

Plays a note with the given instrument and note.


boolean

Connects the rolling stock in the given direction.


boolean

Tries to disconnect this rolling stock in the given direction.


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


LuaRecipe

Current recipe being assembled by this machine or nil if no recipe is set.


set_recipe(recipe)
→ dictionary[stringuint]

Sets the current recipe in this assembly machine.


rotate{reverse, by_player, spill_items, enable_looted, force}
boolean

Rotates this entity as if the player rotated it.


Gets the driver of this vehicle if any.


set_driver(driver)

Sets the driver of this vehicle.


Gets the passenger of this car or spidertron if any.


set_passenger(passenger)

Sets the passenger of this car or spidertron.


boolean

Returns true if this entity is connected to an electric network.


→ array[LuaTrain]

The trains scheduled to stop at this train stop.


LuaTrain

The train currently stopped at this train stop or nil if none.


clone{position, surface, force, create_build_effect_smoke}
LuaEntity

Clones this entity.


double

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


→ dictionary[stringdouble]

Get amounts of all fluids in this entity.


remove_fluid{name, amount, minimum_temperature, maximum_temperature, temperature}
double

Remove fluid from this entity.


insert_fluid(fluid)
double

Insert fluid into this entity.


Remove all fluids from this entity.


Get the source of this beam.


set_beam_source(source)

Set the source of this beam.


Get the target of this beam.


set_beam_target(target)

Set the target of this beam.


double

The radius of this entity.


float

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


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


Release the unit from the spawner which spawned it.


Toggle this entity's equipment movement bonus.


can_shoot(target, position)
boolean

If this character can shoot the given entity or position.


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


Returns the new entity prototype.


Returns the new entity direction after upgrading.


float

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


Depletes and destroys this resource entity.


mine{inventory, force, raise_destroyed, ignore_minable}
boolean

Mines this entity.


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.


LuaEntity

Gets rolling stock connected to the given end of this stock


boolean

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


boolean

Is this entity registered for deconstruction with this force?


boolean

Is this entity registered for upgrade?


boolean

Is this entity registered for repair?


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


Connects current linked belt with another one.


Disconnects linked belt from its neighbour.


help()
string

All methods and properties that this object supports.


:: string
[R]

Name of the entity prototype.


:: string
[R]

Name of the entity or tile contained in this ghost


[R]

Localised name of the entity.



[R]

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



:: string
[R]

The entity prototype type of this entity.


:: string
[R]

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


:: boolean
[RW]

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


:: boolean
[RW]

When the entity is not destructible it can't be damaged.


:: boolean
[RW]

:: boolean
[RW]

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


:: boolean
[RW]

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.


:: float
[RW]

The current health of the entity, or nil if it doesn't have health.


[RW]

The current direction this entity is facing.


:: boolean
[R]

Whether the entity has direction.


[RW]

The smooth orientation of this entity, if it supports orientation.


[R]

The orientation of this cliff.


[RW]

The relative orientation of the vehicle turret, artillery turret, artillery wagon or nil if this entity isn't a vehicle with a vehicle turret or artillery turret/wagon.


[RW]

The torso orientation of this spider vehicle.


:: uint
[RW]

Count of resource units contained.


:: uint
[RW]

Count of initial resource units contained.


:: float
[RW]

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


:: float
[RW]

Multiplies the energy consumption.


:: float
[RW]

Multiplies the car friction rate.


:: boolean
[RW]

Whether the driver of this car or spidertron is the gunner, if false, the passenger is the gunner.


[RW]

Read when this spidertron auto-targets enemies


:: float
[RW]

The current speed of this car in tiles per tick, rolling stock, projectile or spider vehicle, or current max speed of the unit.


:: float
[R]

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.



[R]

The entity prototype of this entity.


[R]

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


[RW]

Position where the entity puts its stuff.


[RW]

Where the inserter will pick up items from.


[RW]

The entity this entity is putting its items to, or nil if there is no such entity.


[RW]

The entity this inserter will attempt to pick up items from, or nil if there is no such entity.


:: uint
[RW]

Index of the currently selected weapon slot of this character, car, or spidertron, or nil if the car/spidertron doesn't have guns.


:: double
[RW]

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


:: double
[RW]

The temperature of this entities heat energy source if this entity uses a heat energy source or nil.


[R]

The previous recipe this furnace was using or nil if the furnace had no previous recipe.


[R]

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


[R]

Current position of the inserter's "hand".


[R]

The train this rolling stock belongs to or nil if not rolling stock.


:: dictionary[string → array[LuaEntity]] or array[array[LuaEntity]] or LuaEntity
[R]
  • When called on an electric pole, this is a dictionary of all connections, indexed by the strings "copper", "red", and "green".

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

The belt connectable neighbours of this belt connectable entity.


[RW]

Fluidboxes of this entity.


:: string
[RW]

The backer name assigned to this entity, or nil if this entity doesn't support backer names.


:: string
[RW]

The label of this entity if it has one or nil.


:: uint
[RW]

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


:: Color
[RW]

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


[RW]

The text of this flying-text entity.


[R]

The state of this rail signal.


[R]

The state of this chain signal.


:: boolean
[RW]

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


:: double
[R]

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


:: float
[RW]

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


:: double
[RW]

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


:: double
[R]

The productivity bonus of this entity.


:: double
[R]

The pollution bonus of this entity.


:: double
[R]

The speed bonus of this entity.


:: double
[R]

The consumption bonus of this entity.


:: string
[R]

"input" or "output", depending on whether this underground belt goes down or up.


:: string
[RW]

"input" or "output", depending on whether this loader puts to or gets from a container.


:: uint
[RW]

Number of rocket parts in the silo.


[RW]

The logistic network this entity is a part of.


[R]

The logistic cell this entity is a part of.


:: dictionary[stringuint]
[RW]

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


[R]

The player connected to this character or nil if none.


[R]

The unit group this unit is a member of, or nil if none.


:: double
[RW]

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


:: uint
[RW]

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


[RW]

The last player that changed any setting on this entity.


:: double
[RW]

The buffer size for the electric energy source or nil if the entity doesn't have an electric energy source.


:: double
[R]

The input flow limit for the electric energy source or nil if the entity doesn't have an electric energy source.


:: double
[R]

The output flow limit for the electric energy source or nil if the entity doesn't have an electric energy source.


:: double
[R]

The electric drain for the electric energy source or nil if the entity doesn't have an electric energy source.


:: double
[R]

The emissions for the electric energy source or nil if the entity doesn't have an electric energy source.


:: uint
[R]

The unit number or nil if the entity doesn't have one.


:: uint
[R]

The unit number of the entity contained in this ghost or nil if the entity doesn't have one.


:: double
[RW]

The mining progress for this mining drill or nil if this isn't a mining drill.


:: double
[RW]

The bonus mining progress for this mining drill or nil if this isn't a mining drill.


:: double
[RW]

The power production specific to the ElectricEnergyInterface entity type.


:: double
[RW]

The power usage specific to the ElectricEnergyInterface entity type.


[R]

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


[R]

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


[R]

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


[R]

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


[R]

The mining target or nil if none


:: table
[R]

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


[R]

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


:: uint
[R]

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


:: uint
[R]

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


[R]

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


[R]

The equipment grid or nil if this entity doesn't have an equipment grid.


:: uint8
[RW]

The graphics variation for this entity or nil if this entity doesn't use graphics variations.


:: uint8
[RW]

Index of the tree color.


:: uint8
[R]

Maximum index of the tree colors.


:: uint8
[RW]

Index of the tree stage.


:: uint8
[R]

Maximum index of the tree stages.


:: uint8
[RW]

Index of the tree gray stage


:: uint8
[R]

Maximum index of the tree gray stages.


[R]

The burner energy source for this entity or nil if there isn't one.


[RW]

The shooting target for this turret or nil.


[R]

The target entity for this item-request-proxy or nil


:: array[LuaEntity]
[R]

The sticker entities attached to this entity or nil if none.


[R]

The entity this sticker is sticked to.




[R]

The electric network statistics for this electric pole.


:: uint
[RW]

Sets the stack size limit on this inserter.


:: uint
[RW]

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


[R]

The spawner associated with this unit entity or nil if the unit has no associated spawner.


:: array[LuaEntity]
[R]

The units associated with this spawner entity.


:: boolean
[RW]

The state of this power switch.


[R]

The effects being applied to this entity or nil.


[RW]

The filters for this infinity container.


:: boolean
[RW]

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


:: uint
[RW]

The player index associated with this character corpse.


:: uint
[RW]

The tick this character corpse died at.


[RW]

The reason this character corpse character died (if any).


[RW]

The player this character is associated with or nil if none.


:: uint
[RW]

The last tick this character entity was attacked.


:: uint
[RW]

The last tick this character entity was damaged.


[RW]

The filter for this splitter or nil if no filter is set.


:: string
[RW]

The filter mode for this filter inserter: "whitelist", "blacklist", or nil if this inserter doesn't use filters.


:: string
[RW]

The input priority for this splitter : "left", "none", or "right".


:: string
[RW]

The output priority for this splitter : "left", "none", or "right".


:: boolean
[R]

If this land mine is armed.


:: boolean
[RW]

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


[R]

The rail entity this train stop is connected to or nil if there is none.


[R]

Rail direction to which this train stop is binding.


:: uint
[R]

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


:: uint
[RW]

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


:: double
[R]

The current total neighbour bonus of this reactor.


[R]

The ai settings of this unit.


:: string
[RW]

The hightlight box type of this highlight box entity.


:: uint
[RW]

The blink interval of this highlight box entity.


[R]

The status of this entity or nil if no status.


:: boolean
[RW]

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


[RW]

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


[RW]

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


[R]

The rail target of this pump or nil.


:: boolean
[R]

Returns true if this unit is moving.


:: uint
[R]

Returns the id of the electric network that this entity is connected to or nil.


:: boolean
[RW]

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


:: boolean
[RW]

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


:: double
[R]

How much energy this generator generated in the last tick.


[RW]

The storage filter for this logistic storage container.


:: boolean
[RW]

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


:: boolean
[RW]

Whether this corpse will ever fade away.


:: boolean
[RW]

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


:: Tags
[RW]

The tags associated with this entity ghost or nil if not an entity ghost.


:: Command
[R]

The command given to this unit or nil is the unit has no command.


:: Command
[R]

The distraction command given to this unit or nil is the unit currently isn't distracted.


:: uint
[RW]

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


[RW]

Destination position of spidertron's autopilot.


:: array[MapPosition]
[R]

The queued destination positions of spidertron's autopilot.


:: uint
[R]

Amount of trains related to this particular train stop.


:: uint
[RW]

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


:: boolean
[R]

If this entity is EntityWithForce


:: boolean
[R]

If this entity is EntityWithOwner


:: boolean
[R]

If this entity is EntityWithHealth


[RW]

The owner of this combat robot if any.


:: uint
[RW]

The link ID this linked container is using.


[RW]

The follow target of this spidertron if any.


[RW]

The follow offset of this spidertron if any.


:: string
[RW]

Type of linked belt: it is either "input" or "output".


[R]

Neighbour to which this linked belt is connected to.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


Inherited from LuaControl: surface, position, vehicle, force, selected, opened, crafting_queue_size, crafting_queue_progress, walking_state, riding_state, mining_state, shooting_state, picking_state, repair_state, cursor_stack, cursor_ghost, driving, crafting_queue, following_robots, cheat_mode, character_crafting_speed_modifier, character_mining_speed_modifier, character_additional_mining_categories, character_running_speed_modifier, character_build_distance_bonus, character_item_drop_distance_bonus, character_reach_distance_bonus, character_resource_reach_distance_bonus, character_item_pickup_distance_bonus, character_loot_pickup_distance_bonus, character_inventory_slots_bonus, character_trash_slot_count_bonus, character_maximum_following_robot_count_bonus, character_health_bonus, character_personal_logistic_requests_enabled, vehicle_logistic_requests_enabled, opened_gui_type, build_distance, drop_item_distance, reach_distance, item_pickup_distance, loot_pickup_distance, resource_reach_distance, in_combat, character_running_speed, character_mining_progress, get_inventory, get_main_inventory, can_insert, insert, set_gui_arrow, clear_gui_arrow, get_item_count, has_items_inside, can_reach_entity, clear_items_inside, remove_item, teleport, update_selected_entity, clear_selected_entity, disable_flashlight, enable_flashlight, is_flashlight_enabled, get_craftable_count, begin_crafting, cancel_crafting, mine_entity, mine_tile, is_player, open_technology_gui, set_personal_logistic_slot, set_vehicle_logistic_slot, get_personal_logistic_slot, get_vehicle_logistic_slot, clear_personal_logistic_slot, clear_vehicle_logistic_slot, is_cursor_blueprint, get_blueprint_entities, is_cursor_empty
has_flag(flag)
boolean

Test whether this entity prototype has a certain flag set.


uint

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.


:: string
[R]

Type of this prototype.


:: string
[R]

Name of this prototype.




:: float
[R]

Max health of this entity.


:: boolean
[R]

Is this resource infinite?


:: uint
[R]

Minimum amount of this resource.


:: uint
[R]

The normal amount for this resource.


:: uint
[R]

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


:: string
[R]

Name of the category of this resource or nil when not a resource.


:: table
[R]

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


:: array[SimpleItemStack]
[R]

Items that, when placed, will produce this entity.


[R]

The bounding box used for collision checking.


[R]

The secondary bounding box used for collision checking, or nil if it doesn't have one.


[R]

The bounding box used for map generator collision checking.


[R]

The bounding box used for drawing selection.


[R]

The bounding box used for drawing the entity icon.


[R]

The bounding box used to attach sticker type entities.


[R]

The collision masks this entity uses



[R]

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


:: string
[R]

Order string of this prototype.


[R]

Group of this entity.


[R]

Subgroup of this entity.


:: float
[R]

Amount this entity can heal per tick.


:: double
[R]

Amount of pollution emissions per second this entity will create.


:: dictionary[stringLuaEntityPrototype]
[R]

Corpses used when this entity is destroyed.


:: boolean
[R]

Is this entity selectable?


:: uint
[R]

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


:: double
[R]

The weight of this vehicle prototype or nil if not a vehicle prototype.


:: dictionary[stringResistance]
[R]

List of resistances towards each damage type.


:: string
[R]

The group of mutually fast-replaceable entities.


[R]

The next upgrade for this entity or nil.


:: array[Loot]
[R]

Loot that will be dropped when this entity is killed.


:: uint
[R]

Repair-speed modifier for this entity.


:: uint
[R]

The range of this turret or nil if this isn't a turret related prototype.


[R]

Autoplace specification for this entity prototype.


:: double
[R]

The speed of this transport belt or nil if this isn't a transport belt related prototype.


[R]

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


:: array[TriggerItem]
[R]

The attack result of this entity if the entity has one, else nil.


:: array[TriggerItem]
[R]

The final attack result for projectiles nil if not a projectile


[R]

The attack parameters for this entity or nil if the entity doesn't use attack parameters.


:: table
[R]

The spawning cooldown for this enemy spawner prototype or nil.


:: double
[R]

The mining radius of this mining drill prototype or nil if this isn't a mining drill prototype.


:: double
[R]

The mining speed of this mining drill/character prototype or nil.


:: string
[R]

The logistic mode of this logistic container or nil if this isn't a logistic container prototype.


:: uint8
[R]

The max underground distance for underground belts and underground pipes or nil if this isn't one of those prototypes.


[R]

The flags for this entity prototype.


:: array[LuaEntityPrototype]
[R]

The remains left behind when this entity is mined.


:: array[LuaEntityPrototype]
[R]

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


:: boolean
[R]

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


:: double
[R]

The cursor size used when shooting at this entity.


:: table
[R]

The smoke trigger run when this entity is built or nil.


:: array[TriggerItem]
[R]

The trigger run when this entity is created or nil.


:: Color
[R]

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


:: Color
[R]

The friendly map color used when charting this entity.


:: Color
[R]

The enemy map color used when charting this entity.


:: double
[R]

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


[R]

The instruments for this programmable speaker or nil.


:: uint
[R]

The maximum polyphony for this programmable speaker or nil.


:: uint
[R]

The module inventory size or nil if this entity doesn't support modules.


:: uint
[R]

The max number of ingredients this crafting-machine prototype supports or nil if this isn't a crafting-machine prototype.


:: double
[R]

The crafting speed of this crafting-machine or nil.


:: dictionary[stringboolean]
[R]

The crafting categories this entity supports.


:: dictionary[stringboolean]
[R]

The resource categories this character or mining drill supports, or nil if not a character or mining dill.


:: double
[R]

The supply area of this electric pole, beacon, or nil if this is neither.


:: double
[R]

The maximum wire distance for this entity.


:: double
[R]

The maximum circuit wire distance for this entity.


:: double
[R]

The direct energy usage of this entity or nil if this entity doesn't have a direct energy usage.


:: double
[R]

The theoretical maximum energy usage for this entity.


:: double
[R]

The theoretical maximum energy production for this this entity.


:: double
[R]

The effectivity of this car prototype, generator prototype or nil.


:: double
[R]

The energy consumption of this car prototype or nil if not a car prototype.


:: double
[R]

The friction of this vehicle prototype or nil if not a vehicle prototype.


:: double
[R]

The braking force of this vehicle prototype or nil if not a vehicle prototype.


:: double
[R]

The air resistance of this rolling stock prototype or nil if not a rolling stock prototype.


:: boolean
[R]

If this car prototype uses tank controls to drive or nil if this is not a car prototype.


:: double
[R]

The rotation speed of this car prototype or nil if not a car prototype.


:: double
[R]

The turret rotation speed of this car prototype or nil if not a car prototype.


:: dictionary[stringLuaItemPrototype]
[R]

The guns this prototype uses or nil.


:: double
[R]

The default speed of this flying robot, rolling stock or unit, nil if not one of these.


:: float
[R]

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


:: uint
[R]

The max payload size of this logistics or construction robot or nil.


:: boolean
[R]

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


:: double
[R]

The energy consumed per tile moved for this flying robot or nil.


:: double
[R]

The energy consumed per tick for this flying robot or nil.


:: double
[R]

The max energy for this flying robot or nil.


:: float
[R]

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


:: float
[R]

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


[R]

The burner energy source prototype this entity uses or nil.


[R]

The electric energy source prototype this entity uses or nil.


[R]

The heat energy source prototype this entity uses or nil.


[R]

The fluid energy source prototype this entity uses or nil.


[R]

The void energy source prototype this entity uses or nil.


:: uint
[R]

The log2 of grid size of the building


:: double
[R]

The fluid usage of this generator prototype or nil.


:: double
[R]

The maximum fluid temperature of this generator prototype or nil.


:: double
[R]

The target temperature of this boiler prototype or nil.


[R]

The fluid this offshore pump produces or nil.


:: double
[R]

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


:: double
[R]

The pumping speed of this offshore pump, normal pump, or nil.


:: boolean
[R]

If this inserter is a stack-type.


:: boolean
[R]

If this inserter allows custom pickup and drop vectors.


:: boolean
[R]

If this inserter allows burner leeching.


:: double
[R]

The extension speed of this inserter or nil.


:: double
[R]

The rotation speed of this inserter or nil.


:: Vector
[R]

The pickup position for this inserter or nil.


:: Vector
[R]

The drop position for this inserter or nil.


:: boolean
[R]

True if this inserter chases items on belts for pickup or nil.


:: boolean
[R]

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


:: uint
[R]

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


:: uint
[R]

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


:: double
[R]

The distribution effectivity for this beacon prototype or nil if not a beacon prototype.


:: double
[R]

Does this explosion have a beam or nil if not an explosion prototype.


:: double
[R]

Does this explosion rotate or nil if not an explosion prototype.


:: uint8
[R]

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


:: boolean
[R]

Does this entity with health prototype alert when damaged?


:: boolean
[R]

Does this turret prototype alert when attacking?


:: Color
[R]

The color of the prototype, or nil if the prototype doesn't have color.


:: boolean
[R]

Does this prototype collision mask collide with itself?


:: boolean
[R]

Does this prototype collision mask collide with tiles only?


:: boolean
[R]

Does this prototype collision mask consider tile transitions?


:: dictionary[stringboolean]
[R]

The allowed module effects for this entity or nil.


:: uint
[R]

The rocket parts required for this rocket silo prototype or nil.


:: uint8
[R]

The rocket rising delay for this rocket silo prototype or nil.


:: uint8
[R]

The rocket launch delay for this rocket silo prototype or nil.


:: double
[R]

The light blinking speed for this rocket silo prototype or nil.


:: double
[R]

The door opening speed for this rocket silo prototype or nil.


:: double
[R]

The rising speed for this rocket silo rocket prototype or nil.


:: double
[R]

The engine starting speed for this rocket silo rocket prototype or nil.


:: double
[R]

The flying speed for this rocket silo rocket prototype or nil.


:: double
[R]

The flying acceleration for this rocket silo rocket prototype or nil.


:: string
[R]

The fixed recipe name for this assembling machine prototype or nil.


:: double
[R]

The construction radius for this roboport prototype or nil.


:: double
[R]

The logistic radius for this roboport prototype or nil.


:: double
[R]

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


:: boolean
[R]

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


:: uint
[R]

The time it takes this land mine to arm.


[R]

The fluidbox prototypes for this entity.







:: uint
[R]

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


:: double
[R]

The max speed of this projectile prototype or flying robot prototype or nil.


:: float
[R]

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


:: float
[R]

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


:: boolean
[R]

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


:: float
[R]

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


:: float
[R]

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



:: double
[R]

Count of enemies this spawner can sustain.


:: double
[R]

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


:: double
[R]

How far from the spawner can the units be spawned.


:: double
[R]

What spaces should be between the spawned units.


:: double
[R]

The radius of this entity prototype.


:: string
[R]

The item prototype name used to destroy this cliff or nil.


[R]

The rocket entity prototype associated with this rocket silo prototype or nil.


:: boolean
[R]

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


:: double
[R]

The vision distance of this unit prototype or nil.


:: float
[R]

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.


:: uint
[R]

The minimum pursue time of this unit prototype or nil.


:: double
[R]

The maximum pursue distance of this unit prototype or nil.


:: uint
[R]

The radar range of this unit prototype or nil.


:: boolean
[R]

Whether this unit prototype can move while shooting or nil.


:: boolean
[R]

Whether this unit prototype can open gates or nil.


:: boolean
[R]

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


:: uint
[R]

The distraction cooldown of this unit prototype or nil.


:: double
[R]

The spawning time modifier of this unit prototype or nil.


:: Vector
[R]

The alert icon shift of this entity prototype.


:: array[string]
[R]

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


:: double
[R]

The base researching speed of this lab prototype or nil.


:: uint
[R]

The item slot count of this constant combinator prototype or nil.


:: double
[R]

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


:: boolean
[R]

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


:: boolean
[R]

If this entity prototype could possibly ever be rotated.


:: float
[R]

The terrain friction modifier for this vehicle.


:: boolean
[R]

If this vehicle allows passengers.


:: uint
[R]

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


:: uint
[R]

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


[R]

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


[R]

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


[R]

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


[R]

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


[R]

The equipment grid prototype for this entity or nil.




:: double
[R]

Gets the built-in stack size bonus of this inserter prototype.


:: double
[R]

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
















:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaEquipment

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this equipment.


:: string
[R]

Type of this equipment.


[R]

Position of this equipment in the equipment grid.


:: table
[R]

Shape of this equipment.


:: double
[RW]

Current shield value of the equipment.


:: double
[R]

Maximum shield value.


:: double
[R]

Maximum solar power generated.


:: double
[R]

Movement speed bonus.


:: double
[R]

Energy generated per tick.


:: double
[RW]

Current available energy.


:: double
[R]

Maximum amount of energy that can be stored in this equipment.



[R]

The burner energy source for this equipment or nil if there isn't one.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Order string of this prototype.




:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

take{position, equipment, by_player}

Remove an equipment from the grid.


take_all(by_player)
→ dictionary[stringuint]

Remove all equipment from the grid.


clear(by_player)

Clear all equipment from the grid, removing it without actually returning it.


put{name, position, by_player}

Insert an equipment into the grid.


can_move{equipment, position}
boolean

Check whether moving an equipment would succeed.


move{equipment, position}
boolean

Move an equipment within this grid.


get(position)

Find equipment in the Equipment Grid based off a position.


→ dictionary[stringuint]

Get counts of all equipment in this grid.


help()
string

All methods and properties that this object supports.



:: uint
[R]

Width of the equipment grid.


:: uint
[R]

Height of the equipment grid.


:: array[LuaEquipment]
[R]

All the equipment in this grid.


:: double
[R]

Total energy per tick generated by the equipment inside this grid.


:: double
[R]

Maximum energy per tick that can be created by any solar panels in the equipment grid.


:: double
[R]

The total energy stored in all batteries in the equipment grid.


:: double
[R]

Total energy storage capacity of all batteries in the equipment grid.


:: float
[R]

The amount of shields this equipment grid has.


:: float
[R]

The maximum amount of shields this equipment grid has.


:: boolean
[RW]

True if this movement bonus equipment is turned off, otherwise false.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Order string of this prototype.




:: array[string]
[R]

Equipment category names for the categories that may be inserted into this equipment grid.


:: uint
[R]

:: uint
[R]

:: boolean
[R]

If the player can move equipment into or out of this grid.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Type of this equipment prototype.


:: string
[R]

Order string of this prototype.




:: table
[R]

Shape of this equipment prototype.


[R]

The result item when taking this equipment out of an equipment grid.


:: double
[R]

The max power generated by this equipment.


:: float
[R]

The shield value of this equipment.


:: double
[R]

The energy per shield point restored.


:: table
[R]

The logistic parameters for this roboport equipment.




[R]

The energy source prototype for the equipment.


:: array[string]
[R]

Category names for this equipment.


[R]

The burner energy source prototype this equipment uses or nil.


[R]

The electric energy source prototype this equipment uses or nil.


:: Color
[R]

The background color of this equipment prototype.


[R]

The equipment attack parameters or nil.


:: boolean
[R]

Is this active defense equipment automatic.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

uint64 or double

Gets the total input count for a given prototype.


set_input_count(name, count)

Sets the total input count for a given prototype.


uint64 or double

Gets the total output count for a given prototype.


set_output_count(name, count)

Sets the total output count for a given prototype.


get_flow_count{name, input, precision_index, count}
double

Gets the flow count value for the given time frame.


on_flow(name, count)

Adds a value to this flow statistics.


clear()

Reset all the statistics data to 0.


help()
string

All methods and properties that this object supports.


:: dictionary[stringuint64 or double]
[R]

List of input counts indexed by prototype name.


:: dictionary[stringuint64 or double]
[R]

List of output counts indexed by prototype name.


[R]

The force these statistics belong to or nil for pollution statistics.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaFluidBox

:: uint
[R]

Number of fluid boxes.


:: Fluid
[R]

Access, set or clear a fluid box.


get_prototype(index)

The prototype of this fluidbox index.


get_capacity(index)
double

The capacity of the given fluidbox index.


→ array[LuaFluidBox]

The fluidbox connections for the given fluidbox index.


get_filter(index)

Get a fluid box filter


set_filter(index, filter)
boolean

Set a fluid box filter.


get_flow(index)
double

Flow through the fluidbox in the last tick.


string

Returns the fluid the fluidbox is locked onto Returns 'nil' for no lock


flush(index, fluid)
→ dictionary[stringfloat]

Flushes all fluid from this fluidbox and its fluid system.


help()
string

All methods and properties that this object supports.


[R]

The entity that owns this fluidbox.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


[R]

The entity that this belongs to.


:: uint
[R]

The index of this fluidbox prototype in the owning entity.


:: array[FluidBoxConnection]
[R]

The pipe connection points.


:: string
[R]

The production type.


:: double
[R]


:: double
[R]

:: double
[R]

[R]

The filter or nil if no filter is set.


:: double
[R]

The minimum temperature or nil if none is set.


:: double
[R]

The maximum temperature or nil if none is set.


:: array[int]
[R]

The secondary draw orders for the 4 possible connection directions.


:: string
[R]

The render layer.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: double
[R]








:: array[SmokeSource]
[R]

The smoke sources for this prototype if any.



[R]

The fluid box for this energy source.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.




:: double
[R]

Default temperature of this fluid.


:: double
[R]

Maximum temperature this fluid can reach.


:: double
[R]

The amount of energy in Joules required to heat one unit of this fluid by 1°C.


:: string
[R]

Order string for this prototype.


[R]

Group of this prototype.


[R]

Subgroup of this prototype.


:: Color
[R]

:: Color
[R]

:: double
[R]

The temperature above which this fluid will be shown as gaseous inside tanks and pipes.


:: double
[R]

A multiplier on the amount of emissions produced when this fluid is burnt in a generator.


:: double
[R]

The amount of energy in Joules one unit of this fluid will produce when burnt in a generator.


:: boolean
[R]

Whether this fluid is hidden from the fluid and signal selectors.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

:: int
[R]

:: float
[R]

:: boolean
[R]

:: boolean
[R]

:: Color
[R]

The border color or nil if not set.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaForce

uint

Count entities of given type.


Disable research for this force.


Enable research for this force.


Disable all recipes and technologies.


Enables all recipes and technologies.


Load the original version of all recipes from the prototypes.


Unlock all recipes.


Unlock all technologies.


research_all_technologies(include_disabled_prototypes)

Research all technologies.


Load the original versions of technologies from prototypes.


reset()

Reset everything.


Reapplies all possible research effects, including unlocked recipes.


chart(surface, area)

Chart a portion of the map.


clear_chart(surface)

Erases chart data for this force.


Force a rechart of the whole chart.


chart_all(surface)

Chart all generated chunks.


is_chunk_charted(surface, position)
boolean

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.


cancel_charting(surface)

Cancels pending chart requests for the given surface or all surfaces.



set_ammo_damage_modifier(ammo, modifier)


set_gun_speed_modifier(ammo, modifier)


set_turret_attack_modifier(turret, modifier)

set_cease_fire(other, cease_fire)

Add other force to this force's cease fire list.


boolean

Is other force in this force's cease fire list?


set_friend(other, friend)

Add other force to this force's friends list.


get_friend(other)
boolean

Is other force in this force's friends list.


boolean

Is pathfinder busy?


Kill all units and flush the pathfinder.



set_spawn_position(position, surface)


unchart_chunk(position, surface)

uint

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.


print(message, color)

Print text to the chat console of all players on this force.


get_trains(surface)
→ array[LuaTrain]

add_chart_tag(surface, 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.


double

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.


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.


get_train_stops{name, surface}
→ array[LuaEntity]

Gets train stops matching the given filters.


boolean

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.


add_research(technology)
boolean

Add this technology to the back of the research queue if the queue is enabled.


Stop the research currently in progress.


get_linked_inventory(prototype, link_id)

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_enemy(other)
boolean

Is this force an enemy?


help()
string

All methods and properties that this object supports.


:: string
[R]

Name of the force.


[R]

Technologies owned by this force, indexed by name.


[R]

Recipes available to this force, indexed by name.


:: double
[RW]

Multiplier of the manual mining speed.


:: double
[RW]

Multiplier of the manual crafting speed.







[R]

The current technology in research, or nil if no research is currently ongoing.


:: double
[RW]

Progress of current research, as a number in range [0, 1].


[RW]

The previous research if any.


:: double
[RW]

The inserter stack size bonus for non stack inserters


:: uint
[RW]

Number of items that can be transferred by stack inserters.


:: double
[RW]

Number of character trash slots.


:: uint
[RW]

Maximum number of follower robots.


:: double
[RW]

Additional lifetime for following robots.


:: uint
[RW]

The time, in ticks, before a placed ghost disappears.


:: array[LuaPlayer]
[R]

Players belonging to this force.


:: boolean
[RW]

Enables some higher-level AI behaviour for this force.


:: dictionary[string → array[LuaLogisticNetwork]]
[R]

List of logistic networks, grouped by surface.


[R]

The item production statistics for this force.


[R]

The fluid production statistics for this force.


[R]

The kill counter statistics for this force.


[R]

The entity build statistics for this force (built and mined)


:: double
[RW]

Modifies the running speed of all characters in this force by the given value as a percentage.









:: uint
[RW]

the number of additional inventory slots the character main inventory has.


:: uint
[RW]

The time, in ticks, before a deconstruction order is removed.





:: boolean
[RW]

Ability to use zoom-to-world on map.


:: boolean
[RW]

Ability to build ghosts through blueprint or direct ghost placement, or "mine" ghosts when using zoom-to-world.


:: boolean
[RW]

Ability to create new blueprints using empty blueprint item when using zoom-to-world.


:: boolean
[RW]

Ability to use deconstruction planner when using zoom-to-world.


:: boolean
[RW]

Ability to use custom selection tools when using zoom-to-world.


:: boolean
[RW]

true if character requester logistics is enabled.


:: uint
[RW]

The number of rockets launched.


:: dictionary[stringuint]
[R]

All of the items that have been launched in rockets.


:: array[LuaPlayer]
[R]

The connected players belonging to this force.




:: double
[RW]

Evolution factor of this force.





:: boolean
[RW]

If friendly fire is enabled for this force.


:: boolean
[RW]

If sharing chart data is enabled for this force.


:: boolean
[RW]

Whether the research queue is available for this force.


:: uint
[R]

Unique ID associated with this force.


[RW]

The research queue of this force.


:: boolean
[R]

Whether research is enabled for this force, see LuaForce::enable_research and LuaForce::disable_research


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

Order string of this prototype.




:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

set_game_state{game_finished, player_won, next_level, can_continue, victorious_force}

Set scenario state.


Reset scenario state (game_finished, player_won, etc.).



show_message_dialog{text, image, point_to, style, wrapper_frame_style}

Show an in-game message dialog.


boolean

Is this the demo version of Factorio?


Forces a reload of the scenario script from the original scenario location.


Forces a reload of all mods.


Saves the current configuration of Atlas to a file.


Run internal consistency checks.


regenerate_entity(entities)

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 and save it to a file.


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 a file.


string

Convert a table to a JSON string


AnyBasic

Convert a JSON string to a table.


write_file(filename, data, append, for_player)

Write a string to a file.


remove_path(path)

Remove file or directory.


Remove players who are currently not connected from the map.


Force a CRC check.


create_force(force)
LuaForce

Create a new force.


merge_forces(source, destination)

Marks two forces to be merge together.


create_surface(name, settings)

Create a new surface


server_save(name)

Instruct the server to save the map.


auto_save(name)

Instruct the game to perform an auto-save.


delete_surface(surface)

Deletes the given surface and all entities on it.


Disables replay saving for the current save file.


Disables tutorial triggers, that unlock new tutorials and show notices about unlocked tutorials.


direction_to_string(direction)

Converts the given direction into the string version of the direction.


print(message, color)

Print text to the chat console all players.


Creates a deterministic standalone random generator with the given seed or if a seed is not provided the initial map seed is used.


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.


is_valid_sound_path(sound_path)
boolean

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.


kick_player(player, reason)

Kicks the given player from this multiplayer game.


ban_player(player, reason)

Bans the given player from this multiplayer game.


unban_player(player)

Unbans the given player from this multiplayer game.


purge_player(player)

Purges the given players messages from the game.


mute_player(player)

Mutes the given player.


unmute_player(player)

Unmutes the given player.


Counts how many distinct groups of pipes exist in the world.


boolean

Is the map loaded is multiplayer?


uint

Gets the number of entities that are active (updated each tick).


string

Gets the map exchange string for the map generation settings that were used to create this map.


parse_map_exchange_string(map_exchange_string)

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.


get_player(player)
LuaPlayer

Gets the given player or returns nil if no player is found.


get_surface(surface)

Gets the given surface or returns nil if no surface is found.


create_profiler(stopped)

Creates a LuaProfiler, which is used for measuring script performance.


evaluate_expression(expression, variables)
double

Evaluate an expression, substituting variables as provided.


Returns a dictionary of all LuaEntityPrototypes that fit the given filters.


Returns a dictionary of all LuaItemPrototypes that fit the given filters.


Returns a dictionary of all LuaEquipmentPrototypes that fit the given filters.


Returns a dictionary of all LuaModSettingPrototypes that fit the given filters.


Returns a dictionary of all LuaAchievementPrototypes that fit the given filters.


Returns a dictionary of all LuaTilePrototypes that fit the given filters.


Returns a dictionary of all LuaDecorativePrototypes that fit the given filters.


Returns a dictionary of all LuaFluidPrototypes that fit the given filters.


Returns a dictionary of all LuaRecipePrototypes that fit the given filters.


Returns a dictionary of all LuaTechnologyPrototypes that fit the given filters.


Creates an inventory that is not owned by any game object.


→ dictionary[string → array[LuaInventory]]

Gets the inventories created through LuaGameScript::create_inventory


Resets the amount of time played for this map.


encode_string(string)
string

Deflates and base64 encodes the given string.


decode_string(string)
string

Base64 decodes and inflates the given string.


:: string
[R]

This object's name.


[R]

The player typing at the console - nil in all other instances.


[R]

Get a table of all the players that currently exist.


[R]

The currently active set of map settings.


[R]

The currently active set of difficulty settings.


[R]

Current scenario difficulty.


[R]

Get a table of all the forces that currently exist.


[R]

A dictionary containing every LuaEntityPrototype indexed by name.


[R]

A dictionary containing every LuaItemPrototype indexed by name.


[R]

A dictionary containing every LuaFluidPrototype indexed by name.


[R]

A dictionary containing every LuaTilePrototype indexed by name.


[R]

A dictionary containing every LuaEquipmentPrototype indexed by name.


[R]

A dictionary containing every LuaDamagePrototype indexed by name.