Factorio API Docs

1.1.66 <>

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.



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


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]

The string used to alphabetically sort these prototypes.





:: 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]

The string used to alphabetically sort these prototypes.





:: 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]

This arithmetic combinator's 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]

The string used to alphabetically sort these prototypes.




:: 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 function to be run on mod initialization.


on_load(f)

Register a function to be run on save load.


register_metatable(name, metatable)

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


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.


Gets the filters for the given event.


raise_event(event, data)

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=…}


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_set_tiles{surface_index=…, tiles=…}

:: 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]

The current heat (energy) stored in this burner.


:: double
[R]

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


:: double
[RW]

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


[RW]

The currently burning item.


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


:: table?
[R]

The light flicker definition for this burner prototype.


:: dictionary[stringboolean]
[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.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


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

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]

This constant combinator's 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 - abstract

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.


set_gui_arrow{type=…}

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.


boolean

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]

The current position of the entity.


:: LuaEntity?
[R]

The vehicle the player is currently sitting in.


[RW]

The force of this entity.


:: LuaEntity?
[RW]

The currently selected entity.


[RW]

The GUI the player currently has open.


:: uint
[R]

Size of the crafting queue.


:: double
[RW]

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


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


[RW]

The ghost prototype in the player's cursor.


:: boolean
[RW]

true if the player is in a vehicle.


:: array[CraftingQueueItem]
[R]

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]

Whether this character entity is in combat.


:: double
[R]

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


:: double
[R]

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

Class LuaControlBehavior - abstract

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.


:: LuaPlayer?
[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]

The string used to alphabetically sort these prototypes.




:: string
[R]

The default key sequence for this custom input.


:: string?
[R]

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


:: string?
[R]

The linked game control name, if any.


:: string
[R]

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


:: string
[R]

The action that happens when this custom input is triggered.


:: boolean
[R]

Whether this custom input is enabled.


:: boolean
[R]

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


:: boolean
[R]

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


:: boolean
[R]

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


[R]

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


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


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


:: string
[R]

Name of this prototype.


:: string
[R]

The string used to alphabetically sort these prototypes.




:: 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]

This decider combinator's 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]

The string used to alphabetically sort these prototypes.




[R]

The bounding box used for collision checking.


[R]

The collision masks this decorative uses



[R]

Autoplace specification for this decorative prototype, if any.


:: 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 entity's output inventory if it has one.


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


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.


boolean

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]?, LuaEntity?, LuaEntity?

Revive a ghost.


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

Revives a ghost silently.


get_connected_rail{rail_direction=…, rail_connection_direction=…}

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


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


→ array[LuaEntity]

Get all rails of a 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.


boolean

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


boolean

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


→ array[LuaEntity]

Returns all parent signals.


→ array[LuaEntity]

Returns all child signals.


→ array[LuaEntity]

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


→ array[LuaEntity]

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.


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, dictionary[stringuint]?

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 produces or consumes electricity and is connected to an electric network that has at least one entity that can produce power.


→ array[LuaTrain]

The trains scheduled to stop at this train stop.


LuaTrain?

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


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

Clones this entity.


get_fluid_count(fluid?)
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.


BeamTarget?

Get the source of this beam.


set_beam_source(source)

Set the source of this beam.


BeamTarget?

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

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


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.


→ array[LuaEntity]

Gets legs of given SpiderVehicle.


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]

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


:: 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, if any.


[RW]

The current direction this entity is facing.


:: boolean
[R]

Whether the entity has direction.


[RW]

The smooth orientation of this entity.


[R]

The orientation of this cliff.


[RW]

The relative orientation of the vehicle turret, artillery turret, artillery 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.


[RW]

Read when this spidertron auto-targets enemies


:: float?
[RW]

The current speed if this is a car, rolling stock, projectile or spidertron, or the maximum speed if this is a 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.


:: LuaEntity?
[RW]

The entity this entity is putting its items to.


:: LuaEntity?
[RW]

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


:: uint?
[RW]

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


:: double
[RW]

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


:: double?
[RW]

The temperature of this entity's heat energy source.


:: LuaRecipe?
[R]

The previous recipe this furnace was using, if any.


[R]

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


[R]

Current position of the inserter's "hand".


:: LuaTrain?
[R]

The train this rolling stock belongs to, if any.


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

A list of neighbours for certain types of entities.


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


:: string?
[RW]

The label on this entity, if any.


:: uint
[RW]

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


:: Color?
[RW]

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


[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, or nil if this entity is not a part of any logistic network.


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


:: LuaPlayer?
[R]

The player connected to this character, if any.


[R]

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


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


:: double?
[R]

The input flow limit for the electric energy source.


:: double?
[R]

The output flow limit for the electric energy source.


:: double?
[R]

The electric drain for the electric energy source.


:: double?
[R]

The emissions for the electric energy source.


:: uint?
[R]

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


:: uint?
[R]

The unit_number of the entity contained in this ghost.


:: double?
[RW]

The mining progress for this mining drill.


:: double?
[RW]

The bonus mining progress for this 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.


:: LuaEntity?
[R]

The mining target, if any.


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


:: LuaEntity?
[R]

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


[R]

This entity's equipment grid, if any.


:: uint8?
[RW]

The graphics variation for this entity.


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


:: LuaBurner?
[R]

The burner energy source for this entity, if any.


:: LuaEntity?
[RW]

The shooting target for this turret, if any.


:: LuaEntity?
[R]

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


:: array[LuaEntity]?
[R]

The sticker entities attached to this entity, if any.


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


:: LuaEntity?
[R]

The spawner associated with this unit entity, if any.


:: 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, if any.


[RW]

The filters for this infinity container.


:: boolean
[RW]

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


[RW]

The player this character is associated with, if any.


:: 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, if any is set.


:: string?
[RW]

The filter mode for this filter inserter.


:: string
[RW]

The input priority for this splitter.


:: string
[RW]

The output priority for this splitter.


:: boolean
[R]

Whether this land mine is armed.


:: boolean
[RW]

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


:: LuaEntity?
[R]

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


[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, if any.


:: boolean
[RW]

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


:: array[ForceIdentification]?
[RW]

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


:: LuaEntity?
[R]

The rail target of this pump, if any.


:: boolean
[R]

Returns true if this unit is moving.


:: uint?
[R]

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


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


:: Command?
[R]

The command given to this unit, if any.


:: Command?
[R]

The distraction command given to this unit, if any.


:: uint
[RW]

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


[RW]

Destination of this spidertron's autopilot, if any.


:: 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]

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


:: boolean
[RW]

Whether this entity is a MilitaryTarget.


:: boolean
[R]

If this entity is EntityWithOwner


:: boolean
[R]

If this entity is EntityWithHealth


:: LuaEntity?
[RW]

The owner of this combat robot, if any.


:: uint
[RW]

The link ID this linked container is using.


:: LuaEntity?
[RW]

The follow target of this spidertron, if any.


:: Vector?
[RW]

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


:: string
[RW]

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


:: LuaEntity?
[R]

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


:: float
[R]

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


[R]

The status of this rocket silo entity.


:: uint
[R]

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


:: uint
[R]

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


:: 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]

Whether this resource is 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.


:: 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, if any.


[R]

The bounding box used for collision checking.


[R]

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


[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]

The string used to alphabetically sort these prototypes.


[R]

Group of this entity.


[R]

Subgroup of this entity.


:: float?
[R]

Amount this entity can heal per tick, if any.


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


:: dictionary[stringResistance]?
[R]

List of resistances towards each damage type.


:: string?
[R]

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


[R]

The next upgrade for this entity, if any.


:: array[Loot]?
[R]

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


:: uint?
[R]

Repair-speed modifier for this entity, if any.


:: uint?
[R]

The range of this turret.


[R]

Autoplace specification for this entity prototype, if any.


:: double?
[R]

The speed of this transport belt.


:: array[UnitSpawnDefinition]?
[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 any.


:: array[TriggerItem]?
[R]

The final attack result for this projectile.


[R]

The attack parameters for this entity, if any.


:: table?
[R]

The spawning cooldown for this enemy spawner prototype.


:: double?
[R]

The mining radius of this mining drill prototype.


:: double?
[R]

The mining speed of this mining drill/character prototype.


:: string?
[R]

The logistic mode of this logistic container.


:: uint8?
[R]

The max underground distance for underground belts and underground pipes.


[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, if any.


:: array[TriggerItem]?
[R]

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


:: Color?
[R]

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


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


:: uint?
[R]

The maximum polyphony for this programmable speaker.


:: uint?
[R]

The module inventory size.


:: uint?
[R]

The max number of ingredients this crafting machine prototype supports.


:: double?
[R]

The crafting speed..


:: dictionary[stringboolean]?
[R]

The crafting categories this entity prototype supports.


:: dictionary[stringboolean]?
[R]

The resource categories this character or mining drill supports.


:: double?
[R]

The supply area of this electric pole or beacon prototype.


:: 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, if any.


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


:: double?
[R]

The energy consumption of this car prototype.


:: double?
[R]

The friction of this vehicle prototype.


:: double?
[R]

The braking force of this vehicle prototype.


:: double?
[R]

The air resistance of this rolling stock prototype.


:: boolean?
[R]

If this car prototype uses tank controls to drive.


:: double?
[R]

The rotation speed of this car prototype.


:: double?
[R]

The turret rotation speed of this car prototype.


:: dictionary[stringLuaItemPrototype]?
[R]

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


:: array[LuaItemPrototype]?
[R]

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


:: double?
[R]

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


:: float?
[R]

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


:: uint?
[R]

The max payload size of this logistics or construction robot.


:: boolean?
[R]

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


:: double?
[R]

The energy consumed per tile moved for this flying robot.


:: double?
[R]

The energy consumed per tick for this flying robot.


:: double?
[R]

The max energy for this flying robot.


:: float?
[R]

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


:: float?
[R]

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


[R]

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


[R]

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


[R]

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


[R]

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


[R]

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


[R]

The heat buffer prototype this entity uses, if any.


:: uint
[R]

The log2 of grid size of the building


:: double?
[R]

The fluid usage of this generator prototype.


:: double?
[R]

The maximum fluid temperature of this generator prototype.


:: boolean?
[R]

Whether this generator prototype burns fluid.


:: boolean?
[R]

Whether this generator prototype scales fluid usage.


:: boolean?
[R]

Whether this generator prototype destroys non-fuel fluids.


:: double?
[R]

The default maximum power output of this generator prototype.


:: double?
[R]

The target temperature of this boiler prototype.


[R]

The fluid this offshore pump produces.


:: 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 or normal pump.


:: boolean?
[R]

Whether this inserter is a stack-type.


:: boolean?
[R]

Whether this inserter allows custom pickup and drop vectors.


:: boolean?
[R]

Whether this inserter allows burner leeching.


:: double?
[R]

The extension speed of this inserter.


:: double?
[R]

The rotation speed of this inserter.


:: Vector?
[R]

The pickup position for this inserter.


:: Vector?
[R]

The drop position for this inserter.


:: boolean?
[R]

True if this inserter chases items on belts for pickup.


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


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


:: double?
[R]

Whether this explosion has a beam.


:: double?
[R]

Whether this explosion rotates.


:: uint8?
[R]

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


:: boolean?
[R]

Whether this entity raises an alert when damaged.


:: boolean?
[R]

Whether this turret raises an alert when attacking


:: Color?
[R]

The color of the prototype, if any.


:: 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, if any.


:: uint?
[R]

The rocket parts required for this rocket silo prototype.


:: uint8?
[R]

The rocket rising delay for this rocket silo prototype.


:: uint8?
[R]

The rocket launch delay for this rocket silo prototype.


:: double?
[R]

The light blinking speed for this rocket silo prototype.


:: double?
[R]

The door opening speed for this rocket silo prototype.


:: double?
[R]

The rising speed for this rocket silo rocket prototype.


:: double?
[R]

The engine starting speed for this rocket silo rocket prototype.


:: double?
[R]

The flying speed for this rocket silo rocket prototype.


:: double?
[R]

The flying acceleration for this rocket silo rocket prototype.


:: string?
[R]

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


:: double?
[R]

The construction radius for this roboport prototype.


:: double?
[R]

The logistic radius for this roboport prototype.


:: double?
[R]

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


:: 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 collision mask entities must collide with to make this landmine blow up.


[R]

The fluidbox prototypes for this entity.







:: uint?
[R]

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


:: double?
[R]

The max speed of this projectile or flying robot prototype.


:: float?
[R]

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


:: float?
[R]

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


:: boolean?
[R]

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


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


[R]

The rocket entity prototype associated with this rocket silo prototype.


:: boolean?
[R]

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


:: double?
[R]

The vision distance of this unit prototype.


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


:: double?
[R]

The maximum pursue distance of this unit prototype.


:: uint?
[R]

The radar range of this unit prototype.


:: boolean?
[R]

Whether this unit prototype can move while shooting.


:: boolean?
[R]

Whether this unit prototype can open gates.


:: boolean?
[R]

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


:: uint?
[R]

The distraction cooldown of this unit prototype.


:: double?
[R]

The spawning time modifier of this unit prototype.


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


:: double?
[R]

The base researching speed of this lab prototype.


:: uint?
[R]

The item slot count of this constant combinator prototype.


:: double?
[R]

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


:: boolean?
[R]

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


:: boolean
[R]

Whether this entity prototype could possibly ever be rotated.


:: float?
[R]

The terrain friction modifier for this vehicle.


:: boolean?
[R]

Whether 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, if any.




:: double?
[R]

The built-in stack size bonus of this inserter prototype.


:: boolean
[R]

True if this entity prototype should be included during tile collision checks with LuaTilePrototype::check_collision_with_entities enabled.


:: boolean
[R]

True if this is entity-with-owner


:: boolean?
[R]

True if this entity-with-owner is military target


:: boolean?
[R]

True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)


:: table?
[R]

The logistic parameters for this roboport.


:: double?
[R]

The height of this spider vehicle prototype.


:: double?
[R]

The torso rotation speed of this spider vehicle prototype.


:: boolean?
[R]

Whether this spider vehicle prototoype automatically cycles weapons.


:: double?
[R]

The chain shooting cooldown modifier of this spider vehicle prototype.


:: double?
[R]

The chunk exploration radius of this spider vehicle prototype.


:: double?
[R]

The animation speed coefficient of this belt connectable prototype.


:: double?
[R]

The manual range modifier for this artillery turret or wagon prototype.


:: float?
[R]

The dying time of this corpse prototype.


:: double?
[R]

The active energy usage of this rocket silo or combinator prototype.


:: double?
[R]

The idle energy usage of this rocket silo prototype.


:: double?
[R]

The lamp energy usage of this rocket silo prototype.


:: boolean?
[R]

Whether this logistic container prototype uses exact mode


:: uint
[R]

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)


:: uint
[R]

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)


:: double?
[R]

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













:: uint?
[R]



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



:: LuaBurner?
[R]

The burner energy source for this equipment, if any.


:: 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]

The string used to alphabetically sort these prototypes.




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


find(equipment)

Find equipment by name.


count(equipment?)
uint

Get the number of all or some 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.


:: uint
[R]

Unique identifier of this equipment 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]

The string used to alphabetically sort these prototypes.




:: 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]

The string used to alphabetically sort these prototypes.




:: table
[R]

Shape of this equipment prototype.


[R]

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


:: 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, if any.


[R]

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


:: Color
[R]

The background color of this equipment prototype.


[R]

The equipment attack parameters.


:: boolean
[R]

Whether this active defense equipment is 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=…, sample_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.


:: LuaForce?
[R]

The force these statistics belong to.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaFluidBox

get_prototype(index)

The prototype of this fluidbox index.


get_capacity(index)
double

The capacity of the given fluidbox index.


→ array[LuaFluidBox]

The fluidboxes to which the fluidbox at the given index is connected.


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


uint

Gets unique fluid system identifier of selected fluid box.


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.


:: uint
[R]

Number of fluid boxes.


:: Fluid?
[R]

Access, set or clear a fluid box.

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, if any is set.


:: double?
[R]

The minimum temperature, if any is set.


:: double?
[R]

The maximum temperature, if any 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]

The string used to alphabetically sort these prototypes.


[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, if any.


:: 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 currently ongoing technology research, if any.


:: 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


:: Color?
[RW]

Custom color for this force.


:: Color
[R]

Effective color of this force.


:: 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]

The string used to alphabetically sort these prototypes.




:: 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 of the game and save it to the script-output folder, located in the game's user data directory.


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.


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 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 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 merged 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)
LuaSurface?

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.


:: LuaPlayer?
[R]

This property is only populated inside custom command handlers and when writing Lua console commands.


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


[R]

A dictionary containing every LuaVirtualSignalPrototype indexed by name.


[R]

A dictionary containing every LuaEquipmentGridPrototype indexed by name.


[R]

A dictionary containing every LuaRecipePrototype indexed by name.


[R]

A dictionary containing every LuaTechnologyPrototype indexed by name.


[R]

A dictionary containing every LuaDecorativePrototype indexed by name.


[R]

A dictionary containing every LuaParticlePrototype indexed by name.


[R]

A dictionary containing every LuaAutoplaceControlPrototype indexed by name.


[R]

A dictionary containing every LuaNoiseLayerPrototype indexed by name.


[R]

A dictionary containing every LuaModSettingPrototype indexed by name.


[R]

A dictionary containing every LuaCustomInputPrototype indexed by name.


[R]

A dictionary containing every LuaAmmoCategoryPrototype indexed by name.


[R]

A dictionary containing every LuaNamedNoiseExpression indexed by name.


[R]

A dictionary containing every ItemSubgroup indexed by name.


[R]

A dictionary containing every ItemGroup indexed by name.


[R]

A dictionary containing every LuaFuelCategoryPrototype indexed by name.


[R]

A dictionary containing every LuaResourceCategoryPrototype indexed by name.


[R]

A dictionary containing every LuaAchievementPrototype indexed by name.


[R]

A dictionary containing every LuaModuleCategoryPrototype indexed by name.


[R]

A dictionary containing every LuaEquipmentCategoryPrototype indexed by name.


[R]

A dictionary containing every LuaTrivialSmokePrototype indexed by name.


[R]

A dictionary containing every LuaShortcutPrototype indexed by name.


[R]

A dictionary containing every LuaRecipeCategoryPrototype indexed by name.


[R]

A dictionary containing every LuaFontPrototype indexed by name.


[R]

A dictionary containing every MapGenPreset indexed by name.


[R]

The styles that LuaGuiElement can use, indexed by name.


:: uint
[R]

Current map tick.


:: uint
[R]

The number of ticks since this game was 'created'.


:: boolean
[RW]

If the tick has been paused.


:: uint
[RW]

The number of ticks to be run while the tick is paused.


:: boolean
[R]

True while the victory screen is shown.


:: boolean
[R]

True after players finished the game and clicked "continue".


:: float
[RW]

Speed to update the map at.


[R]

Get a table of all the surfaces that currently exist.


:: dictionary[stringstring]
[R]

The active mods versions.


:: array[LuaPlayer]
[R]

The players that are currently online.



[R]

Array of the names of all the backers that supported the game development early on.


[R]

The default map gen settings for this save.


:: boolean
[RW]

Determines if enemy land mines are completely invisible or not.


:: boolean
[RW]

True by default.


:: boolean
[RW]

True by default.


[R]

The pollution statistics for this map.










help()
string

All methods and properties that this object supports.


:: boolean
[R]

If the entity is currently disabled because of the control behavior.


[RW]

The circuit condition.


[RW]

The logistic condition.


:: boolean
[RW]

true if this should connect to the logistic network.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


Class LuaGroup

help()
string

All methods and properties that this object supports.


:: string?
[R]

[R]

Localised name of the group.


:: string?
[R]

:: LuaGroup?
[R]

The parent group, if any.


:: array[LuaGroup]
[R]

Subgroups of this group.


:: string
[R]

The additional order value used in recipe ordering.


:: string
[R]

The string used to alphabetically sort these prototypes.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaGui

is_valid_sprite_path(sprite_path)
boolean

Returns true if sprite_path is valid and contains loaded sprite, otherwise false.


help()
string

All methods and properties that this object supports.


[R]

The player who owns this gui.


:: dictionary[stringLuaGuiElement]
[R]

The children GUI elements mapped by name <> element.


top
[R]

The top part of the GUI.


[R]

The left part of the GUI.


[R]

The center part of the GUI.


[R]

The flow used in the objectives window.


[R]

For showing a GUI somewhere on the entire screen.


[R]

For showing a GUI somewhere relative to one of the game GUIs.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

add{type=…, name?=…, caption?=…, tooltip?=…, enabled?=…, visible?=…, ignored_by_interaction?=…, style?=…, tags?=…, index?=…, anchor?=…}

Add a new child element to this GuiElement.


clear()

Remove children of this element.


Remove this element, along with its children.


string?

The mod that owns this Gui element or nil if it's owned by the scenario script.


uint

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.


Removes the items in this dropdown or listbox.


get_item(index)

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.


add_item(string, index?)

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.


double

Gets this sliders minimum value.


double

Gets this sliders maximum value.


set_slider_minimum_maximum(minimum, maximum)

Sets this sliders minimum and maximum values.


double

Gets the minimum distance this slider can move.


boolean

Returns whether this slider only allows being moved to discrete positions.


boolean

Returns whether this slider only allows discrete values.


Sets the minimum distance this slider can move.


Sets whether this slider only allows being moved to discrete positions.


Sets whether this slider only allows discrete values.


focus()

Focuses this GUI element if possible.


Scrolls this scroll bar to the top.


Scrolls this scroll bar to the bottom.


Scrolls this scroll bar to the left.


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.


Selects all the text in this textbox.


select(start, end)

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.


remove_tab(tab)

Removes the given tab and its associated content from this tabbed pane.


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.


Moves this GUI element to the "front" so it will draw over other elements.


help()
string

All methods and properties that this object supports.


:: uint
[R]

The index of this GUI element (unique amongst the GUI elements of a LuaPlayer).


gui
:: LuaGui
[R]

The GUI this element is a child of.


[R]

The direct parent of this element.


:: string
[RW]

The name of this element.


[RW]

The text displayed on this element.


:: double
[RW]

How much this progress bar is filled.


:: string
[R]

Direction of this element's layout.


[RW]

The style of this element.


:: boolean
[RW]

Sets whether this GUI element is visible or completely hidden, taking no space in the layout.


:: string
[RW]

The text contained in this textfield or text-box.


:: array[string]
[R]

Names of all the children of this element.


:: boolean
[RW]

Is this checkbox or radiobutton checked?


:: uint
[R]

Index into LuaGameScript::players specifying the player who owns this element.


[RW]

The image to display on this sprite-button or sprite in the default state.


:: boolean
[RW]

Whether the image widget should resize according to the sprite in it.


[RW]

The image to display on this sprite-button when it is hovered.


[RW]

The image to display on this sprite-button when it is clicked.



:: string
[RW]

Policy of the horizontal scroll bar.


:: string
[RW]

Policy of the vertical scroll bar.


:: string
[R]

The type of this GUI element.


:: array[LuaGuiElement]
[R]

The child-elements of this GUI element.


:: array[LocalisedString]
[RW]

The items in this dropdown or listbox.


:: uint
[RW]

The selected index for this dropdown or listbox.


:: double
[RW]

The number to be shown in the bottom right corner of this sprite-button.


:: boolean
[RW]

Related to the number to be shown in the bottom right corner of this sprite-button.


[RW]

The location of this widget when stored in LuaGui::screen.


:: boolean
[RW]

Whether this frame auto-centers on window resize when stored in LuaGui::screen.


[RW]

The text to display after the normal tab text (designed to work with numbers)


[RW]

The position this camera or minimap is focused on, if any.


:: uint
[RW]

The surface index this camera or minimap is using.


:: double
[RW]

The zoom this camera or minimap is using.


:: uint
[RW]

The player index this minimap is using.


:: string?
[RW]

The force this minimap is using, if any.


:: string
[R]

The elem type of this choose-elem-button.


:: string or SignalID?
[RW]

The elem value of this choose-elem-button, if any.


[RW]

The elem filters of this choose-elem-button, if any.


:: boolean
[RW]

Whether the contents of this text-box are selectable.


:: boolean
[RW]

Whether this text-box will word-wrap automatically.


:: boolean
[RW]

Whether this text-box is read-only.


:: boolean
[RW]

Whether this GUI element is enabled.


:: boolean
[RW]

Whether this GUI element is ignored by interaction.


:: boolean
[RW]

Whether this choose-elem-button can be changed by the player.


:: boolean
[RW]

Whether this table should draw vertical grid lines.


:: boolean
[RW]

Whether this table should draw horizontal grid lines.


:: boolean
[RW]

Whether this table should draw a horizontal grid line below the first table row.


:: uint
[R]

The number of columns in this table.


:: boolean
[RW]

Whether the content of this table should be vertically centered.


:: double
[RW]

The value of this slider element.


[RW]

The mouse button filters for this button or sprite-button.


:: boolean
[RW]

Whether this textfield is limited to only numberic characters.


:: boolean
[RW]

Whether this textfield (when in numeric mode) allows decimal numbers.


:: boolean
[RW]

Whether this textfield (when in numeric mode) allows negative numbers.


:: boolean
[RW]

Whether this textfield displays as a password field, which renders all characters as *.


:: boolean
[RW]

Whether this textfield loses focus after defines.events.on_gui_confirmed is fired.


:: boolean
[RW]

Makes it so right-clicking on this textfield clears and focuses it.


[RW]

The frame that is being moved when dragging this GUI element, if any.


:: uint?
[RW]

The selected tab index for this tabbed pane, if any.


:: array[TabAndContent]
[R]

The tabs and contents being shown in this tabbed-pane.


:: LuaEntity?
[RW]

The entity associated with this entity-preview, camera, minimap, if any.


:: GuiAnchor?
[RW]

The anchor for this relative widget, if any.


:: Tags
[RW]

The tags associated with this LuaGuiElement.


:: string
[RW]

The switch state (left, none, right) for this switch.


:: boolean
[RW]

Whether the "none" state is allowed for this switch.


[RW]

The text shown for the left switch label.


[RW]

The tooltip shown on the left switch label.


[RW]

The text shown for the right switch label.


[RW]

The tooltip shown on the right switch label.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


[R]

The indexing operator.

help()
string

All methods and properties that this object supports.









:: array[HeatConnection]
[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.


:: double
[R]










:: array[HeatConnection]
[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.


:: boolean
[RW]

true if the contents of the inserter hand should be sent to the circuit network


[RW]

The circuit mode of operations for the inserter.


[RW]

The hand read mode for the inserter.


:: boolean
[RW]

If the stack size of the inserter is set through the circuit network or not.


[RW]

The signal used to set the stack size of the inserter.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.



Class LuaInventory

clear()

Make this inventory empty.


can_insert(items)
boolean

Can at least some items be inserted?


insert(items)
uint

Insert items into this inventory.


remove(items)
uint

Remove items from this inventory.


uint

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


boolean

Does this inventory contain nothing?


→ dictionary[stringuint]

Get counts of all items in this inventory.


boolean

Does this inventory support a bar?


uint

Get the current bar.


set_bar(bar?)

Set the current bar.


boolean

If this inventory supports filters.


boolean

If this inventory supports filters and has at least 1 filter set.


can_set_filter(index, filter)
boolean

If the given inventory slot filter can be set to the given filter.


get_filter(index)
string?

Gets the filter for the given item stack index.


set_filter(index, filter)
boolean

Sets the filter for the given item stack index.


Finds the first LuaItemStack in the inventory that matches the given item name.


Finds the first empty stack.


count_empty_stacks(include_filtered?)
uint

Counts the number of empty stacks.


Gets the number of the given item that can be inserted into this inventory.


Sorts and merges the items in this inventory.


resize(size)

Resizes the inventory.


Destroys this inventory.


help()
string

All methods and properties that this object supports.


[R]

The inventory index this inventory uses, if any.


:: LuaEntity?
[R]

The entity that owns this inventory, if any.


:: LuaPlayer?
[R]

The player that owns this inventory, if any.


[R]

The equipment that owns this inventory, if any.


:: string?
[R]

The mod that owns this inventory, if any.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


:: uint
[R]

Get the number of slots in this inventory.


[R]

The indexing operator.

has_flag(flag)
boolean

Does this prototype have a flag enabled?


get_ammo_type(ammo_source_type?)
AmmoType?

The type of this ammo prototype.


help()
string

All methods and properties that this object supports.


:: string
[R]

Type of this prototype.


:: string
[R]

Name of this prototype.




:: string
[R]

The string used to alphabetically sort these prototypes.


[R]

Prototype of the entity that will be created by placing this item, if any.


[R]

Prototype of the equipment that will be created by placing this item in an equipment grid, if any.


[R]

The place-as-tile result if one is defined, if any.


:: boolean
[R]

Is this item allowed to stack at all?


:: uint
[R]

The default request value.


:: uint
[R]

Maximum stack size of the item specified by this prototype.


:: uint
[R]

The number of items needed to connect two entities with this as wire.


:: string?
[R]

The fuel category of this item prototype, if any.


[R]

The result of burning this item as fuel, if any.


:: float
[R]

Fuel value when burned.


:: double
[R]

The acceleration multiplier when this item is used as fuel in a vehicle.


:: double
[R]

The fuel top speed multiplier when this item is used as fuel in a vehicle.


:: double
[R]

The emissions multiplier if this is used as fuel.


[R]

The subgroup this prototype belongs to.


[R]

The group this prototype belongs to.


[R]

The flags for this item prototype.


:: array[Product]
[R]

The results of launching this item in a rocket.


:: boolean
[R]

If this item can be mod-opened.


:: float?
[R]

Size of full magazine.


:: float?
[R]

Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine.


[R]

The prototype of this armor equipment grid, if any.


:: dictionary[stringResistance]?
[R]

Resistances of this armor item, if any, indexed by damage type name.


:: uint?
[R]

The inventory size bonus for this armor prototype.


[R]

The capsule action for this capsule item prototype.


[R]

The gun attack parameters.


:: uint?
[R]

The main inventory size for item-with-inventory-prototype.


:: dictionary[stringLuaItemPrototype]?
[R]

:: dictionary[stringLuaGroup]?
[R]

:: dictionary[stringLuaGroup]?
[R]

:: string?
[R]

The filter mode used by this item with inventory.


:: string?
[R]

The insertion priority mode used by this item with inventory.


[R]

The localised string used when the player attempts to put items into this item with inventory that aren't allowed.


:: boolean?
[R]

If this item with inventory extends the inventory it resides in by default.


:: Color?
[R]

The default label color used for this item with label, if any.


:: boolean?
[R]

If true, and this item with label has a label it is drawn in place of the normal number when held in the cursor.


:: float?
[R]

The repairing speed if this is a repairing tool.


[R]

Effects of this module.


:: string?
[R]

The name of a LuaModuleCategoryPrototype.


:: uint?
[R]

Tier of the module inside its category.


:: array[string]?
[R]

An array of recipe names this module is allowed to work with.


:: string?
[R]

The limitation message key used when the player attempts to use this modules in some place it's not allowed.


[R]

The straight rail prototype used for this rail planner prototype.


[R]

The curved rail prototype used for this rail planner prototype.


:: array[TriggerItem]?
[R]

The repair result of this repair tool prototype.


:: Color?
[R]

The color used when doing normal selection with this selection tool prototype.


:: Color?
[R]

The color used when doing alt selection with this selection tool prototype.


:: Color?
[R]

The color used when doing reverse selection with this selection tool prototype.


[R]

Flags that affect which entities will be selected.


[R]

Flags that affect which entities will be selected during alternate selection.


[R]

Flags that affect which entities will be selected during reverse selection.





:: boolean?
[R]

If tiles area always included when doing selection with this selection tool prototype.


:: string?
[R]

The entity filter mode used by this selection tool.


:: string?
[R]

The alt entity filter mode used by this selection tool.


:: string?
[R]

The reverse entity filter mode used by this selection tool.


:: string?
[R]

The tile filter mode used by this selection tool.


:: string?
[R]

The alt tile filter mode used by this selection tool.


:: string?
[R]

The reverse tile filter mode used by this selection tool.


:: dictionary[stringLuaEntityPrototype]?
[R]

The entity filters used by this selection tool indexed by entity name.


:: dictionary[stringLuaEntityPrototype]?
[R]

The alt entity filters used by this selection tool indexed by entity name.


:: dictionary[stringLuaEntityPrototype]?
[R]

The reverse entity filters used by this selection tool indexed by entity name.


:: dictionary[stringboolean]?
[R]

The entity type filters used by this selection tool indexed by entity type.


:: dictionary[stringboolean]?
[R]

The alt entity type filters used by this selection tool indexed by entity type.


:: dictionary[stringboolean]?
[R]

The reverse entity type filters used by this selection tool indexed by entity type.


:: dictionary[stringLuaTilePrototype]?
[R]

The tile filters used by this selection tool indexed by tile name.


:: dictionary[stringLuaTilePrototype]?
[R]

The alt tile filters used by this selection tool indexed by tile name.


:: dictionary[stringLuaTilePrototype]?
[R]

The reverse tile filters used by this selection tool indexed by tile name.


:: uint?
[R]

The number of entity filters this deconstruction item has.


:: uint?
[R]

The number of tile filters this deconstruction item has.


:: string?
[R]

The durability message key used when displaying the durability of this tool.


:: double?
[R]

The durability of this tool item.


:: boolean?
[R]

If this tool item has infinite durability.


:: uint?
[R]

How many filters an upgrade item has.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaItemStack

boolean

Is this blueprint item setup?


→ array[BlueprintEntity]?

The entities in this blueprint.


Set new entities to be a part of this blueprint.


add_ammo(amount)

Add ammo to this ammo item.


drain_ammo(amount)

Remove ammo from this ammo item.


add_durability(amount)

Add durability to this tool item.


Remove durability from this tool item.


can_set_stack(stack?)
boolean

Would a call to LuaItemStack::set_stack succeed?


set_stack(stack?)
boolean

Set this item stack to another item stack.


boolean

Transfers the given item stack into this item stack.


string

Export a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) to a string.


import_stack(data)
int

Import a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) from a string.


swap_stack(stack)
boolean

Swaps this item stack with the given item stack if allowed.


clear()

Clear this item stack.


→ array[Tile]?

A list of the tiles in this blueprint.


Set specific tiles in this blueprint.


get_inventory(inventory)

Access the inner inventory of an item.


build_blueprint{surface=…, force=…, position=…, force_build?=…, direction?=…, skip_fog_of_war?=…, by_player?=…, raise_built?=…}
→ array[LuaEntity]

deconstruct_area{surface=…, force=…, area=…, skip_fog_of_war?=…, by_player?=…}

Deconstruct the given area with this deconstruction item.


cancel_deconstruct_area{surface=…, force=…, area=…, skip_fog_of_war?=…, by_player?=…}

Cancel deconstruct the given area with this deconstruction item.


create_blueprint{surface=…, force=…, area=…, always_include_tiles?=…, include_entities?=…, include_modules?=…, include_station_names?=…, include_trains?=…, include_fuel?=…}
→ dictionary[uintLuaEntity]

Sets up this blueprint using the found blueprintable entities/tiles on the surface.


get_tag(tag_name)
AnyBasic?

Gets the tag with the given name or returns nil if it doesn't exist.


set_tag(tag_name, tag)

Sets the tag with the given name and value.


remove_tag(tag)
boolean

Removes a tag with the given name.


Clears this blueprint item.


string?

Gets the entity filter at the given index for this deconstruction item.


set_entity_filter(index, filter)
boolean

Sets the entity filter at the given index for this deconstruction item.


string?

Gets the tile filter at the given index for this deconstruction item.


set_tile_filter(index, filter)
boolean

Sets the tile filter at the given index for this deconstruction item.


Clears all settings/filters on this deconstruction item resetting it to default values.


Clears all settings/filters on this upgrade item resetting it to default values.


get_mapper(index, type)

Gets the filter at the given index for this upgrade item.


set_mapper(index, type, filter)

Sets the module filter at the given index for this upgrade item.


uint

Gets the number of entities in this blueprint item.


Tags

Gets the tags for the given blueprint entity index in this blueprint item.


Sets the tags on the given blueprint entity index in this blueprint item.


AnyBasic?

Gets the given tag on the given blueprint entity index in this blueprint item.


set_blueprint_entity_tag(index, tag, value)

Sets the given tag on the given blueprint entity index in this blueprint item.


Creates the equipment grid for this item if it doesn't exist and this is an item-with-entity-data that supports equipment grids.


help()
string

All methods and properties that this object supports.


:: boolean
[R]

Is this valid for reading?


[R]

Prototype of the item held in this stack.


:: string
[R]

Prototype name of the item held in this stack.


:: string
[R]

Type of the item prototype.


:: uint
[RW]

Number of items in this stack.


[R]

The equipment grid of this item, if any.


:: float
[RW]

How much health the item has, as a number in range [0, 1].


:: double?
[RW]

Durability of the contained item.


:: uint
[RW]

Number of bullets left in the magazine.


:: array[BlueprintSignalIcon]?
[RW]

Icons of this blueprint item, blueprint book, deconstruction item or upgrade planner.


[RW]

The snapping grid size in this blueprint item.


[RW]

The offset from the absolute grid.


:: boolean
[RW]

If absolute snapping is enabled on this blueprint item.


:: string?
[RW]

The current label for this item, if any.


:: Color?
[RW]

The current label color for this item, if any.


:: boolean
[RW]

Whether the label for this item can be manually changed.


:: dictionary[stringuint]
[R]

Raw materials required to build this blueprint.


:: boolean
[RW]

If this item extends the inventory it resides in (provides its contents for counts, crafting, insertion).


:: string
[RW]

The insertion mode priority this ItemWithInventory uses when items are inserted into an inventory it resides in.


:: array[BlueprintItemIcon]
[R]

The default icons for a blueprint item.


:: Tags
[RW]

[RW]

The custom description this item-with-tags.


:: array[string]
[RW]

The entity filters for this deconstruction item.


:: array[string]
[RW]

The tile filters for this deconstruction item.


[RW]

The blacklist/whitelist entity filter mode for this deconstruction item.


[RW]

The blacklist/whitelist tile filter mode for this deconstruction item.


[RW]

The tile selection mode for this deconstruction item.


:: boolean
[RW]

If this deconstruction item is set to allow trees and rocks only.


:: uint
[R]

The number of entity filters this deconstruction item supports.


:: uint
[R]

The number of tile filters this deconstruction item supports.


:: uint?
[RW]

The active blueprint index for this blueprint book.


:: uint?
[R]

The unique identifier for this item , if any.


:: LuaEntity?
[RW]

If this item is a spidertron remote that has a spidertron bound to it, it returns the connected spider-vehicle entity.


:: boolean
[R]

If this is a blueprint item.


:: boolean
[R]

If this is a blueprint book item.


:: boolean
[R]

If this is a module item.


:: boolean
[R]

If this is a tool item.


:: boolean
[R]

If this is a mining tool item.


:: boolean
[R]

If this is an armor item.


:: boolean
[R]

If this is a repair tool item.


:: boolean
[R]

If this is an item with label item.


:: boolean
[R]

If this is an item with inventory item.


:: boolean
[R]

If this is an item with entity data item.


:: boolean
[R]

If this is a selection tool item.


:: boolean
[R]

If this is an item with tags item.


:: boolean
[R]

If this is a deconstruction tool item.


:: boolean
[R]

If this is a upgrade item.


:: 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
[RW]

true if the lamp should set the color from the circuit network signals.


:: Color?
[R]

The color the lamp is showing, if any.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.



get()
Any

Gets the value of this lazy loaded value.


help()
string

All methods and properties that this object supports.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

boolean

Is a given position within the logistic range of this cell?


boolean

Is a given position within the construction range of this cell?


boolean

Are two cells neighbours?


help()
string

All methods and properties that this object supports.


:: float
[R]

Logistic radius of this cell.


:: float
[R]

Logistic connection distance of this cell.


:: float
[R]

Construction radius of this cell.


:: uint
[R]

Number of stationed logistic robots in this cell.


:: uint
[R]

Number of stationed construction robots in this cell.


:: boolean
[R]

true if this is a mobile cell.


:: boolean
[R]

true if this cell is active.


:: float
[R]

Radius at which the robots hover when waiting to be charged.


:: uint
[R]

Number of robots currently charging.


:: uint
[R]

Number of robots waiting to charge.


[R]

This cell's owner.


[R]

The network that owns this cell, if any.


:: array[LuaLogisticCell]
[R]

Neighbouring cells.


:: array[LuaEntity]
[R]

Robots currently being charged.


:: array[LuaEntity]
[R]

Robots waiting to charge.


:: 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 circuit mode of operations for the logistic container.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


get_item_count(item?, member?)
int

Count given or all items in the network or given members.


→ dictionary[stringuint]

Get item counts for the entire network, similar to how LuaInventory::get_contents does.


remove_item(item, members?)
uint

Remove items from the logistic network.


insert(item, members?)
uint

Insert items into the logistic network.


Find logistic cell closest to a given position.


select_pickup_point{name=…, position?=…, include_buffers?=…, members?=…}

Find the 'best' logistic point with this item ID and from the given position or from given chest type.


select_drop_point{stack=…, members?=…}

Find a logistic point to drop the specific item stack.


can_satisfy_request(item, count?, include_buffers?)
boolean

Can the network satisfy a request for a given item and count.


→ dictionary[stringuint]

Get the amount of items of the given type indexed by the storage member.


→ dictionary[string → array[LuaLogisticPoint]]

Gets the logistic points with of the given type indexed by the storage member.


help()
string

All methods and properties that this object supports.


[R]

The force this logistic network belongs to.


:: uint
[R]

Number of logistic robots available for a job.


:: uint
[R]

The total number of logistic robots in the network (idle and active + in roboports).


:: uint
[R]

Number of construction robots available for a job.


:: uint
[R]

The total number of construction robots in the network (idle and active + in roboports).


:: uint
[R]

Maximum number of robots the network can work with.


:: array[LuaLogisticCell]
[R]

All cells in this network.


:: array[LuaEntity]
[R]

All entities that have logistic provider points in this network.


:: array[LuaEntity]
[R]

All entities that have empty logistic provider points in this network.


:: array[LuaEntity]
[R]

All entities that have logistic requester points in this network.


:: array[LuaEntity]
[R]

All entities that have logistic storage points in this network.


:: array[LuaEntity]
[R]

All other entities that have logistic points in this network (inserters mostly).


:: array[LuaLogisticPoint]
[R]

All things that have provider points in this network.


:: array[LuaLogisticPoint]
[R]

All passive provider points in this network.


:: array[LuaLogisticPoint]
[R]

All active provider points in this network.


:: array[LuaLogisticPoint]
[R]

All things that have empty provider points in this network.


:: array[LuaLogisticPoint]
[R]

All things that have requester points in this network.


:: array[LuaLogisticPoint]
[R]

All things that have storage points in this network.


:: array[LuaEntity]
[R]

All robots in this logistic network.


:: array[LuaEntity]
[R]

All construction robots in this logistic network.


:: array[LuaEntity]
[R]

All logistic robots in this logistic network.


:: 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 LuaEntity owner of this LuaLogisticPoint.



:: uint
[R]

The Logistic member index of this logistic point.


:: array[LogisticFilter]?
[R]

The logistic filters for this logistic point, if this uses any.


[R]

The logistic mode.


[R]

The force of this logistic point.


:: dictionary[stringuint]
[R]

Items targeted to be picked up from this logistic point by robots.


:: dictionary[stringuint]
[R]

Items targeted to be dropped off into this logistic point by robots.


:: boolean
[R]

If this logistic point is using the exact mode.


:: 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
[RW]

true if this drill is enabled or disabled using the logistics or circuit condition.


:: boolean
[RW]

true if this drill should send the resources in the field to the circuit network.


[RW]

If the mining drill should send just the resources in its area or the entire field it's on to the circuit network.


:: array[LuaEntity]
[R]

The resource entities that the mining drill will send information about to the circuit network or an empty array.


:: 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]

The string used to alphabetically sort these prototypes.




mod
:: string
[R]

The mod that owns this setting.



:: boolean or double or int or string
[R]

The default value of this setting.


:: double or int?
[R]

The minimum value for this setting.


:: double or int?
[R]

The maximum value for this setting.


:: array[string] or array[int] or array[double]?
[R]

The allowed values for this setting.


:: boolean?
[R]

Whether this string setting allows blank values.


:: boolean?
[R]

Whether this string setting auto-trims values.


:: boolean
[R]

Whether this setting is hidden from the GUI.


:: 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]

The string used to alphabetically sort these prototypes.




:: 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]

The string used to alphabetically sort these prototypes.




:: string
[R]

Name of the property that this expression is intended to provide a value for, if any.


[R]

The expression itself.


:: 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]

The string used to alphabetically sort these prototypes.




:: 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]

The string used to alphabetically sort these prototypes.








:: uint
[R]





:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

add_player(player)
boolean

Adds the given player to this group.


remove_player(player)
boolean

Removes the given player from this group.


allows_action(action)
boolean

Whether this group allows the given action.


set_allows_action(action, allow_action)
boolean

Sets whether this group allows the performance the given action.


boolean

Destroys this group.


help()
string

All methods and properties that this object supports.


:: string
[RW]

The name of this group.


:: array[LuaPlayer]
[R]

The players in this group.


:: uint
[R]

The group ID


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

create_group(name?)

Creates a new permission group.


get_group(group)

Gets the permission group with the given name or group ID.


help()
string

All methods and properties that this object supports.


:: array[LuaPermissionGroup]
[R]

All of the permission groups.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaPlayer extends LuaControl

set_ending_screen_data(message, file?)

Setup the screen to be shown when the game is finished.


print(message, color?)

Print text to the chat console.


Clear the chat console.


Get the current goal description, as a localised string.


set_goal_description(text?, only_update?)

Set the text in the goal window (top left).


set_controller{type=…, character?=…, waypoints?=…, start_position?=…, start_zoom?=…, final_transition_time?=…, chart_mode_cutoff?=…}

Set the controller type of the player.


drag_wire{position=…}
boolean

Start/end wire dragging at the specified location, wire type is based on the cursor contents


Disable recipe groups.


Enable recipe groups.


Disable recipe subgroups.


Enable recipe subgroups.


Print entity statistics to the player's console.


Print construction robot job counts to the players console.


Print LuaObject counts per mod.


Logs a dictionary of chunks -> active entities for the surface this player is on.


Logs a dictionary of active entities -> count for the surface this player is on.


Unlock the achievements of the given player.


boolean

Invokes the "clear cursor" action on the player as if the user pressed it.


create_character(character?)
boolean

Creates and attaches a character entity to this player.


add_alert(entity, type)

Adds an alert to this player for the given entity of the given alert type.


add_custom_alert(entity, icon, message, show_on_map)

Adds a custom alert to this player.


remove_alert{entity?=…, prototype?=…, position?=…, type?=…, surface?=…, icon?=…, message?=…}

Removes all alerts matching the given filters or if an empty filters table is given all alerts are removed.


get_alerts{entity?=…, prototype?=…, position?=…, type?=…, surface?=…}
→ dictionary[uint → dictionary[defines.alert_type → array[Alert]]]

Get all alerts matching the given filters, or all alerts if no filters are given.


mute_alert(alert_type)
boolean

Mutes alerts for the given alert category.


unmute_alert(alert_type)
boolean

Unmutes alerts for the given alert category.


is_alert_muted(alert_type)
boolean

If the given alert type is currently muted.


enable_alert(alert_type)
boolean

Enables alerts for the given alert category.


disable_alert(alert_type)
boolean

Disables alerts for the given alert category.


is_alert_enabled(alert_type)
boolean

If the given alert type is currently enabled.


pipette_entity(entity)
boolean

Invokes the "smart pipette" action on the player as if the user pressed it.


can_place_entity{name=…, position=…, direction?=…}
boolean

Checks if this player can build the give entity at the given location on the surface the player is on.


can_build_from_cursor{position=…, direction?=…, alt?=…, terrain_building_size?=…, skip_fog_of_war?=…}
boolean

Checks if this player can build what ever is in the cursor on the surface the player is on.


build_from_cursor{position=…, direction?=…, alt?=…, terrain_building_size?=…, skip_fog_of_war?=…}

Builds what ever is in the cursor on the surface the player is on.


use_from_cursor(position)

Uses the current item in the cursor if it's a capsule or does nothing if not.


play_sound{path=…, position?=…, volume_modifier?=…, override_sound_type?=…}

Play a sound for this player.


→ array[LuaEntity]

The characters associated with this player.


associate_character(character)

Associates a character with this player.


Disassociates a character from this player.


create_local_flying_text{text=…, position?=…, create_at_cursor?=…, color?=…, time_to_live?=…, speed?=…}

Spawn flying text that is only visible to this player.


Gets the quick bar filter for the given slot or nil.


set_quick_bar_slot(index, filter)

Sets the quick bar filter for the given slot.


uint8?

Gets which quick bar page is being used for the given screen page or nil if not known.


set_active_quick_bar_page(screen_index, page_index)

Sets which quick bar page is being used for the given screen page.


jump_to_cutscene_waypoint(waypoint_index)

Jump to the specified cutscene waypoint.


Exit the current cutscene.


open_map(position, scale?)

Queues a request to open the map at the specified position.


zoom_to_world(position, scale?)

Queues a request to zoom to world at the specified position.


Queues request to switch to the normal game view from the map or zoom to world view.


is_shortcut_toggled(prototype_name)
boolean

Is a custom Lua shortcut currently toggled?


is_shortcut_available(prototype_name)
boolean

Is a custom Lua shortcut currently available?


set_shortcut_toggled(prototype_name, toggled)

Toggle or untoggle a custom Lua shortcut


set_shortcut_available(prototype_name, available)

Make a custom Lua shortcut available or unavailable.


connect_to_server{address=…, name?=…, description?=…, password?=…}

Asks the player if they would like to connect to the given server.


Toggles this player into or out of the map editor.


request_translation(localised_string)
boolean

Requests a translation for the given localised string.


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


Sets the filter for this map editor infinity filters at the given index.


Clears all recipe notifications for this player.


Adds the given recipe to the list of recipe notifications for this player.


add_to_clipboard(blueprint)

Adds the given blueprint to this player's clipboard queue.


Gets a copy of the currently selected blueprint in the clipboard queue into the player's cursor, as if the player activated Paste.


start_selection(position, selection_mode)

Starts selection with selection tool from the specified position.


Clears the players selection tool selection position.


help()
string

All methods and properties that this object supports.


:: LuaEntity?
[RW]

The character attached to this player, if any.


:: LuaEntity?
[R]

When in a cutscene; the character this player would be using once the cutscene is over, if any.


:: uint
[R]

This player's unique index in LuaGameScript::players.


gui
:: LuaGui
[R]

:: boolean
[R]

true if the player opened itself.



[R]

The stashed controller type, if any.


[RW]

The player's game view settings.


:: boolean
[RW]

true if the minimap is visible.


:: Color
[RW]

The color associated with the player.


:: Color
[RW]

The color used when this player talks in game.


:: string
[R]

The player's username.


tag
:: string
[RW]

The tag that is shown after the player in chat and on the map.


:: boolean
[R]

true if the player is currently connected to the game.


:: boolean
[RW]

true if the player is an admin.


:: LuaEntity?
[R]

The source entity used during entity settings copy-paste, if any.


:: uint
[R]

How many ticks since the last action of this player


:: uint
[R]

How many ticks did this player spend playing this save (all sessions combined)


:: uint
[R]

At what tick this player was last online.


[RW]

The permission group this player is part of, if any.


[R]

The current per-player settings for the this player, indexed by prototype name.


:: uint?
[RW]

The number of ticks until this player will respawn.


[R]

The display resolution for this player.


:: double
[R]

The display scale for this player.


[R]

The item stack containing a blueprint to be setup.


[R]

The render mode of the player, like map or zoom to world.


:: boolean
[RW]

If true, zoom-to-world noise effect will be disabled and environmental sounds will be based on zoom-to-world view instead of position of player's character.


:: boolean
[RW]

If true, circle and name of given player is rendered on the map/chart.


:: boolean
[RW]

If items not included in this map editor infinity inventory filters should be removed.


[RW]

The filters for this map editor infinity inventory settings.


:: boolean
[R]

If the main inventory will be auto sorted.


[RW]

The original location of the item in the cursor, marked with a hand.


:: double
[W]

The player's zoom-level.


[W]

The player's map view settings.


:: 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

Class LuaProfiler

reset()

Resets the clock, also restarting it.


stop()

Stops the clock.


Start the clock again, without resetting it.


add(other)

Add the duration of another timer to this timer.


divide(number)

Divides the current duration by a set value.


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.




:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


Class LuaRCON

print(message)

Print text to the calling RCON interface if any.


:: string
[R]

This object's name.

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 LuaRailPath

help()
string

All methods and properties that this object supports.


:: uint
[R]

The total number of rails in this path.


:: uint
[R]

The current rail index.


:: double
[R]

The total path distance.


:: double
[R]

The total distance travelled.


[R]

Array of the rails that this path travels over.


:: 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
[RW]

If this will close the rail signal based off the circuit condition.


:: boolean
[RW]

If this will read the rail signal state.


[RW]

The circuit condition when controlling the signal through the circuit network.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


re_seed(seed)

Re-seeds the random generator with the given value.


help()
string

All methods and properties that this object supports.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


double

Generates a random number.

Class LuaRecipe

reload()

Reload the recipe from the prototype.


help()
string

All methods and properties that this object supports.


:: string
[R]

Name of the recipe.


[R]

Localised name of the recipe.



[R]

The prototype for this recipe.


:: boolean
[RW]

Can the recipe be used?


:: string
[R]

Category of the recipe.


:: array[Ingredient]
[R]

Ingredients for this recipe.


:: array[Product]
[R]

The results of this recipe.


:: boolean
[R]

Is the recipe hidden?


:: boolean
[RW]

Is the recipe hidden from flow statistics?


:: double
[R]

Energy required to execute this recipe.


:: string
[R]

The string used to alphabetically sort these prototypes.


[R]

Group of this recipe.


[R]

Subgroup of this recipe.


[R]

The force that owns this recipe.


:: 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]

The string used to alphabetically sort these prototypes.




:: 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]

If this recipe prototype is enabled by default (enabled at the beginning of a game).


:: string
[R]

Name of the recipe.


[R]

Localised name of the recipe.



:: string
[R]

Category of the recipe.


:: array[Ingredient]
[R]

Ingredients for this recipe.


:: array[Product]
[R]

The results of this recipe.


:: Product?
[R]

The main product of this recipe, if any.


:: boolean
[R]

Is the recipe hidden?


:: boolean
[R]

Is the recipe hidden from flow statistics (item/fluid production statistics)?


:: boolean
[R]

Is the recipe hidden from player crafting?


:: boolean
[R]

Should this recipe always show "Made in" in the tooltip?


:: double
[R]

Energy required to execute this recipe.


:: string
[R]

The string used to alphabetically sort these prototypes.


[R]

Group of this recipe.


[R]

Subgroup of this recipe.


:: uint
[R]

The multiplier used when this recipe is copied from an assembling machine to a requester chest.


:: uint
[R]

Used to determine how many extra items are put into an assembling machine before it's considered "full enough".


:: boolean
[R]

If the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size).


:: boolean
[R]

If this recipe is enabled for the purpose of intermediate hand-crafting.


:: boolean
[R]

If this recipe is allowed to use intermediate recipes when hand-crafting.


:: boolean
[R]

If the amount is shown in the recipe tooltip title when the recipe produces more than 1 product.


:: boolean
[R]

If the products are always shown in the recipe tooltip.


:: double
[R]

The emissions multiplier for this recipe.


:: boolean
[R]

Is this recipe allowed to be broken down for the recipe tooltip "Total raw" calculations?


:: boolean
[R]

Is this recipe unlocks the result item(s) so they're shown in filter-select GUIs.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaRemote

add_interface(name, functions)

Add a remote interface.


boolean

Removes an interface with the given name.


call(interface, function, ...)
Any?

Call a function of an interface.


:: string
[R]

This object's name.


:: dictionary[string → dictionary[stringboolean]]
[R]

List of all registered interfaces.

Class LuaRendering

draw_line{color=…, width=…, gap_length?=…, dash_length?=…, from=…, from_offset?=…, to=…, to_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…}
uint64

Create a line.


draw_text{text=…, surface=…, target=…, target_offset?=…, color=…, scale?=…, font?=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, orientation?=…, alignment?=…, vertical_alignment?=…, scale_with_zoom?=…, only_in_alt_mode?=…}
uint64

Create a text.


draw_circle{color=…, radius=…, width?=…, filled=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…}
uint64

Create a circle.


draw_rectangle{color=…, width?=…, filled=…, left_top=…, left_top_offset?=…, right_bottom=…, right_bottom_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…}
uint64

Create a rectangle.


draw_arc{color=…, max_radius=…, min_radius=…, start_angle=…, angle=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…}
uint64

Create an arc.


draw_polygon{color=…, vertices=…, target?=…, target_offset?=…, orientation?=…, orientation_target?=…, orientation_target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, draw_on_ground?=…, only_in_alt_mode?=…}
uint64

Create a triangle mesh defined by a triangle strip.


draw_sprite{sprite=…, orientation?=…, x_scale?=…, y_scale?=…, tint?=…, render_layer?=…, orientation_target?=…, orientation_target_offset?=…, oriented_offset?=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, only_in_alt_mode?=…}
uint64

Create a sprite.


draw_light{sprite=…, orientation?=…, scale?=…, intensity?=…, minimum_darkness?=…, oriented?=…, color?=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, only_in_alt_mode?=…}
uint64

Create a light.


draw_animation{animation=…, orientation?=…, x_scale?=…, y_scale?=…, tint?=…, render_layer?=…, animation_speed?=…, animation_offset?=…, orientation_target?=…, orientation_target_offset?=…, oriented_offset?=…, target=…, target_offset?=…, surface=…, time_to_live?=…, forces?=…, players?=…, visible?=…, only_in_alt_mode?=…}
uint64

Create an animation.


destroy(id)

Destroy the object with the given id.


is_font_valid(font_name)
boolean

Does a font with this name exist?


is_valid(id)
boolean

Does a valid object with this id exist?


get_all_ids(mod_name?)
→ array[uint64]

Gets an array of all valid object ids.


clear(mod_name?)

Destroys all render objects.


get_type(id)
string

Gets the type of the given object.


Reorder this object so that it is drawn in front of the already existing objects.


The surface the object with this id is rendered on.


uint

Get the time to live of the object with this id.


set_time_to_live(id, time_to_live)

Set the time to live of the object with this id.


→ array[LuaForce]?

Get the forces that the object with this id is rendered to or nil if visible to all forces.


set_forces(id, forces)

Set the forces that the object with this id is rendered to.


→ array[LuaPlayer]?

Get the players that the object with this id is rendered to or nil if visible to all players.


set_players(id, players)

Set the players that the object with this id is rendered to.


boolean

Get whether this is rendered to anyone at all.


set_visible(id, visible)

Set whether this is rendered to anyone at all.


boolean

Get whether this is being drawn on the ground, under most entities and sprites.


set_draw_on_ground(id, draw_on_ground)

Set whether this is being drawn on the ground, under most entities and sprites.


boolean

Get whether this is only rendered in alt-mode.


set_only_in_alt_mode(id, only_in_alt_mode)

Set whether this is only rendered in alt-mode.


get_color(id)
Color?

Get the color or tint of the object with this id.


set_color(id, color)

Set the color or tint of the object with this id.


get_width(id)
float?

Get the width of the object with this id.


set_width(id, width)

Set the width of the object with this id.


get_from(id)

Get from where the line with this id is drawn.


set_from(id, from, from_offset?)

Set from where the line with this id is drawn.


get_to(id)

Get where the line with this id is drawn to.


set_to(id, to, to_offset?)

Set where the line with this id is drawn to.


double?

Get the dash length of the line with this id.


set_dash_length(id, dash_length)

Set the dash length of the line with this id.


double?

Get the length of the gaps in the line with this id.


set_gap_length(id, gap_length)

Set the length of the gaps in the line with this id.


set_dashes(id, dash_length, gap_length)

Set the length of the dashes and the length of the gaps in the line with this id.


Get where the object with this id is drawn.


set_target(id, target, target_offset?)

Set where the object with this id is drawn.


Get the orientation of the object with this id.


set_orientation(id, orientation)

Set the orientation of the object with this id.


get_scale(id)
double?

Get the scale of the text or light with this id.


set_scale(id, scale)

Set the scale of the text or light with this id.


get_text(id)

Get the text that is displayed by the text with this id.


set_text(id, text)

Set the text that is displayed by the text with this id.


get_font(id)
string?

Get the font of the text with this id.


set_font(id, font)

Set the font of the text with this id.


string?

Get the alignment of the text with this id.


set_alignment(id, alignment)

Set the alignment of the text with this id.


string?

Get the vertical alignment of the text with this id.


set_vertical_alignment(id, alignment)

Set the vertical alignment of the text with this id.


boolean?

Get if the text with this id scales with player zoom.


set_scale_with_zoom(id, scale_with_zoom)

Set if the text with this id scales with player zoom, resulting in it always being the same size on screen, and the size compared to the game world changes.


boolean?

Get if the circle or rectangle with this id is filled.


set_filled(id, filled)

Set if the circle or rectangle with this id is filled.


double?

Get the radius of the circle with this id.


set_radius(id, radius)

Set the radius of the circle with this id.


Get where top left corner of the rectangle with this id is drawn.


set_left_top(id, left_top, left_top_offset?)

Set where top left corner of the rectangle with this id is drawn.


Get where bottom right corner of the rectangle with this id is drawn.


set_right_bottom(id, right_bottom, right_bottom_offset?)

Set where top bottom right of the rectangle with this id is drawn.


set_corners(id, left_top, left_top_offset, right_bottom, right_bottom_offset)

Set the corners of the rectangle with this id.


double?

Get the radius of the outer edge of the arc with this id.


set_max_radius(id, max_radius)

Set the radius of the outer edge of the arc with this id.


double?

Get the radius of the inner edge of the arc with this id.


set_min_radius(id, min_radius)

Set the radius of the inner edge of the arc with this id.


float?

Get where the arc with this id starts.


set_start_angle(id, start_angle)

Set where the arc with this id starts.


get_angle(id)
float?

Get the angle of the arc with this id.


set_angle(id, angle)

Set the angle of the arc with this id.


→ array[ScriptRenderTarget]?

Get the vertices of the polygon with this id.


set_vertices(id, vertices)

Set the vertices of the polygon with this id.


SpritePath?

Get the sprite of the sprite or light with this id.


set_sprite(id, sprite)

Set the sprite of the sprite or light with this id.


double?

Get the horizontal scale of the sprite or animation with this id.


set_x_scale(id, x_scale)

Set the horizontal scale of the sprite or animation with this id.


double?

Get the vertical scale of the sprite or animation with this id.


set_y_scale(id, y_scale)

Set the vertical scale of the sprite or animation with this id.


Get the render layer of the sprite or animation with this id.


set_render_layer(id, render_layer)

Set the render layer of the sprite or animation with this id.


The object rotates so that it faces this target.


set_orientation_target(id, orientation_target, orientation_target_offset?)

The object rotates so that it faces this target.


Vector?

Offsets the center of the sprite or animation if orientation_target is given.


set_oriented_offset(id, oriented_offset)

Offsets the center of the sprite or animation if orientation_target is given.


float?

Get the intensity of the light with this id.


set_intensity(id, intensity)

Set the intensity of the light with this id.


float?

Get the minimum darkness at which the light with this id is rendered.


set_minimum_darkness(id, minimum_darkness)

Set the minimum darkness at which the light with this id is rendered.


boolean?

Get if the light with this id is rendered has the same orientation as the target entity.


set_oriented(id, oriented)

Set if the light with this id is rendered has the same orientation as the target entity.


string?

Get the animation prototype name of the animation with this id.


set_animation(id, animation)

Set the animation prototype name of the animation with this id.


double?

Get the animation speed of the animation with this id.


set_animation_speed(id, animation_speed)

Set the animation speed of the animation with this id.


double?

Get the animation offset of the animation with this id.


set_animation_offset(id, animation_offset)

Set the animation offset of the animation with this id.


:: string
[R]

This object's name.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

The string used to alphabetically sort these prototypes.




:: 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
[RW]

true if the roboport should report the logistics network content to the circuit network.


:: boolean
[RW]

true if the roboport should report the robot statistics to the circuit network.






:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


Class LuaSettings

Gets the current per-player settings for the given player, indexed by prototype name.


[R]

The startup mod settings, indexed by prototype name.


[R]

The current global mod settings, indexed by prototype name.


[R]

The default player mod settings for this map, indexed by prototype name.


:: string
[R]

This object's name.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

The string used to alphabetically sort these prototypes.




:: string
[R]

[R]

The item to create when this shortcut is used, if any.


[R]

The technology to unlock when this shortcut is used, if any.



:: string?
[R]

The control input that is associated with this shortcut, if any.


:: 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 LuaStyle

help()
string

All methods and properties that this object supports.


gui
:: LuaGui
[R]

Gui of the LuaGuiElement of this style.


:: string
[R]

Name of this style.


:: int
[RW]

Minimal width ensures, that the widget will never be smaller than than that size.


:: int
[RW]

Maximal width ensures, that the widget will never be bigger than than that size.


:: int
[RW]

Minimal height ensures, that the widget will never be smaller than than that size.


:: int
[RW]

Maximal height ensures, that the widget will never be bigger than than that size.


:: int
[RW]

Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a smaller or bigger size.


:: int
[RW]

Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a smaller or bigger size.


:: int
[RW]

:: int
[RW]


:: int
[RW]

:: int
[RW]

:: int
[RW]

:: int
[RW]

:: int
[RW]

:: string?
[RW]

Horizontal align of the inner content of the widget, if any.


:: string?
[RW]

Vertical align of the inner content of the widget, if any.


:: Color
[RW]

:: string
[RW]

:: int
[RW]

Space between the table cell contents top and border.


:: int
[RW]

Space between the table cell contents right and border.


:: int
[RW]

Space between the table cell contents bottom and border.


:: int
[RW]

Space between the table cell contents left and border.


:: boolean?
[RW]

Whether the GUI element stretches its size horizontally to other elements.


:: boolean?
[RW]

Whether the GUI element stretches its size vertically to other elements.


:: boolean?
[RW]

Whether the GUI element can be squashed (by maximal width of some parent element) horizontally.


:: boolean?
[RW]

Whether the GUI element can be squashed (by maximal height of some parent element) vertically.


[RW]

How this GUI element handles rich text.











:: int
[RW]

Horizontal space between individual cells.


:: int
[RW]

Vertical space between individual cells.



:: uint
[RW]

:: Color
[RW]

[R]

Array containing the alignment for every column of this table element.












:: string
[RW]





:: int
[W]

Sets both minimal and maximal width to the given value.


:: int
[W]

Sets both minimal and maximal height to the given value.


:: int or array[int]
[W]

Sets both width and height to the given value.


:: int or array[int]
[W]

Sets top/right/bottom/left paddings to this value.


:: int or array[int]
[W]

Sets top/right/bottom/left margins to this value.


:: int
[W]

Space between the table cell contents and border.


:: int or array[int]
[W]

Sets extra_top/right/bottom/left_padding_when_activated to this value.


:: int or array[int]
[W]

Sets extra_top/right/bottom/left_margin_when_activated to this value.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaSurface

get_pollution(position)
double

Get the pollution for a given position.


can_place_entity{name=…, position=…, direction?=…, force?=…, build_check_type?=…, forced?=…, inner_name?=…}
boolean

Check for collisions with terrain or other entities.


can_fast_replace{name=…, position=…, direction?=…, force?=…}
boolean

If there exists an entity at the given location that can be fast-replaced with the given entity parameters.


find_entity(entity, position)
LuaEntity?

Find a specific entity at a specific position.


find_entities(area?)
→ array[LuaEntity]

Find entities in a given area.


find_entities_filtered{area?=…, position?=…, radius?=…, name?=…, type?=…, ghost_name?=…, ghost_type?=…, direction?=…, collision_mask?=…, force?=…, to_be_deconstructed?=…, to_be_upgraded?=…, limit?=…, is_military_target?=…, invert?=…}
→ array[LuaEntity]

Find all entities of the given type or name in the given area.


find_tiles_filtered{area?=…, position?=…, radius?=…, name?=…, force?=…, limit?=…, has_hidden_tile?=…, has_tile_ghost?=…, to_be_deconstructed?=…, collision_mask?=…, invert?=…}
→ array[LuaTile]

Find all tiles of the given name in the given area.


count_entities_filtered{area?=…, position?=…, radius?=…, name?=…, type?=…, ghost_name?=…, ghost_type?=…, direction?=…, collision_mask?=…, force?=…, to_be_deconstructed?=…, to_be_upgraded?=…, limit?=…, is_military_target?=…, invert?=…}
uint

Count entities of given type or name in a given area.


count_tiles_filtered{area?=…, position?=…, radius?=…, name?=…, force?=…, limit?=…, has_hidden_tile?=…, has_tile_ghost?=…, to_be_deconstructed?=…, collision_mask?=…, invert?=…}
uint

Count tiles of a given name in a given area.


find_non_colliding_position(name, center, radius, precision, force_to_tile_center?)

Find a non-colliding position within a given radius.


find_non_colliding_position_in_box(name, search_space, precision, force_to_tile_center?)

Find a non-colliding position within a given rectangle.


spill_item_stack(position, items, enable_looted?, force?, allow_belts?)
→ array[LuaEntity]

Spill items on the ground centered at a given location.


find_enemy_units(center, radius, force?)
→ array[LuaEntity]

Find enemy units (entities with type "unit") of a given force within an area.


find_units{area=…, force=…, condition=…}
→ array[LuaEntity]

Find units (entities with type "unit") of a given force and force condition within a given area.


find_nearest_enemy{position=…, max_distance=…, force?=…}
LuaEntity?

Find the enemy military target (military entity) closest to the given position.


find_nearest_enemy_entity_with_owner{position=…, max_distance=…, force?=…}
LuaEntity

Find the enemy entity-with-owner closest to the given position.


set_multi_command{command=…, unit_count=…, force?=…, unit_search_distance?=…}
uint

Give a command to multiple units.


create_entity{name=…, position=…, direction?=…, force?=…, target?=…, source?=…, fast_replace?=…, player?=…, spill?=…, raise_built?=…, create_build_effect_smoke?=…, spawn_decorations?=…, move_stuck_players?=…, item?=…}
LuaEntity?

Create an entity on this surface.


create_trivial_smoke{name=…, position=…}

create_particle{name=…, position=…, movement=…, height=…, vertical_speed=…, frame_speed=…}

Creates a particle at the given location


create_unit_group{position=…, force?=…}

Create a new unit group at a given position.


build_enemy_base(position, unit_count, force?)

Send a group to build a new base.


get_tile(x, y)
LuaTile

Get the tile at a given position.


set_tiles(tiles, correct_tiles?, remove_colliding_entities?, remove_colliding_decoratives?, raise_event?)

Set tiles at specified locations.


pollute(source, amount)

Spawn pollution at the given position.


Get an iterator going over every chunk on this surface.


is_chunk_generated(position)
boolean

Is a given chunk generated?


request_to_generate_chunks(position, radius)

Request that the game's map generator generate chunks at the given position for the given radius on this surface.


Blocks and generates all chunks that have been requested using all available threads.


set_chunk_generated_status(position, status)

Set generated status of a chunk.


Find the logistic network that covers a given position.


→ array[LuaLogisticNetwork]

Finds all of the logistics networks whose construction area intersects with the given position.


deconstruct_area{area=…, force=…, player?=…, skip_fog_of_war?=…, item?=…}

Place a deconstruction request.


cancel_deconstruct_area{area=…, force=…, player?=…, skip_fog_of_war?=…, item?=…}

Cancel a deconstruction order.


upgrade_area{area=…, force=…, player?=…, skip_fog_of_war?=…, item=…}

Place an upgrade request.


cancel_upgrade_area{area=…, force=…, player?=…, skip_fog_of_war?=…, item?=…}

Cancel a upgrade order.


get_hidden_tile(position)
string?

The hidden tile name.


set_hidden_tile(position, tile)

Set the hidden tile for the specified position.


get_connected_tiles(position, tiles)
→ array[TilePosition]

Gets all tiles of the given types that are connected horizontally or vertically to the given tile position including the given tile position.


delete_chunk(position)

regenerate_entity(entities?, chunks?)

Regenerate autoplacement of some entities on this surface.


regenerate_decorative(decoratives?, chunks?)

Regenerate autoplacement of some decoratives on this surface.


print(message, color?)

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


destroy_decoratives{area?=…, position?=…, name?=…, collision_mask?=…, from_layer?=…, to_layer?=…, exclude_soft?=…, limit?=…, invert?=…}

Removes all decoratives from the given area.


create_decoratives{check_collision?=…, decoratives=…}

Adds the given decoratives to the surface.


find_decoratives_filtered{area?=…, position?=…, name?=…, collision_mask?=…, from_layer?=…, to_layer?=…, exclude_soft?=…, limit?=…, invert?=…}
→ array[DecorativeResult]

Find decoratives of a given name in a given area.


get_trains(force?)
→ array[LuaTrain]

Clears all pollution on this surface.


play_sound{path=…, position?=…, volume_modifier?=…, override_sound_type?=…}

Play a sound for every player on this surface.


→ dictionary[stringuint]

Gets the resource amount of all resources on this surface


Gets a random generated chunk position or 0,0 if no chunks have been generated on this surface.


clone_area{source_area=…, destination_area=…, destination_surface?=…, destination_force?=…, clone_tiles?=…, clone_entities?=…, clone_decoratives?=…, clear_destination_entities?=…, clear_destination_decoratives?=…, expand_map?=…, create_build_effect_smoke?=…}

Clones the given area.


clone_brush{source_offset=…, destination_offset=…, source_positions=…, destination_surface?=…, destination_force?=…, clone_tiles?=…, clone_entities?=…, clone_decoratives?=…, clear_destination_entities?=…, clear_destination_decoratives?=…, expand_map?=…, manual_collision_mode?=…, create_build_effect_smoke?=…}

Clones the given area.


clone_entities{entities=…, destination_offset=…, destination_surface?=…, destination_force?=…, snap_to_grid?=…, create_build_effect_smoke?=…}

Clones the given entities.


clear(ignore_characters?)

Clears this surface deleting all entities and chunks on it.


request_path{bounding_box=…, collision_mask=…, start=…, goal=…, force=…, radius?=…, pathfind_flags?=…, can_open_gates?=…, path_resolution_modifier?=…, entity_to_ignore?=…}
uint

Generates a path with the specified constraints (as an array of PathfinderWaypoints) using the unit pathfinding algorithm.


→ array[ScriptArea]

Gets the script areas that match the given name or if no name is given all areas are returned.


ScriptArea?

Gets the first script area by name or id.


edit_script_area(id, area)

Sets the given script area to the new values.


uint

Adds the given script area.


boolean

Removes the given script area.


→ array[ScriptPosition]

Gets the script positions that match the given name or if no name is given all positions are returned.


Gets the first script position by name or id.


Sets the given script position to the new values.


uint

Adds the given script position.


boolean

Removes the given script position.


string

Gets the map exchange string for the current map generation settings of this surface.


double

Gets the starting area radius of this surface.


get_closest(position, entities)
LuaEntity?

Gets the closest entity in the list to this position.


get_train_stops{name?=…, force?=…}
→ array[LuaEntity]

Gets train stops matching the given filters.


double

Gets the total amount of pollution on the surface by iterating over all of the chunks containing pollution.


entity_prototype_collides(prototype, position, use_map_generation_bounding_box, direction?)

decorative_prototype_collides(prototype, position)

calculate_tile_properties(property_names, positions)
→ dictionary[string → array[double]]

get_entities_with_force(position, force)
→ array[LuaEntity]

Returns all the military targets (entities with force) on this chunk for the given force.


Sets the given area to the checkerboard lab tiles.


help()
string

All methods and properties that this object supports.


:: string
[RW]

The name of this surface.


:: uint
[R]

Unique ID associated with this surface.


[RW]

The generation settings for this surface.


:: boolean
[RW]

When set to true, new chunks will be generated with lab tiles, instead of using the surface's map generation settings.


:: boolean
[RW]

When set to true, the sun will always shine.


:: double
[RW]

Current time of day, as a number in range [0, 1).


:: float
[R]

Amount of darkness at the current time, as a number in range [0, 1].


:: double
[RW]

Current wind speed.


[RW]

Current wind direction.


:: double
[RW]

Change in wind orientation per tick.


:: boolean
[RW]

Is peaceful mode enabled on this surface?


:: boolean
[RW]

True if daytime is currently frozen.


:: uint
[RW]

The number of ticks per day for this surface.


:: double
[RW]

The daytime when dusk starts.


:: double
[RW]

The daytime when dawn starts.


:: double
[RW]

The daytime when evening starts.


:: double
[RW]

The daytime when morning starts.


:: double
[RW]

The multiplier of solar power on this surface.


:: double
[RW]

The minimal brightness during the night.


[RW]

Defines how surface daytime brightness influences each color channel of the current color lookup table (LUT).


:: boolean
[RW]

If clouds are shown on this surface.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

reload()

Reload this technology from its prototype.


help()
string

All methods and properties that this object supports.


[R]

The force this technology belongs to.


:: string
[R]

Name of this technology.


[R]

Localised name of this technology.



[R]

The prototype of this technology.


:: boolean
[RW]

Can this technology be researched?


:: boolean
[RW]

If this technology will be visible in the research GUI even though it is disabled.


:: boolean
[R]

Is this an upgrade-type research?


:: boolean
[RW]

Has this technology been researched?


:: dictionary[stringLuaTechnology]
[R]

Prerequisites of this technology.


:: array[Ingredient]
[R]

The types of ingredients that labs will require to research this technology.


:: array[TechnologyModifier]
[R]

Effects applied when this technology is researched.


:: uint
[R]

The number of research units required for this technology.


:: double
[R]

Amount of energy required to finish a unit of research.


:: string
[R]

The string used to alphabetically sort these prototypes.


:: uint
[RW]

The current level of this technology.


:: string?
[R]

The count formula used for this infinite 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 technology.


[R]

Localised name of this technology.



:: boolean
[R]

If this technology prototype is enabled by default (enabled at the beginning of a game).


:: boolean
[R]

If this technology prototype is hidden.


:: boolean
[R]

If this technology will be visible in the research GUI even though it is disabled.


:: boolean
[R]

If this technology ignores the technology cost multiplier setting.


:: boolean
[R]

If the is technology prototype is an upgrade to some other technology.


:: dictionary[stringLuaTechnologyPrototype]
[R]

Prerequisites of this technology.


:: array[Ingredient]
[R]

The types of ingredients that labs will require to research this technology.


:: array[TechnologyModifier]
[R]

Effects applied when this technology is researched.


:: uint
[R]

The number of research units required for this technology.


:: double
[R]

Amount of energy required to finish a unit of research.


:: string
[R]

The string used to alphabetically sort these prototypes.


:: uint
[R]

The level of this research.


:: uint
[R]

The max level of this research.


:: string?
[R]

The count formula used for this infinite research.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaTile

collides_with(layer)
boolean

What type of things can collide with this tile?


boolean

Is this tile marked for deconstruction?


order_deconstruction(force, player?)
LuaEntity?

Orders deconstruction of this tile by the given force.


cancel_deconstruction(force, player?)

Cancels deconstruction if it is scheduled, does nothing otherwise.


has_tile_ghost(force?)
boolean

Does this tile have any tile ghosts on it.


get_tile_ghosts(force?)
→ array[LuaTile]

Gets all tile ghosts on this tile.


help()
string

All methods and properties that this object supports.


:: string
[R]

Prototype name of this tile.



[R]

The position this tile references.


:: string?
[R]

The name of the LuaTilePrototype hidden under this tile, if any.


[R]

The surface this tile is on.


:: 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]

The string used to alphabetically sort these prototypes.




[R]

The collision mask this tile uses



:: uint
[R]

[R]

Autoplace specification for this prototype, if any.




:: Color
[R]

:: float
[R]

The probability that decorative entities will be removed from on top of this tile when this tile is generated.



:: dictionary[stringLuaTilePrototype]
[R]

:: boolean
[R]

If this tile needs correction logic applied when it's generated in the world..


:: table
[R]

[R]

The next direction of this tile, if any.


:: array[SimpleItemStack]
[R]

Items that when placed will produce this tile.


:: boolean
[R]

False if this tile is not allowed in blueprints regardless of the ability to build it.


:: double
[R]

Amount of pollution emissions per second this tile will absorb.


:: boolean
[R]

True if building this tile should check for colliding entities above and prevent building if such are found.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaTrain

uint

Get the amount of a particular item stored in the train.


→ dictionary[stringuint]

Get a mapping of the train's inventory.


remove_item(stack)
uint

Remove some items from the train.


insert(stack)

Insert a stack into the train.


Clear all items in this train.


boolean

Checks if the path is invalid and tries to re-path if it isn't.


get_fluid_count(fluid?)
double

Get the amount of a particular fluid stored in the train.


→ dictionary[stringdouble]

Gets a mapping of the train's fluid inventory.


remove_fluid(fluid)
double

Remove some fluid from the train.


insert_fluid(fluid)
double

Inserts the given fluid into the first available location in this train.


Clears all fluids in this train.


go_to_station(index)

Go to the station specified by the index in the train's schedule.


→ array[LuaEntity]

Gets all rails under the train.


help()
string

All methods and properties that this object supports.


:: boolean
[RW]

When true, the train is explicitly controlled by the player or script.


:: double
[RW]

Current speed.


:: double
[R]

Current max speed when moving forward, depends on locomotive prototype and fuel.


:: double
[R]

Current max speed when moving backwards, depends on locomotive prototype and fuel.


:: double
[R]

The weight of this train.


:: array[LuaEntity]
[R]

The rolling stocks this train is composed of, with the numbering starting at the front of the train.


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

Arrays of locomotives.


:: array[LuaEntity]
[R]

The cargo carriages the train contains.


:: array[LuaEntity]
[R]

The fluid carriages the train contains.


[RW]

This train's current schedule, if any.


[R]

This train's current state.


:: LuaEntity?
[R]

The rail at the front end of the train, if any.


:: LuaEntity?
[R]

The rail at the back end of the train, if any.




:: LuaEntity?
[R]

The front stock of this train, if any.


:: LuaEntity?
[R]

The back stock of this train, if any.


:: LuaEntity?
[R]

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


:: boolean
[R]

If this train has a path.


:: LuaEntity?
[R]

The destination rail this train is currently pathing to, if any.


:: LuaEntity?
[R]

The destination train stop this train is currently pathing to, if any.


id
:: uint
[R]

The unique train ID.


:: array[LuaPlayer]
[R]

The player passengers on the train


[R]

The riding state of this train.


:: dictionary[uintuint]
[R]

The players killed by this train.


:: uint
[R]

The total number of kills by this train.


[R]

The path this train is using, if any.


:: LuaEntity?
[R]

The signal this train is arriving or waiting at, if any.


:: 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
[RW]

true if the train stop should send the circuit network contents to the train to use.


:: boolean
[RW]

true if the train stop should send the train contents to the circuit network.


:: boolean
[RW]

true if the train stop should send the stopped train id to the circuit network.


:: boolean
[RW]

true if the trains_limit_signal is used to set a limit of trains incoming for train stop.


:: boolean
[RW]

true if the train stop should send amount of incoming trains to the circuit network.


:: boolean
[RW]

true if the train stop is enabled/disabled through the circuit network.


[RW]

The signal that will be sent when using the send-train-id option.


[RW]

The signal that will be sent when using the read-trains-count option.


[RW]

The signal to be used by set-trains-limit to limit amount of incoming trains


:: 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
[RW]

If the belt will be enabled/disabled based off the circuit network.


:: boolean
[RW]

If the belt will read the contents and send them to the circuit network.



:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.



clear()

Remove all items from this transport line.


uint

Count some or all items on this line, similar to how LuaInventory::get_item_count does.


remove_item(items)
uint

Remove some items from this line.


can_insert_at(position)
boolean

Can an item be inserted at a given position?


boolean

Can an item be inserted at the back of this line?


insert_at(position, items)
boolean

Insert items at a given position.


boolean

Insert items at the back of this line.


→ dictionary[stringuint]

Get counts of all items on this line, similar to how LuaInventory::get_contents does.


line_equals(other)
boolean

Returns whether the associated internal transport line of this line is the same as the others associated internal transport line.


help()
string

All methods and properties that this object supports.


[R]

The entity this transport line belongs to.


:: array[LuaTransportLine]
[R]

The transport lines that this transport line outputs items to or an empty table if none.


:: array[LuaTransportLine]
[R]

The transport lines that this transport line is fed by or an empty table if none.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


:: uint
[R]

Get the number of items on this transport line.


[R]

The indexing operator.

help()
string

All methods and properties that this object supports.


:: string
[R]

Name of this prototype.


:: string
[R]

The string used to alphabetically sort these prototypes.




:: Color
[R]


:: double
[R]


:: uint
[R]





:: boolean
[R]





:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Class LuaUnitGroup

add_member(unit)

Make a unit a member of this group.


set_command(command)

Give this group a command.


Give this group a distraction command.


Make this group autonomous.


Make the group start moving even if some of its members haven't yet arrived.


Dissolve this group.


help()
string

All methods and properties that this object supports.


:: array[LuaEntity]
[R]

Members of this group.


[R]

Group position.


[R]

Whether this group is gathering, moving or attacking.


[R]

The force of this unit group.


[R]

The surface of this unit group.


:: uint
[R]

The group number for this unit group.


:: boolean
[R]

Whether this unit group is controlled by a script or by the game engine.


:: Command?
[R]

The command given to this group, if any.


:: Command?
[R]

The distraction command given to this group, if any.


:: 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]

The string used to alphabetically sort these prototypes.




:: boolean
[R]

If this is a special signal



:: 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]



:: 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 circuit condition.


:: boolean
[RW]



:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.


|<

Classes

Events

Concepts

Defines

Builtin types

>|