Classes

This is a list of all Lua classes defined by Factorio.

LuaAISettings Collection of settings for overriding default ai behavior.
LuaAccumulatorControlBehavior Control behavior for accumulators.
LuaAchievementPrototype Prototype of a achievement.
LuaAmmoCategoryPrototype Prototype of a ammo category.
LuaArithmeticCombinatorControlBehavior Control behavior for arithmetic combinators.
LuaAutoplaceControlPrototype Prototype of an autoplace control.
LuaBootstrap Entry point for registering event handlers.
LuaBurner A reference to the burner energy source owned by a specific LuaEntity or LuaEquipment.
LuaBurnerPrototype Prototype of a burner energy source.
LuaChunkIterator A chunk iterator can be used for iterating chunks coordinates of a surface.
LuaCircuitNetwork A circuit network associated with a given entity, connector, and wire type.
LuaCombinatorControlBehavior
LuaCommandProcessor Custom game 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 character entities (see LuaEntity).
LuaControlBehavior The control behavior for an entity.
LuaCustomChartTag A custom tag that shows on the map view.
LuaCustomInputPrototype Prototype of a custom input.
LuaCustomTable Lazily evaluated table.
LuaDamagePrototype Prototype of a damage.
LuaDeciderCombinatorControlBehavior Control behavior for decider combinators.
LuaDecorativePrototype Prototype of an optimized decorative.
LuaElectricEnergySourcePrototype Prototype of an electric energy source.
LuaEntity The primary interface for interacting with entities through the Lua API.
LuaEntityPrototype Prototype of an entity.
LuaEquipment An item in a LuaEquipmentGrid, for example one's power armor.
LuaEquipmentCategoryPrototype Prototype of a 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.
LuaFluidPrototype Prototype of a fluid.
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 the custom GUI.
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.
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.
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 Runtime settings can be changed through console commands and by the mod that owns the settings.
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.
LuaWallControlBehavior Control behavior for walls.
class LuaAISettings - sort
allow_destroy_when_commands_fail :: boolean [RW] If enabled, units that repeatedly fail to succeed at commands will be destroyed.
allow_try_return_to_spawner :: boolean [RW] If enabled, units that have nothing else to do will attempt to return to a spawner.
do_separation :: boolean [RW] If enabled, units will try to separate themselves from nearby friendly units.
path_resolution_modifier :: int8 [RW] The pathing resolution modifier, must be between -8 and 8.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaAchievementPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
allowed_without_fight :: boolean [R]
hidden :: boolean [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaAmmoCategoryPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
bonus_gui_order :: string [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaAutoplaceControlPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
richness :: boolean [R]
control_order :: string [R]
category :: string [R] Category name of this prototype.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaBootstrap - sort
on_init(f) Register a callback to be run on mod init.
on_load(f) Register a function to be run on module load.
on_configuration_changed(f) Register a function to be run when mod configuration changes.
on_event(event, f) Register a handler to run on event or events.
on_nth_tick(tick, f) Register a handler to run on nth tick(s).
generate_event_name() → uint Generate a new, unique event ID.
get_event_handler(event) Find the event handler for an event.
raise_event(event, table) Raise an event.
get_event_order() Gets the mod event order.
mod_name :: string [R] The name of the mod from the environment this is used in.
class LuaBurner - sort
owner :: LuaEntity or LuaEquipment [R] The owner of this burner energy source
inventory :: LuaInventory [R] The fuel inventory.
burnt_result_inventory :: LuaInventory [R] The burnt result inventory.
heat :: double [RW]
heat_capacity :: double [R]
remaining_burning_fuel :: double [RW]
currently_burning :: LuaItemPrototype [RW]
fuel_categories :: dictionary stringboolean [R] The fuel categories this burner uses.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaBurnerPrototype - sort
emissions :: double [R]
render_no_network_icon :: boolean [R]
render_no_power_icon :: boolean [R]
effectivity :: double [R]
fuel_inventory_size :: uint [R]
burnt_inventory_size :: uint [R]
smoke :: array of table [R] The smoke sources for this burner prototype if any.
light_flicker :: table [R] The light flicker definition for this burner prototype if any.
fuel_categories :: dictionary stringboolean [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaChunkIterator - sort
operator ()() → ChunkPosition Get the next chunk position or nil, and increments the iterator.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaCircuitNetwork - sort
get_signal(signal) → int
entity :: LuaEntity [R] The entity this circuit network reference is associated with
wire_type :: defines.wire_type [R] The wire type this network is associated with.
circuit_connector_id :: defines.circuit_connector_id [R] The circuit connector ID on the associated entity this network was gotten from.
signals :: array of Signal [R] The circuit network signals last tick.
network_id :: uint [R] The circuit networks ID.
connected_circuit_count :: uint [R] The number of circuits connected to this network.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaCommandProcessor - sort
add_command(name, help, function) Add a command.
remove_command(string) → boolean Removes a registered command
commands :: dictionary stringLocalisedString [R] Commands registered by scripts through LuaCommandProcessor.
game_commands :: dictionary stringLocalisedString [R] Builtin commands of the core game.
class LuaControl - sort
get_inventory(inventory) → LuaInventory Get an inventory belonging to this entity.
get_main_inventory() → LuaInventory 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.
clear_gui_arrow() Removes the arrow created by set_gui_arrow.
get_item_count(item) → uint Get the number of all or some items in this entity.
has_items_inside() → boolean Does this entity have any item inside it?
can_reach_entity(entity) → boolean Can a given entity be opened or accessed?
clear_items_inside() 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.
update_selected_entity(position) Select an entity, as if by hovering the mouse above it.
clear_selected_entity() Unselect any selected entity.
disable_flashlight() Disable the flashlight.
enable_flashlight() Enable the flashlight.
get_craftable_count(recipe) → 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(options) 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.
is_player() → 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.
surface :: LuaSurface [R] The surface this entity is currently on.
position :: Position [R] Current position of the entity.
vehicle :: LuaEntity [R] The vehicle the player is currently sitting in; nil if none.
force :: ForceSpecification [RW] The force of this entity.
selected :: LuaEntity [RW] The currently selected entity; nil if none.
opened :: LuaEntity or LuaItemStack or LuaEquipment or LuaEquipmentGrid or LuaPlayer or LuaGuiElement or defines.gui_type [RW] The GUI target the player currently has open; nil if none.
crafting_queue_size :: uint [R] Size of the crafting queue.
walking_state :: table [RW] Current walking state.
riding_state :: RidingState [RW] Current riding state of this car or the vehicle this player is riding in.
mining_state :: table [RW] Current mining state.
shooting_state :: table [RW] Current shooting state.
picking_state :: boolean [RW] Current item-picking state.
repair_state :: table [RW] Current repair state.
cursor_stack :: LuaItemStack [R] The player's cursor stack, or nil if the player controller is a spectator.
cursor_ghost :: ItemPrototypeSpecification [RW] The ghost prototype in the player's cursor.
driving :: boolean [RW] true if the player is in a vehicle.
crafting_queue :: array of CraftingQueueItem [R] Gets the current crafting queue items.
following_robots :: array of LuaEntity [R] The current combat robots following the character
cheat_mode :: boolean [RW] When true hand crafting is free and instant
character_crafting_speed_modifier :: double [RW]
character_mining_speed_modifier :: double [RW]
character_additional_mining_categories :: array of string [RW]
character_running_speed_modifier :: double [RW]
character_build_distance_bonus :: uint [RW]
character_item_drop_distance_bonus :: uint [RW]
character_reach_distance_bonus :: uint [RW]
character_resource_reach_distance_bonus :: uint [RW]
character_item_pickup_distance_bonus :: uint [RW]
character_loot_pickup_distance_bonus :: uint [RW]
character_inventory_slots_bonus :: uint [RW]
character_logistic_slot_count_bonus :: uint [RW]
character_trash_slot_count_bonus :: uint [RW]
character_maximum_following_robot_count_bonus :: uint [RW]
character_health_bonus :: float [RW]
auto_trash_filters :: dictionary stringuint [RW] The auto-trash filters.
opened_gui_type :: defines.gui_type [R] Returns the defines.gui_type or nil.
build_distance :: uint [R] The build distance of this character or max uint when not a character or player connected to a character.
drop_item_distance :: uint [R] The item drop distance of this character or max uint when not a character or player connected to a character.
reach_distance :: uint [R] The reach distance of this character or max uint when not a character or player connected to a character.
item_pickup_distance :: double [R] The item pickup distance of this character or max double when not a character or player connected to a character.
loot_pickup_distance :: double [R] The loot pickup distance of this character or max double when not a character or player connected to a character.
resource_reach_distance :: double [R] The resource reach distance of this character or max double when not a character or player connected to a character.
in_combat :: boolean [R] If this character entity is in combat.
character_running_speed :: double [R] Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
character_mining_progress :: double [R] Gets the current mining progress between 0 and 1 of this character, or 0 if they aren't mining.
class LuaControlBehavior - sort
get_circuit_network(wire, circuit_connector) → LuaCircuitNetwork
type :: defines.control_behavior.type [R] The concrete type of this control behavior.
entity :: LuaEntity [R] The entity this control behavior belongs to.
class LuaAccumulatorControlBehavior extends LuaControlBehavior - sort
output_signal :: SignalID [RW]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaCombinatorControlBehavior extends LuaControlBehavior - sort
get_signal_last_tick(signal) → int Gets the value of a specific signal sent by this combinator behavior last tick or nil if the signal didn't exist.
signals_last_tick :: array of Signal [R] The circuit network signals sent by this combinator last tick.
class LuaConstantCombinatorControlBehavior extends LuaControlBehavior - sort
set_signal(index, signal) Sets the signal at the given index
get_signal(index) → Signal Gets the signal at the given index.
parameters :: ConstantCombinatorParameters [RW] The constant combinator parameters
enabled :: boolean [RW] Turns this constant combinator on and off.
signals_count :: uint [R] The number of signals this constant combinator supports
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaContainerControlBehavior extends LuaControlBehavior - sort
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaGenericOnOffControlBehavior extends LuaControlBehavior - sort
disabled :: boolean [R] If the entity is currently disabled because of the control behavior.
circuit_condition :: CircuitConditionSpecification [RW] The circuit condition.
logistic_condition :: CircuitConditionSpecification [RW] The logistic condition.
connect_to_logistic_network :: boolean [RW] true if this should connect to the logistic network.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaLogisticContainerControlBehavior extends LuaControlBehavior - sort
circuit_mode_of_operation :: defines.control_behavior.logistic_container.circuit_mode_of_operation [RW] The circuit mode of operations for the logistic container.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaProgrammableSpeakerControlBehavior extends LuaControlBehavior - sort
circuit_parameters :: ProgrammableSpeakerCircuitParameters [RW]
circuit_condition :: CircuitConditionSpecification [RW]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRailChainSignalControlBehavior extends LuaControlBehavior - sort
red_signal :: SignalID [RW]
orange_signal :: SignalID [RW]
green_signal :: SignalID [RW]
blue_signal :: SignalID [RW]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRailSignalControlBehavior extends LuaControlBehavior - sort
red_signal :: SignalID [RW]
orange_signal :: SignalID [RW]
green_signal :: SignalID [RW]
close_signal :: boolean [RW] If this will close the rail signal based off the circuit condition.
read_signal :: boolean [RW] If this will read the rail signal state.
circuit_condition :: CircuitConditionSpecification [RW] The circuit condition when controlling the signal through the circuit network.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRoboportControlBehavior extends LuaControlBehavior - sort
mode_of_operations :: defines.control_behavior.roboport.circuit_mode_of_operation [RW]
available_logistic_output_signal :: SignalID [RW]
total_logistic_output_signal :: SignalID [RW]
available_construction_output_signal :: SignalID [RW]
total_construction_output_signal :: SignalID [RW]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaStorageTankControlBehavior extends LuaControlBehavior - sort
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaWallControlBehavior extends LuaControlBehavior - sort
circuit_condition :: CircuitConditionSpecification [RW] The circuit condition.
open_gate :: boolean [RW]
read_sensor :: boolean [RW]
output_signal :: SignalID [RW]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaArithmeticCombinatorControlBehavior extends LuaCombinatorControlBehavior - sort
parameters :: ArithmeticCombinatorParameters [RW] The arithmetic combinator parameters.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaDeciderCombinatorControlBehavior extends LuaCombinatorControlBehavior - sort
parameters :: DeciderCombinatorParameters [RW] The decider combinator parameters
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaInserterControlBehavior extends LuaGenericOnOffControlBehavior - sort
circuit_read_hand_contents :: boolean [RW] true if the contents of the inserter hand should be sent to the circuit network
circuit_mode_of_operation :: defines.control_behavior.inserter.circuit_mode_of_operation [RW] The circuit mode of operations for the inserter.
circuit_hand_read_mode :: defines.control_behavior.inserter.hand_read_mode [RW] The hand read mode for the inserter.
circuit_set_stack_size :: boolean [RW] If the stack size of the inserter is set through the circuit network or not.
circuit_stack_control_signal :: SignalID [RW] The signal used to set the stack size of the inserter.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaLampControlBehavior extends LuaGenericOnOffControlBehavior - sort
use_colors :: boolean [RW] true if the lamp should set the color from the circuit network signals.
color :: Color [R] The color the lamp is showing or nil if not using any color.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaMiningDrillControlBehavior extends LuaGenericOnOffControlBehavior - sort
circuit_enable_disable :: boolean [RW] true if this drill is enabled or disabled using the logistics or circuit condition.
circuit_read_resources :: boolean [RW] true if this drill should send the resources in the field to the circuit network.
resource_read_mode :: defines.control_behavior.mining_drill.resource_read_mode [RW] If the mining drill should send just the resources in its area or the entire field it's on to the circuit network.
resource_read_targets :: array of LuaEntity [R] The resource entities that the mining drill will send information about to the circuit network or an empty array.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTrainStopControlBehavior extends LuaGenericOnOffControlBehavior - sort
send_to_train :: boolean [RW] true if the train stop should send the circuit network contents to the train to use.
read_from_train :: boolean [RW] true if the train stop should send the train contents to the circuit network.
read_stopped_train :: boolean [RW] true if the train stop should send the stopped train id to the circuit network.
enable_disable :: boolean [RW] true if the train stop is enabled/disabled through the circuit network.
stopped_train_signal :: SignalID [RW] The signal that will be sent when using the send-train-id option.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTransportBeltControlBehavior extends LuaGenericOnOffControlBehavior - sort
enable_disable :: boolean [RW] If the belt will be enabled/disabled based off the circuit network.
read_contents :: boolean [RW] If the belt will read the contents and send them to the circuit network.
read_contents_mode :: defines.control_behavior.transport_belt.content_read_mode [RW] The read mode for the belt.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaCustomChartTag - sort
destroy() Destroys this tag.
icon :: SignalID [RW]
last_user :: LuaPlayer [RW] The player who last edited this tag.
position :: Position [R] The position of this tag.
text :: string [RW]
tag_number :: uint [R] The unique ID for this tag on this force.
force :: LuaForce [R] The force this tag belongs to.
surface :: LuaSurface [R] The surface this tag belongs to.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaCustomInputPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
key_sequence :: string [R] The default key sequence for this custom input.
alternative_key_sequence :: string [R] The default alternative key sequence for this custom input.
linked_game_control :: string [R] The linked game control name or nil.
consuming :: string [R] The consuming type: "none" or "game-only".
enabled :: boolean [R] If this custom input is enabled.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaCustomTable - sort
operator [] [RW] Access an element of this custom table.
operator # :: uint [R] Number of elements in this table.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaDamagePrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
hidden :: boolean [R] Whether this damage type is hidden from entity tooltips.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaDecorativePrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
collision_box :: BoundingBox [R] The bounding box used for collision checking.
autoplace_specification :: AutoplaceSpecification [R] Autoplace specification for this decorative prototype.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaElectricEnergySourcePrototype - sort
buffer_capacity :: double [R]
usage_priority :: string [R]
input_flow_limit :: double [R]
output_flow_limit :: double [R]
drain :: double [R]
emissions :: double [R]
render_no_network_icon :: boolean [R]
render_no_power_icon :: boolean [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaEntity extends LuaControl - sort
get_output_inventory() → LuaInventory Gets the entities output inventory if it has one.
get_module_inventory() → LuaInventory
get_fuel_inventory() → LuaInventory The fuel inventory for this entity or nil if this entity doesn't have a fuel inventory.
get_burnt_result_inventory() → LuaInventory The burnt result inventory for this entity or nil if this entity doesn't have a burnt result inventory.
damage(damage, force, type) → float Damages the entity.
can_be_destroyed() → boolean Checks if the entity can be destroyed
destroy(opts) → boolean Destroys the entity.
set_command(command) Give the entity a command.
has_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 flag set.
ghost_has_flag(flag) → boolean Same as LuaEntity::has_flag but targets the inner entity on a entity ghost.
add_market_item(offer) Offer a thing on the market.
remove_market_item(offer) → boolean Remove an offer from a market.
get_market_items() → array of Offer Get all offers in a market as an array.
clear_market_items() Removes all offers from a market.
connect_neighbour(target) → boolean Connect two devices with wire or cable.
disconnect_neighbour(target) Disconnect wires or cables.
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.
to_be_deconstructed(force) → boolean Is this entity marked for deconstruction?
order_upgrade{force=…, target=…, player=…} → boolean Sets the entity to be upgraded by construction robots.
cancel_upgrade(force, player) → boolean Cancels upgrade if it is scheduled, does nothing otherwise.
to_be_upgraded() → boolean Is this entity marked for upgrade?
get_request_slot(slot) → SimpleItemStack Get a logistic requester slot.
set_request_slot(request, slot) Set a logistic requester slot.
clear_request_slot(slot) Clear a logistic requester slot.
is_crafting() → boolean
is_opened() → boolean
is_opening() → boolean
is_closed() → boolean
is_closing() → boolean
request_to_open(force, extra_time)
request_to_close(force)
get_transport_line(index) → LuaTransportLine Get a transport line of a belt or belt connectable entity.
get_max_transport_line_index() → uint Get the maximum transport line index of a belt or belt connectable entity.
launch_rocket() → boolean
revive(opts) → dictionary stringuint Revive a ghost.
silent_revive(opts) → dictionary stringuint Revives a ghost silently.
get_connected_rail{rail_direction=…, rail_connection_direction=…} → LuaEntity
get_connected_rails() → array of LuaEntity Get the rails that this signal is connected to.
get_rail_segment_entity(direction, in_else_out) → LuaEntity Get the rail signal or train stop at the start/end of the rail segment this rail is in, or nil if the rail segment doesn't start/end with a signal nor a train stop.
get_rail_segment_end(direction) → LuaEntity Get the rail at the end of the rail segment this rail is in.
get_rail_segment_length() → double Get the length of the rail segment this rail is in.
get_rail_segment_overlaps() → array of LuaEntity Get a rail from each rail segment that overlaps with this rail's rail segment.
get_filter(uint) → string Get the filter for a slot in an inserter or a loader.
set_filter(uint, string) Set the filter for a slot in an inserter or a loader
get_infinity_container_filter(index) → InfinityContainerFilter Gets the filter for this infinity container at the given index or nil if the filter index doesn't exist or is empty.
set_infinity_container_filter(index, filter) Sets the filter for this infinity container at the given index.
get_infinity_pipe_filter() → InfinityPipeFilter Gets the filter for this infinity pipe or nil if the filter is empty.
set_infinity_pipe_filter(filter) Sets the filter for this infinity pipe.
get_heat_setting() → HeatSetting Gets the heat setting for this heat interface.
set_heat_setting(filter) Sets the heat setting for this heat interface.
get_control_behavior() → LuaControlBehavior Gets the control behavior of the entity (if any).
get_or_create_control_behavior() → LuaControlBehavior Gets (and or creates if needed) the control behavior of the entity.
get_circuit_network(wire, circuit_connector) → LuaCircuitNetwork
get_merged_signals(circuit_connector) → array of Signal The merged circuit network signals or nil if there are no signals.
supports_backer_name() → boolean
copy_settings(entity) → dictionary stringuint Copies settings from the given entity onto this entity.
get_logistic_point(defines.logistic_member_index) → LuaLogisticPoint or array of LuaLogisticPoint Gets the LuaLogisticPoint specified by the given index or if not given returns all of the points this entity owns.
play_note(instrument, note) → boolean Plays a note with the given instrument and note.
connect_rolling_stock(direction) → boolean Connects the rolling stock in the given direction.
disconnect_rolling_stock(direction) → boolean Tries to disconnect this rolling stock in the given direction.
update_connections() Reconnect loader, beacon, cliff and mining drill connections to entities that might have been teleported out or in by the script.
get_recipe() → 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(options) → boolean Rotates this entity as if the player rotated it
get_driver() → LuaEntity or LuaPlayer Gets the driver of this vehicle if any.
set_driver(driver) Sets the driver of this vehicle.
get_passenger() → LuaEntity or LuaPlayer Gets the passenger of this car if any.
set_passenger(passenger) Sets the passenger of this car.
is_connected_to_electric_network() → boolean Returns true if this entity is connected to an electric network.
get_train_stop_trains() → array of LuaTrain The trains scheduled to stop at this train stop.
get_stopped_train() → LuaTrain The train currently stopped at this train stop or nil if none.
clone{position=…, surface=…, force=…} → LuaEntity Clones this entity.
get_fluid_count(fluid) → double Get the amount of all or some fluid in this entity.
get_fluid_contents() → 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.
clear_fluid_inside() Remove all fluids from this entity.
get_beam_source() → BeamTarget Get the source of this beam.
set_beam_source(source) Set the source of this beam.
get_beam_target() → BeamTarget Get the target of this beam.
set_beam_target(target) Set the target of this beam.
get_radius() → double The radius of this entity.
get_health_ratio() → float The health ratio of this entity between 1 and 0 (for full health and no health respectively).
create_build_effect_smoke() Creates the same smoke that is created when you place a building by hand.
release_from_spawner() Release the unit from the spawner which spawned it.
toggle_equipment_movement_bonus() Toggle this entity's equipment movement bonus.
can_shoot(target, position) → boolean If this character can shoot the given entity or position.
start_fading_out() Only works if the entity is a speech-bubble, with an "effect" defined in its wrapper_flow_style.
name :: string [R] Name of the entity prototype.
ghost_name :: string [R] Name of the entity or tile contained in this ghost
localised_name :: LocalisedString [R] Localised name of the entity.
localised_description :: LocalisedString [R]
ghost_localised_name :: LocalisedString [R] Localised name of the entity or tile contained in this ghost.
ghost_localised_description :: LocalisedString [R]
type :: string [R] The entity prototype type of this entity.
ghost_type :: string [R] The prototype type of the entity or tile contained in this ghost.
active :: boolean [RW] Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will stop moving etc).
destructible :: boolean [RW] When the entity is not destructible it can't be damaged.
minable :: boolean [RW]
rotatable :: boolean [RW] When entity is not to be rotatable (inserter, transport belt etc), it can't be rotated by player using the R key.
operable :: 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.
health :: float [RW] Health of the entity.
direction :: defines.direction [RW] The current direction this entity is facing.
supports_direction :: boolean [R] Whether the entity has direction.
orientation :: float [RW] The smooth orientation.
cliff_orientation :: string [R] The orientation of this cliff.
amount :: uint [RW] Count of resource units contained.
initial_amount :: uint [RW] Count of initial resource units contained.
effectivity_modifier :: float [RW] Multiplies the acceleration the vehicle can create for one unit of energy.
consumption_modifier :: float [RW] Multiplies the energy consumption.
friction_modifier :: float [RW] Multiplies the car friction rate.
speed :: float [RW] The current speed of the car or rolling stock, or current max speed of the unit.
stack :: LuaItemStack [R]
prototype :: LuaEntityPrototype [R] The entity prototype of this entity.
ghost_prototype :: LuaEntityPrototype or LuaTilePrototype [R] The prototype of the entity or tile contained in this ghost.
drop_position :: Position [RW] Position where the entity puts its stuff.
pickup_position :: Position [RW] Where the inserter will pick up items from.
drop_target :: LuaEntity [RW] The entity this entity is putting its stuff to or nil if there is no such entity.
pickup_target :: LuaEntity [RW] The entity the inserter will attempt to pick up from.
selected_gun_index :: uint [RW] Index of the currently selected weapon slot of this character or car, or nil if the car doesn't have guns.
energy :: double [RW] Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.
temperature :: double [RW] The temperature of this entities heat energy source if this entity uses a heat energy source or nil.
previous_recipe :: LuaRecipe [R] The previous recipe this furnace was using or nil if the furnace had no previous recipe.
held_stack :: LuaItemStack [R] The item stack currently held in an inserter's hand.
held_stack_position :: Position [R] Current position of the inserter's "hand".
train :: LuaTrain [R] The train this rolling stock belongs to or nil if not rolling stock.
neighbours :: dictionary stringarray of LuaEntity or array of array of LuaEntity or LuaEntity [R]
belt_neighbours :: dictionary stringarray of LuaEntity [R] The belt connectable neighbours of this belt connectable entity.
fluidbox :: LuaFluidBox [RW] Fluidboxes of this entity.
backer_name :: string [RW] The name of a backer (of Factorio) assigned to a lab or train station / stop.
time_to_live :: uint [RW] The ticks left before a ghost, combat robot or highlight box is destroyed.
color :: Color [RW] The character, rolling stock, train stop, flying text, or simple-entity-with-owner color.
text :: LocalisedString [RW] The text of this flying-text entity.
signal_state :: defines.signal_state [R] The state of this rail signal.
chain_signal_state :: defines.chain_signal_state [R] The state of this chain signal.
to_be_looted :: boolean [RW] Will this entity be picked up automatically when the player walks over it?
crafting_speed :: double [R] The current crafting speed, including speed bonuses from modules and beacons.
crafting_progress :: float [RW] The current crafting progress, as a number in range [0, 1].
bonus_progress :: double [RW] The current productivity bonus progress, as a number in range [0, 1].
belt_to_ground_type :: string [R] "input" or "output", depending on whether this underground belt goes down or up.
loader_type :: string [RW] "input" or "output", depending on whether this loader puts to or gets from a container.
rocket_parts :: uint [RW] Number of rocket parts in the silo.
logistic_network :: LuaLogisticNetwork [R] The logistic network this entity is a part of.
logistic_cell :: LuaLogisticCell [R] The logistic cell this entity is a part of.
item_requests :: dictionary stringuint [RW] Items this ghost will request when revived or items this item request proxy is requesting.
player :: LuaPlayer [R] The player connected to this character or nil if none.
unit_group :: LuaUnitGroup [R] The unit group this unit is a member of, or nil if none.
damage_dealt :: double [RW] The damage dealt by this turret, artillery turret, or artillery wagon.
kills :: uint [RW] The number of units killed by this turret, artillery turret, or artillery wagon.
last_user :: LuaPlayer [RW] The player who built the entity
electric_buffer_size :: double [RW] The buffer size for the electric energy source or nil if the entity doesn't have an electric energy source.
electric_input_flow_limit :: double [R] The input flow limit for the electric energy source or nil if the entity doesn't have an electric energy source.
electric_output_flow_limit :: double [R] The output flow limit for the electric energy source or nil if the entity doesn't have an electric energy source.
electric_drain :: double [R] The electric drain for the electric energy source or nil if the entity doesn't have an electric energy source.
electric_emissions :: double [R] The emissions for the electric energy source or nil if the entity doesn't have an electric energy source.
unit_number :: uint [R] The unit number or nil if the entity doesn't have one.
ghost_unit_number :: uint [R] The unit number of the entity contained in this ghost or nil if the entity doesn't have one.
mining_progress :: double [RW] The mining progress for this mining drill or nil if this isn't a mining drill.
bonus_mining_progress :: double [RW] The bonus mining progress for this mining drill or nil if this isn't a mining drill.
power_production :: double [RW] The power production specific to the ElectricEnergyInterface entity type.
power_usage :: double [RW] The power usage specific to the ElectricEnergyInterface entity type.
bounding_box :: BoundingBox [R] LuaEntityPrototype::collision_box around entity's given position and respecting the current entity orientation.
secondary_bounding_box :: BoundingBox [R] The secondary bounding box of this entity or nil if it doesn't have one.
selection_box :: BoundingBox [R] LuaEntityPrototype::selection_box around entity's given position and respecting the current entity orientation.
secondary_selection_box :: BoundingBox [R] The secondary selection box of this entity or nil if it doesn't have one.
mining_target :: LuaEntity [R] The mining target or nil if none
circuit_connected_entities :: table [R] Entities connected to this entity via the circuit network.
circuit_connection_definitions :: array of CircuitConnectionDefinition [R] The connection definition for entities connected to this entity via the circuit network.
request_slot_count :: uint [R] The number of request slots this entity has.
filter_slot_count :: uint [R] The number of filter slots this inserter or loader has.
loader_container :: LuaEntity [R] The container entity this loader is pointing at/pulling from depending on the LuaEntity::loader_type.
grid :: LuaEquipmentGrid [R] The equipment grid or nil if this entity doesn't have an equipment grid.
graphics_variation :: uint8 [RW] The graphics variation for this entity or nil if this entity doesn't use graphics variations.
tree_color_index :: uint8 [RW] Index of the tree color.
tree_color_index_max :: uint8 [R] Maximum index of the tree colors.
tree_stage_index :: uint8 [RW] Index of the tree stage.
tree_stage_index_max :: uint8 [R] Maximum index of the tree stages.
burner :: LuaBurner [R] The burner energy source for this entity or nil if there isn't one.
shooting_target :: LuaEntity [RW] The shooting target for this turret or nil.
proxy_target :: LuaEntity [R] The target entity for this item-request-proxy or nil
stickers :: array of LuaEntity [R] The sticker entities attached to this entity.
sticked_to :: LuaEntity [R] The entity this sticker is sticked to.
parameters :: ProgrammableSpeakerParameters [RW]
alert_parameters :: ProgrammableSpeakerAlertParameters [RW]
electric_network_statistics :: LuaFlowStatistics [R] The electric network statistics for this electric pole.
inserter_stack_size_override :: uint [RW] Sets the stack size limit on this inserter.
products_finished :: uint [RW]
spawner :: LuaEntity [R] The spawner associated with this unit entity or nil if the unit has no associated spawner.
units :: array of LuaEntity [R] The units associated with this spawner entity.
power_switch_state :: boolean [RW] The state of this power switch.
relative_turret_orientation :: float [RW] The relative orientation of the vehicle turret or nil if this entity isn't a vehicle or have a vehicle turret.
effects :: Effects [R] The effects being applied to this entity or nil.
infinity_container_filters :: array of InfinityContainerFilter [RW] The filters for this infinity container.
remove_unfiltered_items :: boolean [RW] If items not included in this infinity container filters should be removed from the container.
character_corpse_player_index :: uint [RW] The player index associated with this character corpse.
character_corpse_tick_of_death :: uint [RW] The tick this character corpse died at.
character_corpse_death_cause :: LocalisedString [RW] The reason this character corpse character died (if any).
associated_player :: LuaPlayer [RW] The player this character is associated with or nil if none.
tick_of_last_attack :: uint [R] The last tick this character entity was attacked.
tick_of_last_damage :: uint [R] The last tick this character entity was damaged.
splitter_filter :: LuaItemPrototype [RW] The filter for this splitter or nil if no filter is set.
inserter_filter_mode :: string [RW] The filter mode for this filter inserter: "whitelist", "blacklist", or nil if this inserter doesn't use filters.
splitter_input_priority :: string [RW] The input priority for this splitter : "left", "none", or "right".
splitter_output_priority :: string [RW] The output priority for this splitter : "left", "none", or "right".
armed :: boolean [R] If this land mine is armed.
recipe_locked :: boolean [RW] When locked; the recipe in this assembling machine can't be changed by the player.
connected_rail :: LuaEntity [R] The rail entity this train stop is connected to or nil if there is none.
trains_in_block :: uint [R] The number of trains in this rail block for this rail entity.
timeout :: uint [RW] The timeout left on this landmine in ticks.
neighbour_bonus :: double [R] The current total neighbour bonus of this reactor.
ai_settings :: LuaAISettings [R] The ai settings of this unit.
highlight_box_type :: string [RW] The hightlight box type of this highlight box entity.
highlight_box_blink_interval :: uint [RW] The blink interval of this highlight box entity.
status :: defines.entity_status [R] The status of this entity or nil if no status.
enable_logistics_while_moving :: boolean [RW] If equipment grid logistics are enabled while this vehicle is moving.
render_player :: LuaPlayer [RW] The player that this simple-entity-with-owner, simple-entity-with-force, flying-text or highlight-box is visible to or nil.
render_to_forces :: array of ForceSpecification [RW] The forces that this simple-entity-with-owner, simple-entity-with-force or flying-text is visible to or nil.
pump_rail_target :: LuaEntity [R] The rail target of this pump or nil.
moving :: LuaEntity [R] Returns true if this unit is moving.
electric_network_id :: uint [R] Returns the id of the electric network that this entity is connected to or nil.
allow_dispatching_robots :: boolean [RW] Whether this character's personal roboports are allowed to dispatch robots.
auto_launch :: boolean [RW] Whether this rocket silo automatically launches the rocket when cargo is inserted.
energy_generated_last_tick :: double [R] How much energy this generator generated in the last tick.
storage_filter :: LuaItemPrototype [RW] The storage filter for this logistic storage container.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaEntityPrototype - sort
has_flag(flag) → boolean Does this prototype have a flag enabled?
get_inventory_size(index) → uint Gets the base size of the given inventory on this entity or nil if the given inventory doesn't exist.
type :: string [R] Type of this prototype.
name :: string [R] Name of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
max_health :: float [R] Max health of this entity.
infinite_resource :: boolean [R] Is this resource infinite?
minimum_resource_amount :: uint [R] Minimum amount of this resource.
normal_resource_amount :: uint [R] The normal amount for this resource.
infinite_depletion_resource_amount :: uint [R] Every time this infinite resource 'ticks' down it is reduced by this amount.
resource_category :: string [R] Category of this resource.
mineable_properties :: table [R] Whether this entity is minable and what can be obtained by mining it.
items_to_place_this :: array of SimpleItemStack [R] Items that when placed will produce this entity.
collision_box :: BoundingBox [R] The bounding box used for collision checking.
secondary_collision_box :: BoundingBox [R] The secondary bounding box used for collision checking, or nil if it doesn't have one.
map_generator_bounding_box :: BoundingBox [R] The bounding box used for map generator collision checking.
selection_box :: BoundingBox [R] The bounding box used for drawing selection.
drawing_box :: BoundingBox [R] The bounding box used for drawing the entity icon.
sticker_box :: BoundingBox [R] The bounding box used to attach sticker type entities.
collision_mask :: CollisionMask [R] The collision masks this entity uses
order :: string [R] Order string of this prototype.
group :: LuaGroup [R] Group of this entity.
subgroup :: LuaGroup [R] Subgroup of this entity.
healing_per_tick :: float [R] Amount this entity can heal per tick.
emissions_per_second :: double [R] Amount of pollution emissions per second this entity will create.
corpses :: dictionary stringLuaEntityPrototype [R] Corpses used when this entity is destroyed.
selectable_in_game :: boolean [R] Is this entity selectable?
selection_priority :: uint [R] The selection priority of this entity - a value between 0 and 255
weight :: double [R] The weight of this vehicle prototype or nil if not a vehicle prototype.
resistances :: Resistances [R]
fast_replaceable_group :: string [R] The group of mutually fast-replaceable entities.
next_upgrade :: LuaEntityPrototype [R] The next upgrade for this entity or nil.
loot :: Loot [R] Loot that will be dropped when this entity is killed.
repair_speed_modifier :: uint [R] Repair-speed modifier for this entity.
turret_range :: uint [R] The range of this turret or nil if this isn't a turret related prototype.
autoplace_specification :: AutoplaceSpecification [R] Autoplace specification for this entity prototype.
belt_speed :: double [R] The speed of this transport belt or nil if this isn't a transport belt related prototype.
result_units :: array of UnitSpawnDefinition [R] The result units and spawn points with weight and evolution factor for a biter spawner entity.
attack_result :: Trigger [R] The attack result of this entity if the entity has one, else nil.
final_attack_result :: Trigger [R] The final attack result for projectiles nil if not a projectile
attack_parameters :: table [R] The attack parameters for this entity or nil if the entity doesn't use attack parameters.
spawn_cooldown :: table [R] The spawning cooldown for this enemy spawner prototype or nil.
mining_drill_radius :: double [R] The mining radius of this mining drill prototype or nil if this isn't a mining drill prototype.
mining_speed :: double [R] The mining speed of this mining drill/character prototype or nil.
logistic_mode :: string [R] The logistic mode of this logistic container or nil if this isn't a logistic container prototype.
max_underground_distance :: uint [R] The max underground distance for underground belts and underground pipes or nil if this isn't one of those prototypes.
flags :: EntityPrototypeFlags [R] The entity prototype flags for this entity.
remains_when_mined :: array of LuaEntityPrototype [R] The remains left behind when this entity is mined.
additional_pastable_entities :: array of LuaEntityPrototype [R] Entities this entity can be pasted onto in addition to the normal allowed ones.
allow_copy_paste :: boolean [R] When false copy-paste is not allowed for this entity.
shooting_cursor_size :: double [R] The cursor size used when shooting at this entity.
created_smoke :: table [R] The smoke trigger run when this entity is built or nil.
created_effect :: Trigger [R] The trigger run when this entity is created or nil.
map_color :: Color [R] The map color used when charting this entity if a friendly or enemy color isn't defined or nil.
friendly_map_color :: Color [R] The friendly map color used when charting this entity.
enemy_map_color :: Color [R] The enemy map color used when charting this entity.
build_base_evolution_requirement :: double [R] The evolution requirement to build this entity as a base when expanding enemy bases.
instruments :: array of ProgrammableSpeakerInstrument [R] The instruments for this programmable speaker or nil.
max_polyphony :: uint [R] The maximum polyphony for this programmable speaker or nil.
module_inventory_size :: uint [R] The module inventory size or nil if this entity doesn't support modules.
ingredient_count :: uint [R] The max number of ingredients this crafting-machine prototype supports or nil if this isn't a crafting-machine prototype.
crafting_speed :: double [R] The crafting speed of this crafting-machine or nil.
crafting_categories :: dictionary stringboolean [R] The crafting categories this entity supports.
resource_categories :: dictionary stringboolean [R] The resource categories this mining drill supports or nil if not a mining dill.
supply_area_distance :: double [R] The supply area of this electric pole, beacon, or nil if this is neither.
max_wire_distance :: double [R] The maximum wire distance for this entity.
max_circuit_wire_distance :: double [R] The maximum circuit wire distance for this entity.
energy_usage :: double [R] The direct energy usage of this entity or nil if this entity doesn't have a direct energy usage.
max_energy_usage :: double [R] The theoretical maximum energy usage for this entity.
effectivity :: double [R] The effectivity of this car prototype, generator prototype or nil.
consumption :: double [R] The energy consumption of this car prototype or nil if not a car prototype.
friction_force :: double [R] The friction of this vehicle prototype or nil if not a vehicle prototype.
braking_force :: double [R] The braking force of this vehicle prototype or nil if not a vehicle prototype.
tank_driving :: boolean [R] If this car prototype uses tank controls to drive or nil if this is not a car prototype.
rotation_speed :: double [R] The rotation speed of this car prototype or nil if not a car prototype.
turret_rotation_speed :: double [R] The turret rotation speed of this car prototype or nil if not a car prototype.
guns :: dictionary stringLuaItemPrototype [R] The guns this car prototype uses or nil if not a car prototype.
speed :: double [R] The default speed of this flying robot, rolling stock, unit or nil.
speed_multiplier_when_out_of_energy :: float [R] The speed multiplier when this flying robot is out of energy or nil.
max_payload_size :: uint [R] The max payload size of this logistics or construction robot or nil.
draw_cargo :: boolean [R] Whether this logistics or construction robot renders its cargo when flying or nil.
energy_per_move :: double [R] The energy consumed per tile moved for this flying robot or nil.
energy_per_tick :: double [R] The energy consumed per tick for this flying robot or nil.
max_energy :: double [R] The max energy for this flying robot or nil.
min_to_charge :: float [R] The minimum energy for this flying robot before it tries to recharge or nil.
max_to_charge :: float [R] The maximum energy for this flying robot above which it won't try to recharge when stationing or nil.
burner_prototype :: LuaBurnerPrototype [R] The burner energy source prototype this entity uses or nil.
electric_energy_source_prototype :: LuaElectricEnergySourcePrototype [R] The electric energy source prototype this entity uses or nil.
building_grid_bit_shift :: uint [R] The log2 of grid size of the building
fluid_usage_per_tick :: double [R] The fluid usage of this generator prototype or nil.
maximum_temperature :: double [R] The maximum fluid temperature of this generator prototype or nil.
target_temperature :: double [R] The target temperature of this boiler prototype or nil.
fluid :: LuaFluidPrototype [R] The fluid this offshore pump produces or nil.
fluid_capacity :: double [R] The fluid capacity of this entity or 0 if this entity doesn't support fluids.
pumping_speed :: double [R] The pumping speed of this offshore pump, normal pump, or nil.
stack :: boolean [R] If this inserter is a stack-type.
allow_custom_vectors :: boolean [R] If this inserter allows custom pickup and drop vectors.
inserter_extension_speed :: double [R] The extension speed of this inserter or nil.
inserter_rotation_speed :: double [R] The rotation speed of this inserter or nil.
count_as_rock_for_filtered_deconstruction :: boolean [R] If this simple-entity is counted as a rock for the deconstruction planner "trees and rocks only" filter.
filter_count :: uint [R] The filter count of this inserter, loader, or requester chest or nil.
production :: double [R] The max production this solar panel prototype produces or nil.
time_to_live :: uint [R] The time to live for this prototype or 0 if prototype doesn't have time_to_live or time_before_removed.
distribution_effectivity :: double [R] The distribution effectivity for this beacon prototype or nil if not a beacon prototype.
explosion_beam :: double [R] Does this explosion have a beam or nil if not an explosion prototype.
explosion_rotate :: double [R] Does this explosion rotate or nil if not an explosion prototype.
tree_color_count :: uint8 [R] If it is a tree, return the number of colors it supports.
alert_when_damaged :: boolean [R] Does this entity with health prototype alert when damaged?
alert_when_attacking :: boolean [R] Does this turret prototype alert when attacking?
color :: Color [R] The color of the prototype, or nil if the prototype doesn't have color.
collision_mask_collides_with_self :: boolean [R] Does this prototype collision mask collide with itself?
collision_mask_collides_with_tiles_only :: boolean [R] Does this prototype collision mask collide with tiles only?
collision_mask_considers_tile_transitions :: boolean [R] Does this prototype collision mask consider tile transitions?
allowed_effects :: dictionary stringboolean [R] The allowed module effects for this entity or nil.
rocket_parts_required :: uint [R] The rocket parts required for this rocket silo prototype or nil.
fixed_recipe :: string [R] The fixed recipe name for this assembling machine prototype or nil.
construction_radius :: double [R] The construction radius for this roboport prototype or nil.
logistic_radius :: double [R] The logistic radius for this roboport prototype or nil.
energy_per_hit_point :: double [R] The energy used per hitpoint taken for this vehicle during collisions or nil.
create_ghost_on_death :: boolean [R] If this prototype will attempt to create a ghost of itself on death.
timeout :: uint [R] The time it takes this land mine to arm.
fluidbox_prototypes :: array of LuaFluidBoxPrototype [R] The fluidbox prototypes for this entity.
neighbour_bonus :: double [R]
neighbour_collision_increase :: double [R] Controls how much a reactor extends when connected to other reactors.
container_distance :: double [R]
belt_distance :: double [R]
belt_length :: double [R]
is_building :: boolean [R]
automated_ammo_count :: uint [R] The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret or nil.
max_speed :: double [R] The max speed of this Projectile prototype or nil.
darkness_for_all_lamps_on :: float [R] Value between 0 and 1 darkness where all lamps of this lamp prototype are on or nil.
darkness_for_all_lamps_off :: float [R] Value between 0 and 1 darkness where all lamps of this lamp prototype are off or nil.
always_on :: boolean [R] Whether the lamp is always on (except when out of power or turned off by the circuit network) or nil.
min_darkness_to_spawn :: float [R] The minimum darkness at which this unit spawner can spawn entities.
max_darkness_to_spawn :: float [R] The maximum darkness at which this unit spawner can spawn entities.
radius :: double [R] The radius of this entity prototype.
cliff_explosive_prototype :: string [R] The item prototype name used to destroy this cliff or nil.
has_belt_immunity :: boolean [R] Whether this unit or car prototype has belt immunity, nil if not car or unit prototype.
vision_distance :: double [R] The vision distance of this unit prototype or nil.
pollution_to_join_attack :: 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.
min_pursue_time :: uint [R] The minimum pursue time of this unit prototype or nil.
max_pursue_distance :: double [R] The maximum pursue distance of this unit prototype or nil.
radar_range :: uint [R] The radar range of this unit prototype or nil.
move_while_shooting :: boolean [R] Whether this unit prototype can move while shooting or nil.
can_open_gates :: boolean [R] Whether this unit prototype can open gates or nil.
affected_by_tiles :: boolean [R] Whether this unit prototype is affected by tile walking speed modifiers or nil.
distraction_cooldown :: uint [R] The distraction cooldown of this unit prototype or nil.
spawning_time_modifier :: double [R] The spawning time modifier of this unit prototype or nil.
alert_icon_shift :: Vector [R] The alert icon shift of this entity prototype.
lab_inputs :: array of string [R] The item prototype names that are the inputs of this lab prototype or nil.
researching_speed :: double [R] The base researching speed of this lab prototype or nil.
item_slot_count :: uint [R] The item slot count of this constant combinator prototype or nil.
base_productivity :: double [R] The base productivity of this crafting machine, lab, or mining drill, or nil.
allow_access_to_all_forces :: boolean [R] If this market allows access to all forces or just friendly ones.
supports_direction :: boolean [R] If this entity prototype could possibly ever be rotated.
running_speed :: double [R]
maximum_corner_sliding_distance :: double [R]
build_distance :: uint [R]
drop_item_distance :: uint [R]
reach_distance :: uint [R]
reach_resource_distance :: double [R]
item_pickup_distance :: double [R]
loot_pickup_distance :: double [R]
enter_vehicle_distance :: double [R]
ticks_to_keep_gun :: uint [R]
ticks_to_keep_aiming_direction :: uint [R]
ticks_to_stay_in_combat :: uint [R]
respawn_time :: uint [R]
damage_hit_tint :: Color [R]
character_corpse :: LuaEntityPrototype [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaEquipment - sort
name :: string [R] Name of this equipment.
type :: string [R] Type of this equipment.
position :: Position [R] Position of this equipment in the equipment grid.
shape :: table [R] Shape of this equipment.
shield :: double [RW] Current shield value of the equipment.
max_shield :: double [R] Maximum shield value.
max_solar_power :: double [R] Maximum solar power generated.
movement_bonus :: double [R] Movement speed bonus.
generator_power :: double [R] Energy generated per tick.
energy :: double [RW] Current available energy.
max_energy :: double [R] Maximum amount of energy that can be stored in this equipment.
prototype :: LuaEquipmentPrototype [R]
burner :: LuaBurner [R] The burner energy source for this equipment or nil if there isn't one.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaEquipmentCategoryPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaEquipmentGrid - sort
take{position=…, equipment=…} → SimpleItemStack Remove an equipment from the grid.
take_all() → dictionary stringuint Remove all equipment from the grid.
clear() Clear all equipment from the grid.
put{name=…, position=…} → LuaEquipment 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) → LuaEquipment Find equipment in the Equipment Grid based off a position.
get_contents() → dictionary stringuint Get counts of all equipment in this grid.
prototype :: LuaEquipmentGridPrototype [R]
width :: uint [R] Width of the equipment grid.
height :: uint [R] Height of the equipment grid.
equipment :: array of LuaEquipment [R] All the equipment in this grid.
generator_energy :: double [R] Total energy per tick generated by the equipment inside this grid.
max_solar_energy :: double [R] Maximum energy per tick that can be created by any solar panels in the equipment grid.
available_in_batteries :: double [R] The total energy stored in all batteries in the equipment grid.
battery_capacity :: double [R] Total energy storage capacity of all batteries in the equipment grid.
shield :: float [R] The amount of shields this equipment grid has.
max_shield :: float [R] The maximum amount of shields this equipment grid has.
inhibit_movement_bonus :: boolean [RW] True if this movement bonus equipment is turned off, otherwise false.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaEquipmentGridPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
equipment_categories :: array of string [R] Equipment category names for the categories that may be inserted into this equipment grid.
width :: uint [R]
height :: uint [R]
locked :: boolean [R] If the player can move equipment into or out of this grid.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaEquipmentPrototype - sort
name :: string [R] Name of this prototype.
type :: string [R] Type of this equipment prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
shape :: table [R] Shape of this equipment prototype.
take_result :: LuaItemPrototype [R] The result item when taking this equipment out of an equipment grid.
energy_production :: double [R] The max power generated by this equipment.
shield :: float [R] The shield value of this equipment.
energy_per_shield :: double [R] The energy per shield point restored.
logistic_parameters :: table [R] The logistic parameters for roboport equipment.
energy_consumption :: double [R]
movement_bonus :: float [R]
night_vision_tint :: Color [R]
energy_source :: LuaElectricEnergySourcePrototype [R] The energy source prototype for the equipment.
equipment_categories :: array of string [R] Category names for this equipment.
burner_prototype :: LuaBurnerPrototype [R] The burner energy source prototype this equipment uses or nil.
electric_energy_source_prototype :: LuaElectricEnergySourcePrototype [R] The electric energy source prototype this equipment uses or nil.
background_color :: Color [R] The background color of this equipment prototype.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaFlowStatistics - sort
get_input_count(string) → uint64 or double Gets the total input count for a given prototype.
set_input_count(string, count) Sets the total input count for a given prototype.
get_output_count(string) → uint64 or double Gets the total output count for a given prototype.
set_output_count(string, count) Sets the total output count for a given prototype.
get_flow_count{name=…, input=…, precision_index=…, count=…} → double Gets the flow count value for the given time frame.
on_flow(string, count) Adds a value to this flow statistics.
clear() Reset all the statistics data to 0.
input_counts :: dictionary stringarray of uint64 or double [R] List of input counts indexed by name <> value.
output_counts :: dictionary stringarray of uint64 or double [R] List of output counts indexed by name <> value.
force :: LuaForce [R] The force these statistics belong to or nil for pollution statistics.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaFluidBox - sort
get_prototype(index) → LuaFluidBoxPrototype The prototype of this fluidbox index.
get_capacity(index) → double The capacity of the given fluidbox index.
get_connections(index) → array of LuaFluidBox The fluidbox connections for the given fluidbox index.
get_filter(index) → table The filter of the given fluidbox index, 'nil' if none.
set_filter(index, table) → boolean Set the filter of the given fluidbox index, 'nil' to clear.
get_flow(index) → double Flow through the fluidbox in the last tick.
get_locked_fluid(index) → string Returns the fluid the fluidbox is locked onto (along with its whole system) Returns 'nil' for no lock
operator # :: uint [R] Number of fluid boxes.
owner :: LuaEntity [R] The entity that owns this fluidbox.
operator [] :: Fluid or nil [R] Access, set or clear a fluid box.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaFluidBoxPrototype - sort
entity :: LuaEntityPrototype [R] The entity that this belongs to.
index :: uint [R] The index of this fluidbox prototype in the owning entity.
pipe_connections :: array of FluidBoxConnection [R] The pipe connection points.
production_type :: string [R] The production type.
base_area :: double [R]
base_level :: double [R]
height :: double [R]
volume :: double [R]
filter :: LuaFluidPrototype [R] The filter or nil if no filter is set.
minimum_temperature :: double [R] The minimum temperature or nil if none is set.
maximum_temperature :: double [R] The maximum temperature or nil if none is set.
secondary_draw_orders :: array of int [R] The secondary draw orders for the 4 possible connection directions.
render_layer :: string [R] The render layer.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaFluidPrototype - sort
name :: string [R] Name of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
default_temperature :: double [R] Default temperature of the fluid.
max_temperature :: double [R] Maximum temperature the fluid can reach.
heat_capacity :: double [R] How much energy the fluid will generate at max temperature assuming 100% efficiency steam engine.
order :: string [R] Order string for this prototype.
group :: LuaGroup [R] Group of this prototype.
subgroup :: LuaGroup [R] Subgroup of this prototype.
base_color :: Color [R]
flow_color :: Color [R]
gas_temperature :: double [R]
emissions_multiplier :: double [R]
fuel_value :: double [R]
hidden :: boolean [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaForce - sort
get_entity_count(name) → uint Count entities of given type.
disable_research() Disable research for this force.
enable_research() Enable research for this force.
disable_all_prototypes() Disable all recipes and technologies.
enable_all_prototypes() Enables all recipes and technologies.
reset_recipes() Load the original version of all recipes from the prototypes.
enable_all_recipes() Unlock all recipes.
enable_all_technologies() Unlock all technologies.
research_all_technologies(include_disabled_prototypes) Research all technologies.
reset_technologies() Load the original versions of technologies from prototypes.
reset() Reset everything.
reset_technology_effects() 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.
rechart() 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.
get_ammo_damage_modifier(ammo) → double
set_ammo_damage_modifier(ammo, modifier)
get_gun_speed_modifier(ammo) → double
set_gun_speed_modifier(ammo, modifier)
get_turret_attack_modifier(turret) → double
set_turret_attack_modifier(turret, modifier)
set_cease_fire(other, cease_fire) Stop attacking members of a given force.
get_cease_fire(other) → boolean Will this force attack members of another force?
set_friend(other, cease_fire) Friends have unrestricted access to buildings and turrets won't fire at them.
get_friend(other) → boolean Is this force a friend?
is_pathfinder_busy() → boolean Is pathfinder busy?
kill_all_units() Kill all units and flush the pathfinder.
find_logistic_network_by_position(position, surface) → LuaLogisticNetwork
set_spawn_position(position, surface)
get_spawn_position(surface) → Position
unchart_chunk(position, surface)
get_item_launched(item) → 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 of LuaTrain
add_chart_tag(surface, tag) → LuaCustomChartTag Adds a custom chart tag to the given surface and returns the new tag or nil if the given position isn't valid for a chart tag.
find_chart_tags(surface, area) → array of LuaCustomChartTag Finds all custom chart tags within the given bounding box on the given surface.
get_saved_technology_progress(technology) → double Gets the saved progress for the given technology or nil if there is no saved progress.
set_saved_technology_progress(technology, double) Sets the saved progress for the given technology.
reset_evolution() Resets evolution for this force to zero.
play_sound{path=…, position=…, volume_modifier=…} → boolean Plays a sound for every player on this force
get_train_stops(opts) → array of LuaEntity Gets train stops matching the given filters.
get_hand_crafting_disabled_for_recipe(recipe) → boolean Gets if the given recipe is explicitly disabled from being hand crafted.
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.
cancel_current_research() Stop the research currently in progress.
name :: string [R] Name of the force.
technologies :: CustomDictionary stringLuaTechnology [R] Technologies owned by this force, indexed by their name.
recipes :: CustomDictionary stringLuaRecipe [R] Recipes available to this force, indexed by their name.
manual_mining_speed_modifier :: double [RW] Multiplier of the manual mining speed.
manual_crafting_speed_modifier :: double [RW] Multiplier of the manual crafting speed.
laboratory_speed_modifier :: double [RW]
laboratory_productivity_bonus :: double [RW]
worker_robots_speed_modifier :: double [RW]
worker_robots_battery_modifier :: double [RW]
worker_robots_storage_bonus :: double [RW]
current_research :: LuaTechnology [R] The current technology in research, or nil if no research is currently ongoing.
research_progress :: double [RW] Progress of current research, as a number in range [0, 1].
previous_research :: LuaTechnology [RW] The previous research if any.
inserter_stack_size_bonus :: double [RW] The inserter stack size bonus for non stack inserters
stack_inserter_capacity_bonus :: uint [RW] Number of items that can be transferred by stack inserters.
character_logistic_slot_count :: double [RW] Number of character logistic slots.
character_trash_slot_count :: double [RW] Number of character trash slots.
maximum_following_robot_count :: uint [RW] Maximum number of follower robots.
following_robots_lifetime_modifier :: double [RW] Additional lifetime for following robots.
ghost_time_to_live :: uint [RW] The time, in ticks, before a placed ghost disappears.
players :: array of LuaPlayer [R] Players belonging to this force.
ai_controllable :: boolean [RW] Enables some higher-level AI behaviour for this force.
logistic_networks :: dictionary stringarray of LuaLogisticNetwork [R] List of logistic networks, grouped by surface.
item_production_statistics :: LuaFlowStatistics [R] The item production statistics for this force.
fluid_production_statistics :: LuaFlowStatistics [R] The fluid production statistics for this force.
kill_count_statistics :: LuaFlowStatistics [R] The kill counter statistics for this force.
entity_build_count_statistics :: LuaFlowStatistics [R] The entity build statistics for this force (built and mined)
character_running_speed_modifier :: double [RW]
artillery_range_modifier :: double [RW]
character_build_distance_bonus :: uint [RW]
character_item_drop_distance_bonus :: uint [RW]
character_reach_distance_bonus :: uint [RW]
character_resource_reach_distance_bonus :: double [RW]
character_item_pickup_distance_bonus :: double [RW]
character_loot_pickup_distance_bonus :: double [RW]
character_inventory_slots_bonus :: uint [RW] the number of additional inventory slots the character main inventory has.
deconstruction_time_to_live :: uint [RW] The time, in ticks, before a deconstruction order is removed.
character_health_bonus :: double [RW]
max_successful_attempts_per_tick_per_construction_queue :: uint [RW]
max_failed_attempts_per_tick_per_construction_queue :: uint [RW]
auto_character_trash_slots :: boolean [RW] true if auto character trash slots are enabled.
zoom_to_world_enabled :: boolean [RW] Ability to use zoom-to-world on map.
zoom_to_world_ghost_building_enabled :: boolean [RW] Ability to build ghosts through blueprint or direct ghost placement, or "mine" ghosts when using zoom-to-world.
zoom_to_world_blueprint_enabled :: boolean [RW] Ability to create new blueprints using empty blueprint item when using zoom-to-world.
zoom_to_world_deconstruction_planner_enabled :: boolean [RW] Ability to use deconstruction planner when using zoom-to-world.
zoom_to_world_selection_tool_enabled :: boolean [RW] Ability to use custom selection tools when using zoom-to-world.
rockets_launched :: uint [RW] The number of rockets launched.
items_launched :: dictionary stringuint [R] All of the items that have been launched in rockets.
connected_players :: array of LuaPlayer [R] The connected players belonging to this force.
mining_drill_productivity_bonus :: double [RW]
train_braking_force_bonus :: double [RW]
evolution_factor :: double [RW] Evolution factor of this force.
evolution_factor_by_pollution :: double [RW]
evolution_factor_by_time :: double [RW]
evolution_factor_by_killing_spawners :: double [RW]
friendly_fire :: boolean [RW] If friendly fire is enabled for this force.
share_chart :: boolean [RW] If sharing chart data is enabled for this force.
research_queue_enabled :: boolean [RW] Whether the research queue is available for this force.
index :: uint [R] Unique ID associated with this force.
research_queue :: array of TechnologySpecification [RW] The research queue of this force.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaFuelCategoryPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaGameScript - sort
help() Internal
set_game_state{game_finished=…, player_won=…, next_level=…, can_continue=…, victorious_force=…} Set scenario state.
get_entity_by_tag(tag) → LuaEntity
show_message_dialog{text=…, image=…, point_to=…, style=…} Show an in-game message dialog.
disable_tips_and_tricks() Disable showing tips and tricks.
is_demo() → boolean Is this the demo version of Factorio?
reload_script() Forces a reload of the scenario script from the original scenario location.
reload_mods() Forces a reload of all mods.
save_atlas() Saves the current configuration of Atlas to a file.
check_consistency() 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=…, anti_alias=…, quality=…} Take a screenshot and save it to a file.
set_wait_for_screenshots_to_finish() 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=…}
table_to_json(data) → string Convert a table to a JSON string
json_to_table(json) → Any Convert a JSON string to a table
write_file(filename, data, append, for_player) Write a string to a file.
remove_path(path) Remove file or directory.
remove_offline_players(players) Remove players who are currently not connected from the map.
force_crc() Force a CRC check.
create_force(force) → LuaForce Create a new force.
merge_forces(source, destination) Marks two forces to be merge together.
create_surface(name, settings) → LuaSurface 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.
disable_replay() Disables replay saving for the current save file.
disable_tutorial_triggers() 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.
create_random_generator(seed) → LuaRandomGenerator Creates a deterministic standalone random generator with the given seed or if a seed is not provided the initial map seed is used.
check_prototype_translations() Goes over all items, entities, tiles, recipes, technologies among other things and logs if the locale is incorrect.
play_sound{path=…, position=…, volume_modifier=…} → boolean Plays a sound for every player in the game on every surface.
is_valid_sound_path(SoundPath) → boolean Checks if the given sound path is valid.
kick_player(PlayerSpecification, reason) Kicks the given player from this multiplayer game.
ban_player(PlayerSpecification, reason) Bans the given player from this multiplayer game.
unban_player(PlayerSpecification) Unbans the given player from this multiplayer game.
purge_player(PlayerSpecification) Purges the given players messages from the game.
mute_player(PlayerSpecification) Mutes the given player.
unmute_player(PlayerSpecification) Unmutes the given player.
count_pipe_groups() Counts how many distinct groups of pipes exist in the world.
is_multiplayer() → boolean Is the map loaded is multiplayer?
get_active_entities_count(surface) → uint Gets the number of entities that are active (updated each tick).
get_map_exchange_string() → string Gets the map exchange string for the map generation settings that were used to create this map.
parse_map_exchange_string(map_exchange_string) → MapExchangeStringData Convert a map exchange string to map gen settings and map settings.
get_train_stops(opts) → array of 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() → LuaProfiler Creates a LuaProfiler, which is used for measuring script performance.
evaluate_expression(expression, variables) → double Evaluate an expression, substituting variables as provided.
get_filtered_entity_prototypes(filters) → CustomDictionary stringLuaEntityPrototype
get_filtered_item_prototypes(filters) → CustomDictionary stringLuaItemPrototype
get_filtered_equipment_prototypes(filters) → CustomDictionary stringLuaEquipmentPrototype
get_filtered_mod_setting_prototypes(filters) → CustomDictionary stringLuaModSettingPrototype
get_filtered_achievement_prototypes(filters) → CustomDictionary stringLuaAchievementPrototype
player :: LuaPlayer [R] The player typing at the console - nil in all other instances.
players :: CustomDictionary uint or stringLuaPlayer [R]
map_settings :: MapSettings [R]
difficulty_settings :: DifficultySettings [R] Although it can be done; because different difficulties can have different technology or recipe trees it's not recommended to change difficulty settings mid-game.
difficulty :: defines.difficulty [R] Current scenario difficulty.
forces :: CustomDictionary uint or stringLuaForce [R]
entity_prototypes :: CustomDictionary stringLuaEntityPrototype [R]
item_prototypes :: CustomDictionary stringLuaItemPrototype [R]
fluid_prototypes :: CustomDictionary stringLuaFluidPrototype [R]
tile_prototypes :: CustomDictionary stringLuaTilePrototype [R]
equipment_prototypes :: CustomDictionary stringLuaEquipmentPrototype [R]
damage_prototypes :: CustomDictionary stringLuaDamagePrototype [R]
virtual_signal_prototypes :: CustomDictionary stringLuaVirtualSignalPrototype [R]
equipment_grid_prototypes :: CustomDictionary stringLuaEquipmentGridPrototype [R]
recipe_prototypes :: CustomDictionary stringLuaRecipePrototype [R]
technology_prototypes :: CustomDictionary stringLuaTechnologyPrototype [R]
decorative_prototypes :: CustomDictionary stringLuaDecorativePrototype [R]
autoplace_control_prototypes :: CustomDictionary stringLuaAutoplaceControlPrototype [R]
noise_layer_prototypes :: CustomDictionary stringLuaNoiseLayerPrototype [R]
mod_setting_prototypes :: CustomDictionary stringLuaModSettingPrototype [R]
custom_input_prototypes :: CustomDictionary stringLuaCustomInputPrototype [R]
ammo_category_prototypes :: CustomDictionary stringLuaAmmoCategoryPrototype [R]
named_noise_expressions :: CustomDictionary stringLuaNamedNoiseExpression [R]
item_subgroup_prototypes :: CustomDictionary stringLuaGroup [R]
item_group_prototypes :: CustomDictionary stringLuaGroup [R]
fuel_category_prototypes :: CustomDictionary stringLuaFuelCategoryPrototype [R]
resource_category_prototypes :: CustomDictionary stringLuaResourceCategoryPrototype [R]
achievement_prototypes :: CustomDictionary stringLuaAchievementPrototype [R]
module_category_prototypes :: CustomDictionary stringLuaModuleCategoryPrototype [R]
equipment_category_prototypes :: CustomDictionary stringLuaEquipmentCategoryPrototype [R]
trivial_smoke_prototypes :: CustomDictionary stringLuaTrivialSmokePrototype [R]
shortcut_prototypes :: CustomDictionary stringLuaShortcutPrototype [R]
recipe_category_prototypes :: CustomDictionary stringLuaRecipeCategoryPrototype [R]
styles :: CustomDictionary stringstring [R] The styles that LuaGuiElement can use.
tick :: uint [R] Current map tick.
ticks_played :: uint [R] The number of ticks since this game was 'created'.
tick_paused :: boolean [RW] If the tick has been paused.
ticks_to_run :: uint [RW] The number of ticks to be run while the tick is paused.
finished :: boolean [R] Is the scenario finished?
speed :: float [RW] Speed to update the map at.
surfaces :: CustomDictionary uint or stringLuaSurface [R]
active_mods :: dictionary stringstring [R] The active mods versions.
connected_players :: array of LuaPlayer [R] The online players This is primarily useful when you want to do some action against all online players.
permissions :: LuaPermissionGroups [R]
backer_names :: CustomDictionary uintstring [R]
default_map_gen_settings :: MapGenSettings [R] The default map gen settings for this save.
enemy_has_vision_on_land_mines :: boolean [RW] Determines if enemy land mines are completely invisible or not.
autosave_enabled :: boolean [RW] True by default.
draw_resource_selection :: boolean [RW] True by default.
pollution_statistics :: LuaFlowStatistics [R] The pollution statistics for this map.
class LuaGroup - sort
name :: string [R]
localised_name :: LocalisedString [R] Localised name of the group.
type :: string [R]
group :: LuaGroup [R] The parent group if any; nil if none.
subgroups :: array of LuaGroup [R] Subgroups of this group.
order_in_recipe :: string [R] The additional order value used in recipe ordering.
order :: string [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaGui - sort
is_valid_sprite_path(sprite_path) → boolean Returns true if sprite_path is valid and contains loaded sprite, otherwise false.
player :: LuaPlayer [R] The player who owns this gui.
children :: dictionary stringLuaGuiElement [R] The children GUI elements mapped by name <> element.
top :: LuaGuiElement [R] The top part of the GUI.
left :: LuaGuiElement [R] The left part of the GUI.
center :: LuaGuiElement [R] The center part of the GUI.
goal :: LuaGuiElement [R] The flow used in the objectives window.
screen :: LuaGuiElement [R] For showing a GUI somewhere on the entire screen.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaGuiElement - sort
add{type=…, name=…, caption=…, tooltip=…, enabled=…, ignored_by_interaction=…, style=…} → LuaGuiElement Add a child element.
clear() Remove children of this element.
destroy() Remove this element, along with its children.
get_mod() → string The mod that owns this Gui element or nil if it's owned by the scenario script.
clear_items() Clears the items in this dropdown or listbox.
get_item(index) → LocalisedString Gets an item at the given index from this dropdown or listbox.
set_item(index, LocalisedString) Sets an item at the given index in this dropdown or listbox.
add_item(LocalisedString, index) Adds an item at the end or at the given index in this dropdown or listbox.
remove_item(index) Removes an item at the given index in this dropdown or listbox.
get_slider_minimum() → double Gets this sliders minimum value.
get_slider_maximum() → double Gets this sliders minimum value.
set_slider_minimum_maximum(minimum, maximum) Sets this sliders minimum and maximum values.
get_slider_value_step() → double Gets the minimum distance the slider can move.
get_slider_discrete_slider() → boolean Gets if the slider only allows being moved to discrete positions.
get_slider_discrete_values() → boolean Gets if the slider only allows being having discrete values.
set_slider_value_step(value) The minimum distance the slider can move.
set_slider_discrete_slider(value) Sets if the slider only allows being moved to discrete positions.
set_slider_discrete_values(value) Sets if the slider only allows being having discrete values.
focus() Focuses this GUI element if possible.
scroll_to_top() Scrolls the scroll bar to the top.
scroll_to_bottom() Scrolls the scroll bar to the bottom.
scroll_to_left() Scrolls the scroll bar to the left.
scroll_to_right() Scrolls the scroll bar to the right.
scroll_to_element(element, scroll_mode) Scrolls the scroll bar such that the specified GUI element is visible to the player.
select_all() Select all text in the text box.
select(start, end) Select a range of text in the text box.
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 what ever it's associated content is from this tabbed pane.
force_auto_center() Forces this frame to re-auto-center.
index :: uint [R] The unique index of this GUI element.
gui :: LuaGui [R] The GUI this element is a part of.
parent :: LuaGuiElement [R] The direct parent of this element; nil if this is a top-level element.
name :: string [R] The name of this element.
caption :: LocalisedString [RW] The text displayed on the element.
value :: double [RW] How much this progress bar is filled.
direction :: string [R] Direction of the layout.
style :: LuaStyle or string [RW] The style of this element.
visible :: boolean [RW] When not visible the GUI element is hidden completely and takes no space in the layout.
text :: string [RW] The text contained in a textfield or text-box.
children_names :: array of string [R] Names of all the children of this element.
state :: boolean [RW] Is this checkbox or radiobutton checked?
player_index :: uint [R] Index into LuaGameScript::players specifying the player who owns this element.
sprite :: SpritePath [RW] The image to display on this sprite-button or sprite in the default state.
resize_to_sprite :: boolean [RW] Whether should the image widget resize its size according to the sprite in it (true by default)
hovered_sprite :: SpritePath [RW] The image to display on this sprite-button when it is hovered.
clicked_sprite :: SpritePath [RW] The image to display on this sprite-button when it is clicked.
tooltip :: LocalisedString [RW]
horizontal_scroll_policy :: string [RW] Policy of the horizontal scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
vertical_scroll_policy :: string [RW] Policy of the vertical scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
type :: string [R] The type of this GUI element.
children :: array of LuaGuiElement [R] The children elements
items :: array of LocalisedString [RW] The items in this dropdown or listbox.
selected_index :: uint [RW] The selected index for this dropdown or listbox.
number :: double [RW] The number to be shown in the right-bottom corner of the sprite-button, or nil to show nothing.
show_percent_for_small_numbers :: boolean [RW] Related to the number to be shown in the right-bottom corner of the sprite-button.
location :: GuiLocation [RW] The location of this widget when stored in LuaGui::screen or nil if not not set or not in LuaGui::screen.
auto_center :: boolean [RW] If this frame auto-centers on window resize when stored in LuaGui::screen.
position :: Position [RW] The position this camera or minimap is focused on if any.
surface_index :: uint [RW] The surface index this camera or minimap is using.
zoom :: double [RW] The zoom this camera or minimap is using.
minimap_player_index :: uint [RW] The player index this minimap is using.
force :: string [RW] The force this minimap is using or nil if no force is set.
elem_type :: string [R] The elem type of this choose-elem-button.
elem_value :: string or SignalID [RW] The elem value of this choose-elem-button or nil if there is no value.
selectable :: boolean [RW] If the contents of this text-box are selectable.
word_wrap :: boolean [RW] If this text-box will word-wrap automatically.
read_only :: boolean [RW] If this text-box is read-only.
enabled :: boolean [RW] If this GUI element is enabled.
ignored_by_interaction :: boolean [RW] If this GUI element is ignored by interaction.
locked :: boolean [RW] If this choose-elem-button can be changed by the player.
draw_vertical_lines :: boolean [RW] If this table should draw vertical grid lines.
draw_horizontal_lines :: boolean [RW] If this table should draw horizontal grid lines.
draw_horizontal_line_after_headers :: boolean [RW] If this table should draw a horizontal grid line after the headers.
column_count :: uint [R] The number of columns in this table.
vertical_centering :: boolean [RW] Whether the fields of this table should be vertically centered.
slider_value :: double [RW] The value of this slider element.
mouse_button_filter :: MouseButtonFlags [RW] The mouse button filters for this button or sprite-button.
numeric :: boolean [RW] If this text field only accepts numbers.
allow_decimal :: boolean [RW] If this text field (when in numeric mode) allows decimal numbers.
allow_negative :: boolean [RW] If this text field (when in numeric mode) allows negative numbers.
is_password :: boolean [RW] If this text field displays as a password field (renders all characters as '*').
lose_focus_on_confirm :: boolean [RW] If this text field loses focus after defines.events.on_gui_confirmed is fired.
clear_and_focus_on_right_click :: boolean [RW]
drag_target :: LuaGuiElement [RW] The frame drag target for this flow, frame, label, table, or empty-widget.
selected_tab_index :: uint [RW] The selected tab index or nil if no tab is selected.
tabs :: array of TabAndContent [R] The tabs and contents being shown in this tabbed-pane.
entity :: LuaEntity [RW] The entity associated with this entity-preview or nil if no entity is associated.
switch_state :: string [RW] The switch state (left, none, right) for this switch.
allow_none_state :: boolean [RW] If the 'none' state is allowed for this switch.
left_label_caption :: LocalisedString [RW] The text shown for the left switch label.
left_label_tooltip :: LocalisedString [RW] The text shown for the left switch tooltip.
right_label_caption :: LocalisedString [RW] The text shown for the right switch label.
right_label_tooltip :: LocalisedString [RW] The text shown for the right switch tooltip.
operator [] :: LuaGuiElement [R] The indexing operator.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaInventory - sort
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.
get_item_count(item) → uint Get the number of all or some items in this inventory.
is_empty() → boolean Does this inventory contain nothing?
get_contents() → dictionary stringuint Get counts of all items in this inventory.
hasbar() → boolean Does this inventory have a bar?
getbar() → uint Get the current bar.
setbar(bar) Set the current bar.
supports_filters() → boolean If this inventory supports filters.
is_filtered() → 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.
find_item_stack(item) → LuaItemStack Gets the first LuaItemStack in the inventory that matches the given item name.
sort_and_merge() Sorts and merges the items in this inventory.
operator # :: uint [R] Get the number of slots in this inventory.
index :: uint [R] The inventory index this inventory uses.
entity_owner :: LuaEntity [R] The entity that owns this inventory or nil if this isn't owned by an entity.
player_owner :: LuaPlayer [R] The player that owns this inventory or nil if this isn't owned by a player.
equipment_owner :: LuaEntity [R] The equipment that owns this inventory or nil if this isn't owned by an equipment.
operator [] :: LuaItemStack [R] The indexing operator.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaItemPrototype - sort
has_flag(flag) → boolean Does this prototype have a flag enabled?
get_ammo_type(ammo_source_type) → AmmoType Type of this ammo prototype or nil if this is not an ammo prototype.
type :: string [R] Type of this prototype.
name :: string [R] Name of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
order :: string [R] Order string.
place_result :: LuaEntityPrototype [R] Prototype of the entity that will be created by placing this item, or nil if there is no such entity.
place_as_equipment_result :: LuaEquipmentPrototype [R] Prototype of the equipment that will be created by placing this item in an equipment grid or nil if there is no equipment defined.
place_as_tile_result :: PlaceAsTileResult [R] The place as tile result if one is defined else nil.
stackable :: boolean [R] Is this item allowed to stack at all?
default_request_amount :: uint [R] The default request value.
stack_size :: uint [R] Maximum stack size of the item specified by this prototype.
wire_count :: uint [R] The number of items needed to connect 2 entities with this as wire.
fuel_category :: string [R] The fuel category or nil.
burnt_result :: LuaItemPrototype [R] The result of burning this item as fuel or nil.
fuel_value :: float [R] Fuel value when burned.
fuel_acceleration_multiplier :: double [R] The acceleration multiplier when this item is used as fuel in a vehicle.
fuel_top_speed_multiplier :: double [R] The fuel top speed multiplier when this item is used as fuel in a vehicle.
fuel_emissions_multiplier :: double [R] The emissions multiplier if this is used as fuel.
subgroup :: LuaGroup [R] The subgroup this prototype belongs to.
group :: LuaGroup [R] The group this prototype belongs to.
flags :: dictionary stringboolean [R] The item prototype flags for this item prototype.
rocket_launch_products :: array of Product [R] The results from launching this item in a rocket.
can_be_mod_opened :: boolean [R] If this item can be mod-opened.
magazine_size :: float [R] Size of full magazine; nil if this is not an ammo item.
reload_time :: float [R] Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine or nil if this is not an ammo item.
equipment_grid :: LuaEquipmentGridPrototype [R] The prototype of this armor equipment grid or nil if none or this is not an armor item.
resistances :: Resistances [R] Resistances of this armour item; nil if not an armor or the armor has no resistances.
inventory_size_bonus :: uint [R] The inventory size bonus for this armor prototype.
capsule_action :: CapsuleAction [R] The capsule action for this capsule item prototype or nil if this isn't a capsule item prototype.
robot_action :: Trigger [R] The robot action for this capsule item prototype or nil if this isn't a capsule item prototype.
attack_parameters :: AttackParameters [R] The gun attack parameters or nil if not a gun item prototype.
inventory_size :: uint [R] The main inventory size for item-with-inventory-prototype.
item_filters :: dictionary stringLuaItemPrototype [R]
item_group_filters :: dictionary stringLuaGroup [R]
item_subgroup_filters :: dictionary stringLuaGroup [R]
filter_mode :: string [R] The filter mode used by this item with inventory.
insertion_priority_mode :: string [R] The insertion priority mode used by this item with inventory.
localised_filter_message :: LocalisedString [R] The localised string used when the player attempts to put items into this item with inventory that aren't allowed.
extend_inventory_by_default :: boolean [R] If this item with inventory extends the inventory it resides in by default.
default_label_color :: Color [R] The default label color used for this item with label.
draw_label_for_cursor_render :: 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.
speed :: float [R] The repairing speed if this is a repairing tool; otherwise nil.
module_effects :: Effects [R] Effects of this module; nil if this is not a module.
category :: string [R] The module category name
tier :: uint [R] The module tier
limitations :: array of string [R] An array of recipe names this module is allowed to work with.
limitation_message_key :: string [R] The limitation message key used when the player attempts to use this modules in some place it's not allowed.
straight_rail :: LuaEntityPrototype [R] The straight rail prototype used for this rail planner prototype.
curved_rail :: LuaEntityPrototype [R] The curved rail prototype used for this rail planner prototype.
repair_result :: Trigger [R] The repair result of this repair tool prototype or nil if this isn't a repair tool prototype.
selection_border_color :: Color [R] The color used when doing normal selection with this selection tool prototype.
alt_selection_border_color :: Color [R] The color used when doing alt selection with this selection tool prototype.
selection_mode_flags :: SelectionModeFlags [R] Flags that affect which entities will be selected.
alt_selection_mode_flags :: SelectionModeFlags [R] Flags that affect which entities will be selected during alternate selection.
selection_cursor_box_type :: string [R]
alt_selection_cursor_box_type :: string [R]
always_include_tiles :: boolean [R] If tiles area always included when doing selection with this selection tool prototype.
show_in_library :: boolean [R] Is this selection tool prototype available in the blueprint library.
entity_filter_mode :: string [R] The entity filter mode used by this selection tool.
alt_entity_filter_mode :: string [R] The alt entity filter mode used by this selection tool.
tile_filter_mode :: string [R] The tile filter mode used by this selection tool.
alt_tile_filter_mode :: string [R] The alt tile filter mode used by this selection tool.
entity_filters :: dictionary stringLuaEntityPrototype [R] The entity filters used by this selection tool indexed by entity name.
alt_entity_filters :: dictionary stringLuaEntityPrototype [R] The alt entity filters used by this selection tool indexed by entity name.
entity_type_filters :: dictionary stringboolean [R] The entity type filters used by this selection tool indexed by entity type.
alt_entity_type_filters :: dictionary stringboolean [R] The alt entity type filters used by this selection tool indexed by entity type.
tile_filters :: dictionary stringLuaTilePrototype [R] The tile filters used by this selection tool indexed by tile name.
alt_tile_filters :: dictionary stringLuaTilePrototype [R] The alt tile filters used by this selection tool indexed by tile name.
entity_filter_slots :: uint [R] The number of entity filters this deconstruction item has or nil if this isn't a deconstruction item prototype.
tile_filter_slots :: uint [R] The number of tile filters this deconstruction item has or nil if this isn't a deconstruction item prototype.
durability_description_key :: string [R] The durability message key used when displaying the durability of this tool.
durability :: double [R] The durability of this tool item or nil if not a tool item.
infinite :: boolean [R] If this tool item has infinite durability.
mapper_count :: uint [R] How many filters an upgrade item has.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaItemStack - sort
is_blueprint_setup() → boolean Is this blueprint item setup?
get_blueprint_entities() → array of blueprint entity Entities in this blueprint.
set_blueprint_entities(entities) 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.
drain_durability(amount) 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.
transfer_stack(stack) → boolean Transfers the given item stack into this item stack.
export_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.
get_blueprint_tiles() → array of blueprint tile Tiles in this blueprint
set_blueprint_tiles(tiles) Set tiles in this blueprint
get_inventory(inventory) → LuaInventory Access the inner inventory of an item.
build_blueprint{surface=…, force=…, position=…, force_build=…, direction=…, skip_fog_of_war=…, by_player=…} → array of LuaEntity Build this blueprint
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=…} Sets up this blueprint using the found blueprintable entities/tiles on the surface.
get_tag(tag_name) → Any Gets the tag with the given name or returns nil if it doesn't exist.
set_tag(tag_name, tag) → Any Sets the tag with the given name and value.
remove_tag(tag) → boolean Removes a tag with the given name.
clear_blueprint() Clears this blueprint item.
get_entity_filter(index) → 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.
get_tile_filter(index) → 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.
clear_deconstruction_item() Clears all settings/filters on this deconstruction item resetting it to default values.
clear_upgrade_item() Clears all settings/filters on this upgrade item resetting it to default values.
get_mapper(index, type) → UpgradeFilter 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.
valid_for_read :: boolean [R] Is this valid for reading?
prototype :: LuaItemPrototype [R] Prototype of the item held in this stack.
name :: string [R] Prototype name of the item held in this stack.
type :: string [R] Type of the item prototype.
count :: uint [RW] Number of items in this stack.
grid :: LuaEquipmentGrid [R] The equipment grid of this item or nil if this item doesn't have a grid.
health :: float [RW] How much health the item has, as a number in range [0, 1].
durability :: double [RW] Durability of the contained item.
ammo :: uint [RW] Number of bullets left in the magazine.
blueprint_icons :: array of Icon [RW] Icons of a blueprint item.
label :: string [RW] The current label for this item.
label_color :: Color [RW] The current label color for this item.
allow_manual_label_change :: boolean [RW] If the label for this item can be manually changed.
cost_to_build :: dictionary stringuint [R] Raw materials required to build this blueprint.
extends_inventory :: boolean [RW] If this item extends the inventory it resides in (provides its contents for counts, crafting, insertion).
prioritize_insertion_mode :: string [RW] The insertion mode priority this ItemWithInventory uses when items are inserted into an inventory it resides in.
default_icons :: array of Icon [R] The default icons for a blueprint item.
tags :: dictionary stringAny [RW]
custom_description :: LocalisedString [RW] The custom description this item-with-tags.
entity_filters :: array of string [RW] The entity filters for this deconstruction item.
tile_filters :: array of string [RW] The tile filters for this deconstruction item.
entity_filter_mode :: defines.deconstruction_item.entity_filter_mode [RW] The blacklist/whitelist entity filter mode for this deconstruction item.
tile_filter_mode :: defines.deconstruction_item.tile_filter_mode [RW] The blacklist/whitelist tile filter mode for this deconstruction item.
tile_selection_mode :: defines.deconstruction_item.tile_selection_mode [RW] The tile selection mode for this deconstruction item.
trees_and_rocks_only :: boolean [RW] If this deconstruction item is set to allow trees and rocks only.
entity_filter_count :: uint [R] The number of entity filters this deconstruction item supports.
tile_filter_count :: uint [R] The number of tile filters this deconstruction item supports.
active_index :: uint [RW] The active blueprint index for this blueprint book.
item_number :: uint [R] The unique ID for this item if it has a unique ID or nil.
is_blueprint :: boolean [R] If this is a blueprint item.
is_blueprint_book :: boolean [R] If this is a blueprint book item.
is_module :: boolean [R] If this is a module item.
is_tool :: boolean [R] If this is a tool item.
is_mining_tool :: boolean [R] If this is a mining tool item.
is_armor :: boolean [R] If this is an armor item.
is_repair_tool :: boolean [R] If this is a repair tool item.
is_item_with_label :: boolean [R] If this is an item with label item.
is_item_with_inventory :: boolean [R] If this is an item with inventory item.
is_item_with_entity_data :: boolean [R] If this is an item with entity data item.
is_selection_tool :: boolean [R] If this is a selection tool item.
is_item_with_tags :: boolean [R] If this is an item with tags item.
is_deconstruction_item :: boolean [R] If this is a deconstruction tool item.
is_upgrade_item :: boolean [R] If this is a upgrade item.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaLogisticCell - sort
is_in_logistic_range(position) → boolean Is a given position within the logistic range of this cell?
is_in_construction_range(position) → boolean Is a given position within the construction range of this cell?
is_neighbour_with(other) → boolean Are two cells neighbours?
logistic_radius :: float [R] Logistic radius of this cell.
logistics_connection_distance :: float [R] Logistic connection distance of this cell.
construction_radius :: float [R] Construction radius of this cell.
stationed_logistic_robot_count :: uint [R] Number of stationed logistic robots in this cell.
stationed_construction_robot_count :: uint [R] Number of stationed construction robots in this cell.
mobile :: boolean [R] true if this is a mobile cell.
transmitting :: boolean [R] true if this cell is active.
charge_approach_distance :: float [R] Radius at which the robots hover when waiting to be charged.
charging_robot_count :: uint [R] Number of robots currently charging.
to_charge_robot_count :: uint [R] Number of robots waiting to charge.
owner :: LuaEntity [R] This cell's owner.
logistic_network :: LuaLogisticNetwork [R] The network that owns this cell or nil.
neighbours :: array of LuaLogisticCell [R] Neighbouring cells.
charging_robots :: array of LuaEntity [R] Robots currently being charged.
to_charge_robots :: array of LuaEntity [R] Robots waiting to charge.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaLogisticNetwork - sort
get_item_count(item, member) → int Count given or all items in the network or given members.
get_contents() → dictionary stringuint Get item counts for the entire network.
remove_item(item, members) → uint Remove items from the logistic network.
insert(item, members) → uint Insert items into the logistic network.
find_cell_closest_to(position) → LuaLogisticCell Find logistic cell closest to a given position.
select_pickup_point{name=…, position=…, include_buffers=…, members=…} → LuaLogisticPoint Find the 'best' logistic point with this item ID and from the given position or from given chest type.
select_drop_point{stack=…, members=…} → LuaLogisticPoint Find a logistic point to drop the specific item stack.
force :: LuaForce [R] The force this logistic network belongs to.
available_logistic_robots :: uint [R] Number of logistic robots available for a job.
all_logistic_robots :: uint [R] The total number of logistic robots in the network (idle and active + in roboports).
available_construction_robots :: uint [R] Number of construction robots available for a job.
all_construction_robots :: uint [R] The total number of construction robots in the network (idle and active + in roboports).
robot_limit :: uint [R] Maximum number of robots the network can work with.
cells :: array of LuaLogisticCell [R] All cells in this network.
providers :: array of LuaEntity [R] All entities that have logistic provider points in this network.
empty_providers :: array of LuaEntity [R] All entities that have empty logistic provider points in this network.
requesters :: array of LuaEntity [R] All entities that have logistic requester points in this network.
storages :: array of LuaEntity [R] All entities that have logistic storage points in this network.
logistic_members :: array of LuaEntity [R] All other entities that have logistic points in this network (inserters mostly).
provider_points :: array of LuaLogisticPoint [R] All things that have provider points in this network.
passive_provider_points :: array of LuaLogisticPoint [R] All passive provider points in this network.
active_provider_points :: array of LuaLogisticPoint [R] All active provider points in this network.
empty_provider_points :: array of LuaLogisticPoint [R] All things that have empty provider points in this network.
requester_points :: array of LuaLogisticPoint [R] All things that have requester points in this network.
storage_points :: array of LuaLogisticPoint [R] All things that have storage points in this network.
robots :: array of LuaEntity [R] All robots in this logistic network.
construction_robots :: array of LuaEntity [R] All construction robots in this logistic network.
logistic_robots :: array of LuaEntity [R] All logistic robots in this logistic network.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaLogisticPoint - sort
owner :: LuaEntity [R] The LuaEntity owner of this LuaLogisticPoint.
logistic_network :: LuaLogisticNetwork [R]
logistic_member_index :: uint [R] The Logistic member index of this logistic point.
filters :: array of LogisticFilter [R] The logistic filters for this logistic point or nil if this doesn't use logistic filters.
mode :: defines.logistic_mode [R] The logistic mode.
force :: LuaForce [R] The force of this logistic point.
targeted_items_pickup :: dictionary stringuint [R] Items targeted to be picked up from this logistic point by robots.
targeted_items_deliver :: dictionary stringuint [R] Items targeted to be dropped off into this logistic point by robots.
exact :: boolean [R] If this logistic point is using the exact mode.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaModSettingPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
mod :: string [R] The mod that owns this setting.
setting_type :: string [R]
default_value :: boolean or double or int or string [R] The default value of this setting.
minimum_value :: double or int [R] The minimum value for this setting or nil if this setting type doesn't support a minimum.
maximum_value :: double or int [R] The maximum value for this setting or nil if this setting type doesn't support a maximum.
allowed_values :: array of string or array of int or array of double [R] The allowed values for this setting or nil if this setting doesn't use the a fixed set of values.
allow_blank :: boolean [R] If this string setting allows blank values or nil if not a string setting.
auto_trim :: boolean [R] If this string setting auto-trims values or nil if not a string setting.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaModuleCategoryPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaNamedNoiseExpression - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
intended_property :: string [R] Name of the property that this expression is intended to provide a value for, if any.
expression :: NoiseExpression [R] The expression itself.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaNoiseLayerPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaPermissionGroup - sort
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 If this group allows the given action.
set_allows_action(action, boolean) → boolean Sets if the player is allowed to perform the given action.
destroy() → boolean Destroys this group.
name :: string [RW] The name of this group.
players :: array of LuaPlayer [R] The players in this group.
group_id :: uint [R] The group ID
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaPermissionGroups - sort
create_group(name) → LuaPermissionGroup Creates a new permission group.
get_group(group) → LuaPermissionGroup Gets the permission group with the given name or group ID or nil if there is no matching group.
groups :: array of LuaPermissionGroup [R] All of the permission groups.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaPlayer extends LuaControl - sort
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_console() Clear the chat console.
get_goal_description() → LocalisedString 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=…, final_transition_time=…} Set the controller type of the player.
disable_recipe_groups() Disable recipe groups.
enable_recipe_groups() Enable recipe groups.
disable_recipe_subgroups() Disable recipe subgroups.
enable_recipe_subgroups() Enable recipe subgroups.
print_entity_statistics(entities) Print entity statistics to the player's console.
print_robot_jobs() Print construction robot job counts to the players console.
print_lua_object_statistics() Print LuaObject counts per mod.
unlock_achievement(name) Unlock the achievements of the given player.
clean_cursor() → boolean Invokes the "clean 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 uintdictionary defines.alert_typearray of alert Gets all alerts matching the given filters or if no filters are given all alerts are returned.
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=…} → boolean Plays a sound for this player
get_associated_characters() → array of LuaEntity The characters associated with this player.
associate_character(character) Associates a character with this player.
disassociate_character(character) Disassociates a character from this player.
create_local_flying_text{text=…, position=…, color=…, time_to_live=…, speed=…} Spawn a flying text that is only visible to this player.
get_quick_bar_slot(index) → LuaItemPrototype 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.
get_active_quick_bar_page(index) → 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_cutscene() 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.
close_map() 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 shortcut currently toggled?
is_shortcut_available(prototype_name) → boolean Is a custom shortcut currently available?
set_shortcut_toggled(prototype_name, toggled) Toggle or untoggle a custom shortcut
set_shortcut_available(prototype_name, available) Make a custom shortcut available or unavailable.
connect_to_server{address=…, name=…, description=…, password=…} Asks the player if they would like to connect to the given server.
character :: LuaEntity [RW] The character attached to this player, or nil if no character.
index :: uint [R] This player's index in LuaGameScript::players.
gui :: LuaGui [R]
opened_self :: boolean [R] true if the player opened itself.
controller_type :: defines.controllers [R]
game_view_settings :: GameViewSettings [RW] The player's game view settings.
minimap_enabled :: boolean [RW] true if the minimap is visible.
color :: Color [RW] The color associated with the player.
chat_color :: Color [RW] The color used when this player talks in game.
name :: string [RW] The player's username.
tag :: string [RW] The tag that is shown after the player in chat and on the map.
connected :: boolean [R] true if the player is currently connected to the game.
admin :: boolean [RW] true if the player is an admin.
entity_copy_source :: LuaEntity [R] The source entity used during entity settings copy-paste if any.
afk_time :: uint [R] How many ticks since the last action of this player
online_time :: uint [R] How many ticks did this player spend playing this save (all sessions combined)
last_online :: uint [R] At what tick this player was last online.
permission_group :: LuaPermissionGroup [RW] The permission group this player is part of or nil if not part of any group.
mod_settings [R]
ticks_to_respawn :: uint [RW] The number of ticks until this player will respawn or nil if not waiting to respawn.
display_resolution :: DisplayResolution [R] The display resolution for this player.
display_scale :: double [R] The display scale for this player.
blueprint_to_setup :: LuaItemStack [R] The item stack containing a blueprint to be setup.
render_mode :: defines.render_mode [R] The render mode of the player, like map or zoom to world.
spectator :: 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.
zoom :: double [W] The player's zoom-level.
map_view_settings :: MapViewSettings [W] The player's map view settings.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaProfiler - sort
reset() Resets the clock, also restarting it.
stop() Stops the clock.
restart() Start the clock again, without resetting it.
divide(number) Divides the current duration by a set value.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRCON - sort
print(message) Print text to the calling RCON interface if any.
class LuaRailPath - sort
size :: uint [R] The total number of rails in this path.
current :: uint [R] The current rail index.
total_distance :: double [R] The total path distance.
travelled_distance :: double [R] The total distance travelled.
rails :: CustomDictionary uintLuaEntity [R] The rails this path travels.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRandomGenerator - sort
operator ()(lower, upper) → double Generates a random number.
re_seed(seed) Re-seeds the random generator with the given value.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRecipe - sort
reload() Reload the recipe from the prototype.
name :: string [R] Name of the recipe.
localised_name :: LocalisedString [R] Localised name of the recipe.
localised_description :: LocalisedString [R]
prototype :: LuaRecipePrototype [R] The prototype for this recipe.
enabled :: boolean [RW] Can the recipe be used?
category :: string [R] Category of the recipe.
ingredients :: array of Ingredient [R] Ingredients for this recipe.
products :: array of Product [R] The results of this recipe.
hidden :: boolean [R] Is the recipe hidden?
hidden_from_flow_stats :: boolean [RW] Is the recipe hidden from flow statistics?
energy :: double [R] Energy required to execute this recipe.
order :: string [R] Order string.
group :: LuaGroup [R] Group of this recipe.
subgroup :: LuaGroup [R] Subgroup of this recipe.
force :: LuaForce [R] The force that owns this recipe.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRecipeCategoryPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRecipePrototype - sort
enabled :: boolean [R] If this recipe prototype is enabled by default (enabled at the beginning of a game).
name :: string [R] Name of the recipe.
localised_name :: LocalisedString [R] Localised name of the recipe.
localised_description :: LocalisedString [R]
category :: string [R] Category of the recipe.
ingredients :: array of Ingredient [R] Ingredients for this recipe.
products :: array of Product [R] The results of this recipe.
main_product :: Product [R] The main product of this recipe, nil if no main product is defined.
hidden :: boolean [R] Is the recipe hidden?
hidden_from_flow_stats :: boolean [R] Is the recipe hidden from flow statistics?
hidden_from_player_crafting :: boolean [R] Is the recipe hidden from player crafting?
always_show_made_in :: boolean [R] Should this recipe always show "made-in" in the tooltip?
energy :: double [R] Energy required to execute this recipe.
order :: string [R] Order string.
group :: LuaGroup [R] Group of this recipe.
subgroup :: LuaGroup [R] Subgroup of this recipe.
request_paste_multiplier :: uint [R] The multiplier used when this recipe is copied from an assembling machine to a requester chest.
overload_multiplier :: uint [R] Used to determine how many extra items are put into an assembling machine before it's considered "full enough".
allow_as_intermediate :: boolean [R] If this recipe is enabled for the purpose of intermediate hand-crafting.
allow_intermediates :: boolean [R] If this recipe is allowed to use intermediate recipes when hand-crafting.
show_amount_in_title :: boolean [R] If the amount is shown in the recipe tooltip title when the recipe produces more than 1 product.
always_show_products :: boolean [R] If the products are always shown in the recipe tooltip.
emissions_multiplier :: double [R] The emissions multiplier for this recipe.
allow_decomposition :: boolean [R] If this recipe is allowed to be broken down for "total-raw" calculations.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaRemote - sort
add_interface(name, functions) Add a remote interface.
remove_interface(name) → boolean Removes an interface with the given name.
call(interface, function, ...) → Anything Call a function of an interface.
interfaces :: dictionary stringdictionary stringboolean [R] List of all registered interfaces.
class LuaRendering - sort
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=…, 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 polygon.
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 of 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.
get_surface(id) → LuaSurface The surface the object with this id is rendered on.
get_time_to_live(id) → 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.
get_forces(id) → array of 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.
get_players(id) → array of 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.
get_visible(id) → boolean Get whether this is rendered to anyone at all.
set_visible(id, visible) Set whether this is rendered to anyone at all.
get_draw_on_ground(id) → 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.
get_only_in_alt_mode(id) → 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) → ScriptRenderTarget Get from where the line with this id is drawn or nil if this object is not a line.
set_from(id, from, from_offset) Set from where the line with this id is drawn.
get_to(id) → ScriptRenderTarget Get where the line with this id is drawn to or nil if the object is not a line.
set_to(id, to, to_offset) Set where the line with this id is drawn to.
get_dash_length(id) → double Get the dash length of the line with this id or nil if the object is not a line.
set_dash_length(id, dash_length) Set the dash length of the line with this id.
get_gap_length(id) → double Get the length of the gaps in the line with this id or nil if the object is not a line.
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_target(id) → ScriptRenderTarget Get where the object with this id is drawn or nil if the object does not support target.
set_target(id, target, target_offset) Set where the object with this id is drawn.
get_orientation(id) → float Get the orientation of the object with this id or nil if the object is not a text, polygon, sprite, light or animation.
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 or nil if the object is not a text or light.
set_scale(id, scale) Set the scale of the text or light with this id.
get_text(id) → LocalisedString Get the text that is displayed by the text with this id or nil if the object is not a text.
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 or nil if the object is not a text.
set_font(id, font) Set the font of the text with this id.
get_alignment(id) → string Get the alignment of the text with this id or nil if the object is not a text.
set_alignment(id, alignment) Set the alignment of the text with this id.
get_scale_with_zoom(id) → boolean Get if the text with this id scales with player zoom or nil if the object is not a text.
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.
get_filled(id) → boolean Get if the circle or rectangle with this id is filled or nil if the object is not a circle or rectangle.
set_filled(id, filled) Set if the circle or rectangle with this id is filled.
get_radius(id) → double Get the radius of the circle with this id or nil if the object is not a circle.
set_radius(id, radius) Set the radius of the circle with this id.
get_left_top(id) → ScriptRenderTarget Get where top left corner of the rectangle with this id is drawn or nil if the object is not a rectangle.
set_left_top(id, left_top, left_top_offset) Set where top left corner of the rectangle with this id is drawn.
get_right_bottom(id) → ScriptRenderTarget Get where bottom right corner of the rectangle with this id is drawn or nil if the object is not a rectangle.
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.
get_max_radius(id) → double Get the radius of the outer edge of the arc with this id or nil if the object is not a arc.
set_max_radius(id, max_radius) Set the radius of the outer edge of the arc with this id.
get_min_radius(id) → double Get the radius of the inner edge of the arc with this id or nil if the object is not a arc.
set_min_radius(id, min_radius) Set the radius of the inner edge of the arc with this id.
get_start_angle(id) → float Get where the arc with this id starts or nil if the object is not a arc.
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 or nil if the object is not a arc.
set_angle(id, angle) Set the angle of the arc with this id.
get_vertices(id) → array of ScriptRenderTarget Get the vertices of the polygon with this id or nil if the object is not a polygon.
set_vertices(id, vertices) Set the vertices of the polygon with this id.
get_sprite(id) → SpritePath Get the sprite of the sprite or light with this id or nil if the object is not a sprite or light.
set_sprite(id, sprite) Set the sprite of the sprite or light with this id.
get_x_scale(id) → double Get the horizontal scale of the sprite or animation with this id or nil if the object is not a sprite or animation.
set_x_scale(id, x_scale) Set the horizontal scale of the sprite or animation with this id.
get_y_scale(id) → double Get the vertical scale of the sprite or animation with this id or nil if the object is not a sprite or animation.
set_y_scale(id, y_scale) Set the vertical scale of the sprite or animation with this id.
get_render_layer(id) → RenderLayer Get the render layer of the sprite or animation with this id or nil if the object is not a sprite or animation.
set_render_layer(id, render_layer) Set the render layer of the sprite or animation with this id.
get_orientation_target(id) → ScriptRenderTarget 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.
get_oriented_offset(id) → 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.
get_intensity(id) → float Get the intensity of the light with this id or nil if the object is not a light.
set_intensity(id, intensity) Set the intensity of the light with this id.
get_minimum_darkness(id) → float Get the minimum darkness at which the light with this id is rendered or nil if the object is not a light.
set_minimum_darkness(id, minimum_darkness) Set the minimum darkness at which the light with this id is rendered.
get_oriented(id) → boolean Get if the light with this id is rendered has the same orientation as the target entity or nil if the object is not a light.
set_oriented(id, oriented) Set if the light with this id is rendered has the same orientation as the target entity.
get_animation(id) → string Get the animation prototype name of the animation with this id or nil if the object is not an animation.
set_animation(id, animation) Set the animation prototype name of the animation with this id.
get_animation_speed(id) → double Get the animation speed of the animation with this id or nil if the object is not an animation.
set_animation_speed(id, animation_speed) Set the animation speed of the animation with this id.
get_animation_offset(id) → double Get the animation offset of the animation with this id or nil if the object is not an animation.
set_animation_offset(id, animation_offset) Set the animation offset of the animation with this id.
class LuaResourceCategoryPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaSettings - sort
get_player_settings(player)
startup :: CustomDictionary stringModSetting [R]
global :: CustomDictionary stringModSetting [R]
player :: CustomDictionary stringModSetting [R]
class LuaShortcutPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
action :: string [R]
item_to_create :: LuaItemPrototype [R]
technology_to_unlock :: LuaTechnologyPrototype [R]
toggleable :: boolean [R]
associated_control_input :: string [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaStyle - sort
gui :: LuaGui [R] Gui of the LuaGuiElement of this style.
name :: string [R] Name of this style.
minimal_width :: int [RW]
maximal_width :: int [RW]
minimal_height :: int [RW]
maximal_height :: int [RW]
natural_width :: int [RW]
natural_height :: int [RW]
top_padding :: int [RW]
right_padding :: int [RW]
bottom_padding :: int [RW]
left_padding :: int [RW]
top_margin :: int [RW]
right_margin :: int [RW]
bottom_margin :: int [RW]
left_margin :: int [RW]
horizontal_align :: string [RW] Horizontal align of the inner content of the widget, possible values are "left", "center" or "right"
vertical_align :: string [RW] Vertical align of the inner content of the widget, possible values are "top", "center" or "bottom"
font_color :: Color [RW]
font :: string [RW]
top_cell_padding :: int [RW] Space between the table cell contents top and border.
right_cell_padding :: int [RW] Space between the table cell contents right and border.
bottom_cell_padding :: int [RW] Space between the table cell contents bottom and border.
left_cell_padding :: int [RW] Space between the table cell contents left and border.
horizontally_stretchable :: boolean [RW] If the GUI element stretches its size horizontally to other elements.
vertically_stretchable :: boolean [RW] If the GUI element stretches its size vertically to other elements.
horizontally_squashable :: boolean [RW] If the GUI element can be squashed (by maximal with of some parent element) horizontally.
vertically_squashable :: boolean [RW] If the GUI element can be squashed (by maximal height of some parent element) vertically.
hovered_font_color :: Color [RW]
clicked_font_color :: Color [RW]
disabled_font_color :: Color [RW]
pie_progress_color :: Color [RW]
clicked_vertical_offset :: int [RW]
selected_font_color :: Color [RW]
selected_hovered_font_color :: Color [RW]
selected_clicked_font_color :: Color [RW]
strikethrough_color :: Color [RW]
horizontal_spacing :: int [RW] Horizontal space between individual cells.
vertical_spacing :: int [RW] Vertical space between individual cells.
use_header_filler :: boolean [RW]
color :: Color [RW]
column_alignments :: CustomArray of Alignment [R] Alignments of columns of the table
single_line :: boolean [RW]
extra_padding_when_activated :: int [RW]
extra_top_margin_when_activated :: int [RW]
extra_bottom_margin_when_activated :: int [RW]
extra_left_margin_when_activated :: int [RW]
extra_right_margin_when_activated :: int [RW]
stretch_image_to_widget_size :: boolean [RW]
badge_font :: string [RW]
badge_horizontal_spacing :: int [RW]
default_badge_font_color :: Color [RW]
selected_badge_font_color :: Color [RW]
disabled_badge_font_color :: Color [RW]
width :: int [W] Sets both minimal and maximal width to the given value
height :: int [W] Sets both minimal and maximal height to the given value
padding :: int [W] Sets top/right/bottom/left paddings to this value.
margin :: int [W] Sets top/right/bottom/left margins to this value.
cell_padding :: int [W] Space between the table cell contents and border.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaSurface - sort
get_pollution(position) → double Get the pollution for a given position.
can_place_entity{name=…, position=…, direction=…, force=…, build_check_type=…, forced=…} → 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 of LuaEntity Find entities in a given area.
find_entities_filtered{area=…, position=…, radius=…, name=…, type=…, ghost_name=…, ghost_type=…, direction=…, collision_mask=…, force=…, limit=…, invert=…} → array of LuaEntity Find entities of given type or name in a given area.
find_tiles_filtered{area=…, position=…, radius=…, name=…, limit=…, has_hidden_tile=…, collision_mask=…} → array of LuaTile Find tiles of a given name in a given area.
count_entities_filtered{area=…, position=…, radius=…, name=…, type=…, ghost_name=…, ghost_type=…, direction=…, collision_mask=…, force=…, limit=…, invert=…} → uint Count entities of given type or name in a given area.
count_tiles_filtered{area=…, position=…, radius=…, name=…, limit=…, has_hidden_tile=…, collision_mask=…} → uint Count tiles of a given name in a given area.
find_non_colliding_position(name, center, radius, precision, force_to_tile_center) → Position Find a non-colliding position within a given radius.
find_non_colliding_position_in_box(name, search_space, precision, force_to_tile_center) → Position Find a non-colliding position within a given rectangle.
spill_item_stack(position, items, enable_looted, force, allow_belts) Spill items on the ground centered at a given location.
find_enemy_units(center, radius, force) → array of LuaEntity Find enemy units of a given force within an area.
find_units{area=…, force=…, condition=…} → array of LuaEntity Find units of a given force and force condition within a given area.
find_nearest_enemy{position=…, max_distance=…, force=…} → LuaEntity Find the enemy unit 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=…} → LuaEntity Create an entity on this surface.
create_trivial_smoke{name=…, position=…}
create_unit_group{position=…, force=…} → LuaUnitGroup 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) Set tiles at specified locations.
pollute(source, amount) Spawn pollution at the given position.
get_chunks() → LuaChunkIterator 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.
force_generate_chunk_requests() 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_logistic_network_by_position(position, force) → LuaLogisticNetwork Find the logistic network that covers a given position.
find_logistic_networks_by_construction_area(position, force) → array of 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 or nil if there isn't one for the given position.
set_hidden_tile(position, tile)
get_connected_tiles(position, tiles) → array of Position 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=…, 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=…, limit=…, invert=…} → array of DecorativeResult Find decoratives of a given name in a given area.
get_trains(force) → array of LuaTrain
clear_pollution() Clears all pollution on this surface.
play_sound{path=…, position=…, volume_modifier=…} → boolean Plays a sound on this surface.
get_resource_counts() → dictionary stringuint Gets the resource amount of all resources on this surface
get_random_chunk() → ChunkPosition 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=…, expand_map=…} Clones the given area.
clone_entities{entities=…, destination_offset=…, destination_surface=…, destination_force=…, snap_to_grid=…} 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 Starts a path find request without actually ordering a unit to move.
get_script_areas(name) → array of ScriptArea Gets the script areas that match the given name or if no name is given all areas are returned.
get_script_positions(name) → array of ScriptPosition Gets the script positions that match the given name or if no name is given all positions are returned.
get_map_exchange_string() → string Gets the map exchange string for the current map generation settings of this surface.
get_starting_area_radius() → 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(opts) → array of LuaEntity Gets train stops matching the given filters.
get_total_pollution() → 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 stringarray of double
name :: string [RW] The name of this surface.
index :: uint [R] Unique ID associated with this surface.
map_gen_settings :: MapGenSettings [RW] The generation settings for the surface.
always_day :: boolean [RW] When set to true, the sun will always shine.
daytime :: float [RW] Current time of day, as a number in range [0, 1).
darkness :: float [R] Amount of darkness at the current time.
wind_speed :: float [RW] Current wind speed.
wind_orientation :: float [RW] Current wind direction.
wind_orientation_change :: float [RW] Change in wind orientation per tick.
peaceful_mode :: boolean [RW] Is peaceful mode enabled on this surface?
freeze_daytime :: boolean [RW] True if daytime is currently frozen.
ticks_per_day :: uint [RW] The number of ticks per day for this surface.
dusk :: double [RW] The daytime when dusk starts.
dawn :: double [RW] The daytime when dawn starts.
evening :: double [RW] The daytime when evening starts.
morning :: double [RW] The daytime when morning starts.
solar_power_multiplier :: double [RW] The multiplier of solar power on this surface.
min_brightness :: double [RW] The minimal brightness during the night.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTechnology - sort
reload() Reload this technology from its prototype.
force :: LuaForce [R] The force this technology belongs to.
name :: string [R] Name of this technology.
localised_name :: LocalisedString [R] Localised name of this technology.
localised_description :: LocalisedString [R]
prototype :: LuaTechnologyPrototype [R] The prototype of this technology.
enabled :: boolean [RW] Can this technology be researched?
visible_when_disabled :: boolean [RW] If this technology will be visible in the research GUI even though it is disabled.
upgrade :: boolean [R] Is this an upgrade-type research?
researched :: boolean [RW] Has this technology been researched?
prerequisites :: dictionary stringLuaTechnology [R] Prerequisites of this technology.
research_unit_ingredients :: array of Ingredient [R] Ingredients labs will require to research this technology.
effects :: array of Modifier [R] Effects applied when this technology is researched.
research_unit_count :: uint [R] Number of research units required for this technology.
research_unit_energy :: double [R] Amount of energy required to finish a unit of research.
order :: string [R] Order string for this prototype.
level :: uint [RW] The current level of this technology.
research_unit_count_formula :: string [R] The count formula used for this infinite research or nil if this isn't an infinite research.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTechnologyPrototype - sort
name :: string [R] Name of this technology.
localised_name :: LocalisedString [R] Localised name of this technology.
localised_description :: LocalisedString [R]
enabled :: boolean [R] If this technology prototype is enabled by default (enabled at the beginning of a game).
hidden :: boolean [R] If this technology prototype is hidden.
visible_when_disabled :: boolean [R] If this technology will be visible in the research GUI even though it is disabled.
upgrade :: boolean [R] If the is technology prototype is an upgrade to some other technology.
prerequisites :: dictionary stringLuaTechnologyPrototype [R] Prerequisites of this technology.
research_unit_ingredients :: array of Ingredient [R] Ingredients labs will require to research this technology.
effects :: array of Modifier [R] Effects applied when this technology is researched.
research_unit_count :: uint [R] Number of research units required for this technology.
research_unit_energy :: double [R] Amount of energy required to finish a unit of research.
order :: string [R] Order string for this prototype.
level :: uint [R] The level of this research.
max_level :: uint [R] The max level of this research.
research_unit_count_formula :: string [R] The count formula used for this infinite research or nil if this isn't an infinite research.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTile - sort
collides_with(layer) → boolean What type of things can collide with this tile?
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.
name :: string [R] Prototype name of this tile.
prototype :: LuaTilePrototype [R]
position :: Position [R] The position this tile references.
hidden_tile :: string (optional) [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTilePrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
collision_mask :: dictionary stringboolean [R] The collision mask this tile uses The boolean values for each item are meaningless and will always be true.
layer :: uint [R]
autoplace_specification :: AutoplaceSpecification [R] Autoplace specification for this prototype.
walking_speed_modifier :: float [R]
vehicle_friction_modifier :: float [R]
map_color :: Color [R]
decorative_removal_probability :: float [R] The probability that decorative entities will be removed from on top of this tile when this tile is generated.
automatic_neighbors :: boolean [R]
allowed_neighbors :: dictionary stringLuaTilePrototype [R]
needs_correction :: boolean [R] If this tile needs correction logic applied when it's generated in the world.
mineable_properties :: table [R] It is a table:
next_direction :: LuaTilePrototype [R] The next direction of this tile or nil - used when a tile has multiple directions (such as hazard concrete)
items_to_place_this :: array of SimpleItemStack [R] Items that when placed will produce this tile.
can_be_part_of_blueprint :: boolean [R] False if this tile is not allowed in blueprints regardless of the ability to build it.
emissions_per_second :: double [R] Amount of pollution emissions per tick this tile will absorb.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTrain - sort
get_item_count(item) → uint Get the amount of a particular item stored in the train.
get_contents() → 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_items_inside() Clear all items in this train.
recalculate_path(force) → 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.
get_fluid_contents() → 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.
clear_fluids_inside() Clears all fluids in this train.
go_to_station(index) Go to the station specified by the index in the train's schedule.
get_rails() → array of LuaEntity Gets all rails under the train.
manual_mode :: boolean [RW] When true, the train is explicitly controlled by the player or script.
speed :: double [RW] Current speed.
max_forward_speed :: double [R] Current max speed when moving forward, depends on locomotive prototype and fuel.
max_backward_speed :: double [R] Current max speed when moving backwards, depends on locomotive prototype and fuel.
weight :: double [R] The weight of this train.
carriages :: array of LuaEntity [R] Rolling stocks the train is composed of.
locomotives :: dictionary stringarray of LuaEntity [R] Arrays of locomotives.
cargo_wagons :: array of LuaEntity [R] The cargo carriages the train contains.
fluid_wagons :: array of LuaEntity [R] The fluid carriages the train contains.
schedule :: TrainSchedule [RW] The trains current schedule or nil if empty.
state :: defines.train_state [R] This train's current state.
front_rail :: LuaEntity [R] The rail at the front end of the train, possibly nil.
back_rail :: LuaEntity [R] The rail at the back end of the train, possibly nil.
rail_direction_from_front_rail :: defines.rail_direction [R]
rail_direction_from_back_rail :: defines.rail_direction [R]
front_stock :: LuaEntity [R] The front stock of this train or nil.
back_stock :: LuaEntity [R] The back stock of this train or nil.
station :: LuaEntity [R] The train stop this train is stopped at or nil.
has_path :: boolean [R] If this train has a path.
path_end_rail :: LuaEntity [R] The destination rail this train is currently pathing to or nil.
path_end_stop :: LuaEntity [R] The destination train stop this train is currently pathing to or nil.
id :: uint [R] The unique train ID.
passengers :: array of LuaPlayer [R] The player passengers on the train
riding_state :: RidingState [R] The riding state of this train.
killed_players :: dictionary uintuint [R] The players killed by this train.
kill_count :: uint [R] The total number of kills by this train.
path :: LuaRailPath [R] The path this train is using or nil if none.
signal :: LuaEntity [R] The signal this train is arriving or waiting at or nil if none.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTransportLine - sort
clear() Remove all items from this transport line.
get_item_count(item) → uint Count some or all items on this line.
remove_item(items) → uint Remove some items from this line.
can_insert_at(position) → boolean Can an item be inserted at a given position?
can_insert_at_back() → boolean Can an item be inserted at the back of this line?
insert_at(position, items) → boolean Insert items at a given position.
insert_at_back(items) → boolean Insert items at the back of this line.
get_contents() → dictionary stringuint Get counts of all items on this line.
line_equals(other) → boolean Returns whether the associated internal transport line of this line is the same as the others associated internal transport line.
operator # :: uint [R] Get the number of items on this transport line.
owner :: LuaEntity [R] The entity this transport line belongs to.
output_lines :: array of LuaTransportLine [R] The transport lines that this transport line outputs items to or an empty table if none.
input_lines :: array of LuaTransportLine [R] The transport lines that this transport line is fed by or an empty table if none.
operator [] :: LuaItemStack [R] The indexing operator.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaTrivialSmokePrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
color :: Color [R]
start_scale :: double [R]
end_scale :: double [R]
movement_slow_down_factor :: double [R]
duration :: uint [R]
spread_duration :: uint [R]
fade_away_duration :: uint [R]
fade_in_duration :: uint [R]
glow_fade_away_duration :: uint [R]
cyclic :: boolean [R]
affected_by_wind :: boolean [R]
show_when_smoke_off :: boolean [R]
glow_animation :: boolean [R]
render_layer :: RenderLayer [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaUnitGroup - sort
add_member(unit) Make a unit a member of this group.
set_command(command) Give this group a command.
set_autonomous() Make this group autonomous.
start_moving() Make the group start moving even if some of its members haven't yet arrived.
destroy() Dissolve this group.
members :: array of LuaEntity [R] Members of this group.
position :: Position [R] Group position.
state :: defines.group_state [R] Whether this group is gathering, moving or attacking.
force :: LuaForce [R] The force of this unit group.
surface :: LuaSurface [R] The surface of this unit group.
group_number :: uint [R] The group number for this unit group.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
class LuaVirtualSignalPrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
special :: boolean [R] If this is a special signal
subgroup :: LuaGroup [R]
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.