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 Allows for the registration of custom console commands.
LuaConstantCombinatorControlBehavior Control behavior for constant combinators.
LuaContainerControlBehavior Control behavior for container entities.
LuaControl This is an abstract base class containing the common functionality between LuaPlayer and entities (see LuaEntity).
LuaControlBehavior The control behavior for an entity.
LuaCustomChartTag A custom tag that shows on the map view.
LuaCustomInputPrototype Prototype of a custom input.
LuaCustomTable Lazily evaluated table.
LuaDamagePrototype Prototype of a damage.
LuaDeciderCombinatorControlBehavior Control behavior for decider combinators.
LuaDecorativePrototype Prototype of an optimized decorative.
LuaElectricEnergySourcePrototype Prototype of an electric energy source.
LuaEntity The primary interface for interacting with entities through the Lua API.
LuaEntityPrototype Prototype of an entity.
LuaEquipment An item in a LuaEquipmentGrid, for example one's power armor.
LuaEquipmentCategoryPrototype Prototype of 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.
LuaFluidEnergySourcePrototype Prototype of a fluid energy source.
LuaFluidPrototype Prototype of a fluid.
LuaFontPrototype Prototype of a font.
LuaForce LuaForce encapsulates data local to each "force" or "faction" of the game.
LuaFuelCategoryPrototype Prototype of a fuel category.
LuaGameScript Main toplevel type, provides access to most of the API though its members.
LuaGenericOnOffControlBehavior An abstract base class for behaviors that support switching the entity on or off based on some condition.
LuaGroup Item group or subgroup.
LuaGui The root of the GUI.
LuaGuiElement An element of a custom GUI.
LuaHeatEnergySourcePrototype Prototype of a heat energy source.
LuaInserterControlBehavior Control behavior for inserters.
LuaInventory A storage of item stacks.
LuaItemPrototype Prototype of an item.
LuaItemStack A reference to an item and count owned by some external entity.
LuaLampControlBehavior Control behavior for lamps.
LuaLazyLoadedValue A lazily loaded value.
LuaLogisticCell Logistic cell of a particular LuaEntity.
LuaLogisticContainerControlBehavior Control behavior for logistic chests.
LuaLogisticNetwork A single logistic network of a given force on a given surface.
LuaLogisticPoint Logistic point of a particular LuaEntity.
LuaMiningDrillControlBehavior Control behavior for mining drills.
LuaModSettingPrototype Prototype of a mod setting.
LuaModuleCategoryPrototype Prototype of a module category.
LuaNamedNoiseExpression Prototype of a named noise expression.
LuaNoiseLayerPrototype Prototype of a noise layer.
LuaParticlePrototype Prototype of an optimized particle.
LuaPermissionGroup A permission group that defines what players in this group are allowed to do.
LuaPermissionGroups All permission groups.
LuaPlayer A player in the game.
LuaProfiler An object used to measure script performance.
LuaProgrammableSpeakerControlBehavior Control behavior for programmable speakers.
LuaRCON An interface to send messages to the calling RCON interface.
LuaRailChainSignalControlBehavior Control behavior for rail chain signals.
LuaRailPath A rail path.
LuaRailSignalControlBehavior Control behavior for rail signals.
LuaRandomGenerator A deterministic random generator independent from the core games random generator that can be seeded and re-seeded at will.
LuaRecipe A crafting recipe.
LuaRecipeCategoryPrototype Prototype of a recipe category.
LuaRecipePrototype A crafting recipe prototype.
LuaRemote Registry of interfaces between scripts.
LuaRendering Allows rendering of geometric shapes, text and sprites in the game world.
LuaResourceCategoryPrototype Prototype of a resource category.
LuaRoboportControlBehavior Control behavior for roboports.
LuaSettings Object containing mod settings of three distinct types: startup, global, and player.
LuaShortcutPrototype Prototype of a shortcut.
LuaStorageTankControlBehavior Control behavior for storage tanks.
LuaStyle Style of a GUI element.
LuaSurface A "domain" of the world.
LuaTechnology One research item.
LuaTechnologyPrototype A Technology prototype.
LuaTile A single "square" on the map.
LuaTilePrototype Prototype of a tile.
LuaTrain A train.
LuaTrainStopControlBehavior Control behavior for train stops.
LuaTransportBeltControlBehavior Control behavior for transport belts.
LuaTransportLine One line on a transport belt.
LuaTrivialSmokePrototype Prototype of a trivial smoke.
LuaUnitGroup A collection of units moving and attacking together.
LuaVirtualSignalPrototype Prototype of a virtual signal.
LuaVoidEnergySourcePrototype Prototype of a void energy source.
LuaWallControlBehavior Control behavior for walls.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaBootstrap - sort
on_init(f) Register a callback to be run on mod initialization.
on_load(f) Register a function to be run on save load.
on_configuration_changed(f) Register a function to be run when mod configuration changes.
on_event(event, f, filters) Register a handler to run on the specified event(s).
on_nth_tick(tick, f) Register a handler to run every nth-tick(s).
register_on_entity_destroyed(entity) → uint64 Registers an entity so that after it's destroyed, on_entity_destroyed is called.
generate_event_name() → uint Generate a new, unique event ID that can be used to raise custom events with LuaBootstrap::raise_event.
get_event_handler(event) → function(EventData) Find the event handler for an event.
get_event_order() → string Gets the mod event order as a string.
set_event_filter(event, filters) Sets the filters for the given event.
get_event_filter(event) → array[EventFilter] Gets the filters for the given event.
raise_event(event, data) Raise an event.
raise_console_chat{player_index = …, message = …} Raises on_console_chat with the given parameters.
raise_player_crafted_item{item_stack = …, player_index = …, recipe = …} Raises on_player_crafted_item with the given parameters.
raise_player_fast_transferred{player_index = …, entity = …, from_player = …} Raises on_player_fast_transferred with the given parameters.
raise_biter_base_built{entity = …} Raises on_biter_base_built with the given parameters.
raise_market_item_purchased{player_index = …, market = …, offer_index = …, count = …} Raises on_market_item_purchased with the given parameters.
raise_script_built{entity = …} Raises script_raised_built with the given parameters.
raise_script_destroy{entity = …} Raises script_raised_destroy with the given parameters.
raise_script_revive{entity = …, tags = …} Raises script_raised_revive with the given parameters.
raise_script_set_tiles{surface_index = …, tiles = …} Raises script_raised_set_tiles with the given parameters.
mod_name :: string [R] The name of the mod from the environment this is used in.
level :: table [R] Information about the currently running scenario/campaign/tutorial.
active_mods :: dictionary[stringstring] [R] A dictionary listing the names of all currently active mods and mapping them to their version.
object_name :: string [R] This object's name.
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?
object_name :: string [R] The class name of this object.
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[SmokeSource] [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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaChunkIterator - sort
operator ()() → ChunkPositionAndArea Get the next chunk position or nil, and increments the iterator.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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[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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaCommandProcessor - sort
add_command(name, help, function) Add a custom console command.
remove_command(name) → boolean Remove a custom console command.
commands :: dictionary[stringLocalisedString] [R] Lists the custom commands registered by scripts through LuaCommandProcessor.
game_commands :: dictionary[stringLocalisedString] [R] Lists the built-in commands of the core game.
object_name :: string [R] This object's name.
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.
is_flashlight_enabled() Is the flashlight enabled.
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{index = …, count = …} Cancels crafting the given count of the given crafting queue index.
mine_entity(entity, force) → boolean Mines the given entity as if this player (or character) mined it.
mine_tile(tile) → boolean Mines the given tile as if this player (or character) mined it.
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.
set_personal_logistic_slot(slot_index, value) → boolean Sets a personal logistic request and auto-trash slot to the given value.
set_vehicle_logistic_slot(slot_index, value) → boolean Sets a vehicle logistic request and auto-trash slot to the given value.
get_personal_logistic_slot(slot_index) → PersonalLogisticParameters Gets the parameters of a personal logistic request and auto-trash slot.
get_vehicle_logistic_slot(slot_index) → PersonalLogisticParameters Gets the parameters of a vehicle logistic request and auto-trash slot.
clear_personal_logistic_slot(slot_index)
clear_vehicle_logistic_slot(slot_index)
is_cursor_blueprint() → boolean Returns whether the player is holding a blueprint, it takes into account a blueprint as an item as well as blueprint from the blueprint record from the blueprint library.
get_blueprint_entities() → array[BlueprintEntity] Gets the entities that are part of the currently selected blueprint, regardless of it being in a blueprint book or picked from the blueprint library.
is_cursor_empty() → boolean Returns whether the player is holding something in the cursor.
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 :: ForceIdentification [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.
crafting_queue_progress :: double [R] The crafting queue progress [0-1] 0 when no recipe is being crafted.
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 :: ItemPrototypeIdentification [RW] The ghost prototype in the player's cursor.
driving :: boolean [RW] true if the player is in a vehicle.
crafting_queue :: array[CraftingQueueItem] [R] Gets the current crafting queue items.
following_robots :: array[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[string] [RW]
character_running_speed_modifier :: double [RW] Modifies the running speed of this character by the given value as a percentage.
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_trash_slot_count_bonus :: uint [RW]
character_maximum_following_robot_count_bonus :: uint [RW]
character_health_bonus :: float [RW]
character_personal_logistic_requests_enabled :: boolean [RW] If personal logistic requests are enabled for this character or players character.
vehicle_logistic_requests_enabled :: boolean [RW] If personal logistic requests are enabled for this vehicle (spidertron).
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?
object_name :: string [R] The class name of this object.
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[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 :: array[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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaContainerControlBehavior extends LuaControlBehavior - sort
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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 :: CircuitConditionDefinition [RW] The circuit condition.
logistic_condition :: CircuitConditionDefinition [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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaProgrammableSpeakerControlBehavior extends LuaControlBehavior - sort
circuit_parameters :: ProgrammableSpeakerCircuitParameters [RW]
circuit_condition :: CircuitConditionDefinition [RW]
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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 :: CircuitConditionDefinition [RW] The circuit condition when controlling the signal through the circuit network.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaRoboportControlBehavior extends LuaControlBehavior - sort
read_logistics :: boolean [RW] true if the roboport should report the logistics network content to the circuit network.
read_robot_stats :: boolean [RW] true if the roboport should report the robot statistics to the circuit network.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaStorageTankControlBehavior extends LuaControlBehavior - sort
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaWallControlBehavior extends LuaControlBehavior - sort
circuit_condition :: CircuitConditionDefinition [RW] The circuit condition.
open_gate :: boolean [RW]
read_sensor :: boolean [RW]
output_signal :: SignalID [RW]
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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[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?
object_name :: string [R] The class name of this object.
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.
set_trains_limit :: boolean [RW] true if the trains_limit_signal is used to set a limit of trains incoming for train stop.
read_trains_count :: boolean [RW] true if the train stop should send amount of incoming trains 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.
trains_count_signal :: SignalID [RW] The signal that will be sent when using the read-trains-count option.
trains_limit_signal :: SignalID [RW] The signal to be used by set-trains-limit to limit amount of incoming trains
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaCustomChartTag - sort
destroy() Destroys this tag.
icon :: SignalID [RW] This tag's icon, if it has one.
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?
object_name :: string [R] The class name of this object.
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".
action :: string [R] The action that happens when this custom input is triggered.
enabled :: boolean [R] If this custom input is enabled.
enabled_while_spectating :: boolean [R] If this custom input is enabled while using the spectator controller.
enabled_while_in_cutscene :: boolean [R] If this custom input is enabled while using the cutscene controller.
include_selected_prototype :: boolean [R] If this custom input will include the selected prototype (if any) when triggered.
item_to_spawn :: LuaItemPrototype [R] The item that gets spawned when this custom input is fired or nil.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaCustomTable - sort
operator [] :: Any [RW] Access an element of this custom table.
operator # :: uint [R] Number of elements in this table.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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.
collision_mask :: CollisionMask [R] The collision masks this decorative uses
collision_mask_with_flags :: CollisionMaskWithFlags [R]
autoplace_specification :: AutoplaceSpecification [R] Autoplace specification for this decorative prototype.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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, dealer) → float Damages the entity.
can_be_destroyed() → boolean Checks if the entity can be destroyed
destroy{do_cliff_correction = …, raise_destroy = …} → boolean Destroys the entity.
set_command(command) Give the entity a command.
set_distraction_command(command) Give the entity a distraction 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[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 a circuit wire or copper cable.
disconnect_neighbour(target) Disconnect circuit wires or copper cables between devices.
order_deconstruction(force, player) → boolean Sets the entity to be deconstructed by construction robots.
cancel_deconstruction(force, player) Cancels deconstruction if it is scheduled, does nothing otherwise.
to_be_deconstructed() → boolean Is this entity marked for deconstruction?
order_upgrade{force = …, target = …, player = …, direction = …} → boolean Sets the entity to be upgraded by construction robots.
cancel_upgrade(force, player) → boolean Cancels upgrade if it is scheduled, does nothing otherwise.
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) → boolean Set a logistic requester slot.
clear_request_slot(slot) Clear a logistic requester slot.
is_crafting() Returns whether a craft is currently in process.
is_opened() → boolean
is_opening() → boolean
is_closed() → boolean
is_closing() → boolean
request_to_open(force, extra_time)
request_to_close(force)
get_transport_line(index) → LuaTransportLine Get a transport line of a belt or belt connectable entity.
get_max_transport_line_index() → uint Get the maximum transport line index of a belt or belt connectable entity.
launch_rocket() → boolean
revive{return_item_request_proxy = …, raise_revive = …} → dictionary[stringuint] Revive a ghost.
silent_revive{return_item_request_proxy = …, raise_revive = …} → dictionary[stringuint] Revives a ghost silently.
get_connected_rail{rail_direction = …, rail_connection_direction = …} → LuaEntity
get_connected_rails() → array[LuaEntity] Get the rails that this signal is connected to.
get_rail_segment_entity(direction, in_else_out) → LuaEntity Get the rail signal or train stop at the start/end of the rail segment this rail is in, or nil if the rail segment doesn't start/end with a signal nor a train stop.
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[LuaEntity] Get a rail from each rail segment that overlaps with this rail's rail segment.
get_filter(slot_index) → string Get the filter for a slot in an inserter, loader, or logistic storage container.
set_filter(slot_index, item) Set the filter for a slot in an inserter, loader, or logistic storage container.
get_infinity_container_filter(index) → InfinityInventoryFilter Gets the filter for this infinity container at the given index or nil if the filter index doesn't exist or is empty.
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_signal(signal, circuit_connector) → int Read a single signal from the combined circuit networks.
get_merged_signals(circuit_connector) → array[Signal] The merged circuit network signals or nil if there are no signals.
supports_backer_name() → boolean Whether this entity supports a backer name.
copy_settings(entity, by_player) → dictionary[stringuint] Copies settings from the given entity onto this entity.
get_logistic_point(index) → LuaLogisticPoint or array[LuaLogisticPoint] Gets all the LuaLogisticPoints that 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{reverse = …, by_player = …, spill_items = …, enable_looted = …, force = …} → 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 or spidertron if any.
set_passenger(passenger) Sets the passenger of this car or spidertron.
is_connected_to_electric_network() → boolean Returns true if this entity is connected to an electric network.
get_train_stop_trains() → array[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 = …, create_build_effect_smoke = …} → 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.
get_upgrade_target() → LuaEntityPrototype Returns the new entity prototype.
get_upgrade_direction() → defines.direction Returns the new entity direction after upgrading.
get_damage_to_be_taken() → float Returns the amount of damage to be taken by this entity.
deplete() Depletes and destroys this resource entity.
mine{inventory = …, force = …, raise_destroyed = …, ignore_minable = …} → boolean Mines this entity.
spawn_decorations() Triggers spawn_decoration actions defined in the entity prototype or does nothing if entity is not "turret" or "unit-spawner".
can_wires_reach(entity) → boolean Can wires reach between these entities.
get_connected_rolling_stock(direction) → LuaEntity Gets rolling stock connected to the given end of this stock
is_registered_for_construction() → boolean Is this entity or tile ghost or item request proxy registered for construction?
is_registered_for_deconstruction(force) → boolean Is this entity registered for deconstruction with this force?
is_registered_for_upgrade() → boolean Is this entity registered for upgrade?
is_registered_for_repair() → boolean Is this entity registered for repair?
add_autopilot_destination(position) Adds the given position to this spidertron's autopilot's queue of destinations.
connect_linked_belts(neighbour) Connects current linked belt with another one.
disconnect_linked_belts() Disconnects linked belt from its neighbour.
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] The current health of the entity, or nil if it doesn't have health.
direction :: defines.direction [RW] The current direction this entity is facing.
supports_direction :: boolean [R] Whether the entity has direction.
orientation :: RealOrientation [RW] The smooth orientation of this entity, if it supports orientation.
cliff_orientation :: CliffOrientation [R] The orientation of this cliff.
relative_turret_orientation :: RealOrientation [RW] The relative orientation of the vehicle turret, artillery turret, artillery wagon or nil if this entity isn't a vehicle with a vehicle turret or artillery turret/wagon.
torso_orientation :: RealOrientation [RW] The torso orientation of this spider vehicle.
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.
driver_is_gunner :: boolean [RW] Whether the driver of this car or spidertron is the gunner, if false, the passenger is the gunner.
vehicle_automatic_targeting_parameters :: VehicleAutomaticTargetingParameters [RW] Read when this spidertron auto-targets enemies
speed :: float [RW] The current speed of this car in tiles per tick, rolling stock, projectile or spider vehicle, or current max speed of the unit.
effective_speed :: float [R] The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the tile the unit is standing on.
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, car, or spidertron, or nil if the car/spidertron 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[LuaEntity]] or array[array[LuaEntity]] or LuaEntity [R]
belt_neighbours :: dictionary[stringarray[LuaEntity]] [R] The belt connectable neighbours of this belt connectable entity.
fluidbox :: LuaFluidBox [RW] Fluidboxes of this entity.
backer_name :: string [RW] The backer name assigned to this entity, or nil if this entity doesn't support backer names.
entity_label :: string [RW] The label of this entity if it has one or nil.
time_to_live :: uint [RW] The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
color :: Color [RW] The character, rolling stock, train stop, car, spider-vehicle, flying text, corpse 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].
productivity_bonus :: double [R] The productivity bonus of this entity.
pollution_bonus :: double [R] The pollution bonus of this entity.
speed_bonus :: double [R] The speed bonus of this entity.
consumption_bonus :: double [R] The consumption bonus of this entity.
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 [RW] 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 last player that changed any setting on this 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 that are directly connected to this entity via the circuit network.
circuit_connection_definitions :: array[CircuitConnectionDefinition] [R] The connection definition for entities that are directly connected to this entity via the circuit network.
request_slot_count :: uint [R] The index of the configured request with the highest index for this entity.
filter_slot_count :: uint [R] The number of filter slots this inserter, loader, or logistic storage container 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.
tree_gray_stage_index :: uint8 [RW] Index of the tree gray stage
tree_gray_stage_index_max :: uint8 [R] Maximum index of the tree gray 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[LuaEntity] [R] The sticker entities attached to this entity or nil if none.
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] The number of products this machine finished crafting in its lifetime.
spawner :: LuaEntity [R] The spawner associated with this unit entity or nil if the unit has no associated spawner.
units :: array[LuaEntity] [R] The units associated with this spawner entity.
power_switch_state :: boolean [RW] The state of this power switch.
effects :: ModuleEffects [R] The effects being applied to this entity or nil.
infinity_container_filters :: array[InfinityInventoryFilter] [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 [RW] The last tick this character entity was attacked.
tick_of_last_damage :: uint [RW] 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 that's 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.
render_to_forces :: array[ForceIdentification] [RW] The forces that this simple-entity-with-owner, simple-entity-with-force, or flying-text is visible to.
pump_rail_target :: LuaEntity [R] The rail target of this pump or nil.
moving :: boolean [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.
request_from_buffers :: boolean [RW] Whether this requester chest is set to also request from buffer chests.
corpse_expires :: boolean [RW] Whether this corpse will ever fade away.
corpse_immune_to_entity_placement :: boolean [RW] If true, corpse won't be destroyed when entities are placed over it.
tags :: Tags [RW] The tags associated with this entity ghost or nil if not an entity ghost.
command :: Command [R] The command given to this unit or nil is the unit has no command.
distraction_command :: Command [R] The distraction command given to this unit or nil is the unit currently isn't distracted.
time_to_next_effect :: uint [RW] The ticks until the next trigger effect of this smoke-with-trigger.
autopilot_destination :: Position [RW] Destination position of spidertron's autopilot.
autopilot_destinations :: array[Position] [R] The queued destination positions of spidertron's autopilot.
trains_count :: uint [R] Amount of trains related to this particular train stop.
trains_limit :: uint [RW] Amount of trains above which no new trains will be sent to this train stop.
is_entity_with_force :: boolean [R] If this entity is EntityWithForce
is_entity_with_owner :: boolean [R] If this entity is EntityWithOwner
is_entity_with_health :: boolean [R] If this entity is EntityWithHealth
combat_robot_owner :: LuaEntity [RW] The owner of this combat robot if any.
link_id :: uint [RW] The link ID this linked container is using.
follow_target :: LuaEntity [RW] The follow target of this spidertron if any.
follow_offset :: Position [RW] The follow offset of this spidertron if any.
linked_belt_type :: string [RW] Type of linked belt: it is either "input" or "output".
linked_belt_neighbour :: LuaEntity [R] Neighbour to which this linked belt is connected to.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
Inherited from LuaControl: get_inventory, get_main_inventory, can_insert, insert, set_gui_arrow, clear_gui_arrow, get_item_count, has_items_inside, can_reach_entity, clear_items_inside, remove_item, teleport, update_selected_entity, clear_selected_entity, disable_flashlight, enable_flashlight, is_flashlight_enabled, get_craftable_count, begin_crafting, cancel_crafting, mine_entity, mine_tile, is_player, open_technology_gui, set_personal_logistic_slot, set_vehicle_logistic_slot, get_personal_logistic_slot, get_vehicle_logistic_slot, clear_personal_logistic_slot, clear_vehicle_logistic_slot, is_cursor_blueprint, get_blueprint_entities, is_cursor_empty, surface, position, vehicle, force, selected, opened, crafting_queue_size, crafting_queue_progress, walking_state, riding_state, mining_state, shooting_state, picking_state, repair_state, cursor_stack, cursor_ghost, driving, crafting_queue, following_robots, cheat_mode, character_crafting_speed_modifier, character_mining_speed_modifier, character_additional_mining_categories, character_running_speed_modifier, character_build_distance_bonus, character_item_drop_distance_bonus, character_reach_distance_bonus, character_resource_reach_distance_bonus, character_item_pickup_distance_bonus, character_loot_pickup_distance_bonus, character_inventory_slots_bonus, character_trash_slot_count_bonus, character_maximum_following_robot_count_bonus, character_health_bonus, character_personal_logistic_requests_enabled, vehicle_logistic_requests_enabled, opened_gui_type, build_distance, drop_item_distance, reach_distance, item_pickup_distance, loot_pickup_distance, resource_reach_distance, in_combat, character_running_speed, character_mining_progress
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] Name of the category of this resource or nil when not a resource.
mineable_properties :: table [R] Whether this entity is minable and what can be obtained by mining it.
items_to_place_this :: array[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
collision_mask_with_flags :: CollisionMaskWithFlags [R]
default_collision_mask_with_flags :: CollisionMaskWithFlags [R] The hardcoded default collision mask (with flags) for this entity prototype type.
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 :: dictionary[stringResistance] [R] List of resistances towards each damage type.
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 :: array[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[UnitSpawnDefinition] [R] The result units and spawn points with weight and evolution factor for a biter spawner entity.
attack_result :: array[TriggerItem] [R] The attack result of this entity if the entity has one, else nil.
final_attack_result :: array[TriggerItem] [R] The final attack result for projectiles nil if not a projectile
attack_parameters :: AttackParameters [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 :: uint8 [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[LuaEntityPrototype] [R] The remains left behind when this entity is mined.
additional_pastable_entities :: array[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 :: array[TriggerItem] [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[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 character or mining drill supports, or nil if not a character or 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.
max_energy_production :: double [R] The theoretical maximum energy production for this 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.
air_resistance :: double [R] The air resistance of this rolling stock prototype or nil if not a rolling stock 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 prototype uses or nil.
speed :: double [R] The default speed of this flying robot, rolling stock or unit, nil if not one of these.
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.
heat_energy_source_prototype :: LuaHeatEnergySourcePrototype [R] The heat energy source prototype this entity uses or nil.
fluid_energy_source_prototype :: LuaFluidEnergySourcePrototype [R] The fluid energy source prototype this entity uses or nil.
void_energy_source_prototype :: LuaVoidEnergySourcePrototype [R] The void 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.
allow_burner_leech :: boolean [R] If this inserter allows burner leeching.
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.
inserter_pickup_position :: Vector [R] The pickup position for this inserter or nil.
inserter_drop_position :: Vector [R] The drop position for this inserter or nil.
inserter_chases_belt_items :: boolean [R] True if this inserter chases items on belts for pickup 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 logistic chest 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.
rocket_rising_delay :: uint8 [R] The rocket rising delay for this rocket silo prototype or nil.
launch_wait_time :: uint8 [R] The rocket launch delay for this rocket silo prototype or nil.
light_blinking_speed :: double [R] The light blinking speed for this rocket silo prototype or nil.
door_opening_speed :: double [R] The door opening speed for this rocket silo prototype or nil.
rising_speed :: double [R] The rising speed for this rocket silo rocket prototype or nil.
engine_starting_speed :: double [R] The engine starting speed for this rocket silo rocket prototype or nil.
flying_speed :: double [R] The flying speed for this rocket silo rocket prototype or nil.
flying_acceleration :: double [R] The flying acceleration for this rocket silo rocket 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[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 flying robot 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.
call_for_help_radius :: double [R]
max_count_of_owned_units :: double [R] Count of enemies this spawner can sustain.
max_friends_around_to_spawn :: double [R] How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units.
spawning_radius :: double [R] How far from the spawner can the units be spawned.
spawning_spacing :: double [R] What spaces should be between the spawned units.
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.
rocket_entity_prototype :: LuaEntityPrototype [R] The rocket entity prototype associated with this rocket silo prototype or nil.
has_belt_immunity :: boolean [R] Whether this unit, car, or character prototype has belt immunity, nil if not car, unit, or character 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[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.
terrain_friction_modifier :: float [R] The terrain friction modifier for this vehicle.
allow_passengers :: boolean [R] If this vehicle allows passengers.
max_distance_of_sector_revealed :: uint [R] The radius of the area this radar can chart, in chunks.
max_distance_of_nearby_sector_revealed :: uint [R] The radius of the area constantly revealed by this radar, in chunks.
adjacent_tile_collision_box :: BoundingBox [R] The bounding box that specifies which tiles adjacent to the offshore pump should be checked.
adjacent_tile_collision_mask :: CollisionMask [R] Tiles adjacent to the offshore pump must not collide with this collision mask.
adjacent_tile_collision_test :: CollisionMask [R] If this mask is not empty, tiles adjacent to the offshore pump must not collide with this collision mask.
center_collision_mask :: CollisionMask [R] The collision mask used only for collision test with tile directly at offshore pump position.
grid_prototype :: LuaEquipmentGridPrototype [R] The equipment grid prototype for this entity or nil.
remove_decoratives :: string [R]
related_underground_belt :: LuaEntityPrototype [R]
running_speed :: double [R] Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaEquipmentGrid - sort
take{position = …, equipment = …, by_player = …} → SimpleItemStack Remove an equipment from the grid.
take_all(by_player) → dictionary[stringuint] Remove all equipment from the grid.
clear(by_player) Clear all equipment from the grid, removing it without actually returning it.
put{name = …, position = …, by_player = …} → 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[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?
object_name :: string [R] The class name of this object.
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[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?
object_name :: string [R] The class name of this object.
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 this roboport equipment.
energy_consumption :: double [R]
movement_bonus :: float [R]
energy_source :: LuaElectricEnergySourcePrototype [R] The energy source prototype for the equipment.
equipment_categories :: array[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.
attack_parameters :: AttackParameters [R] The equipment attack parameters or nil.
automatic :: boolean [R] Is this active defense equipment automatic.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaFlowStatistics - sort
get_input_count(name) → uint64 or double Gets the total input count for a given prototype.
set_input_count(name, count) Sets the total input count for a given prototype.
get_output_count(name) → uint64 or double Gets the total output count for a given prototype.
set_output_count(name, count) Sets the total output count for a given prototype.
get_flow_count{name = …, input = …, precision_index = …, count = …} → double Gets the flow count value for the given time frame.
on_flow(name, count) Adds a value to this flow statistics.
clear() Reset all the statistics data to 0.
input_counts :: dictionary[stringuint64 or double] [R] List of input counts indexed by prototype name.
output_counts :: dictionary[stringuint64 or double] [R] List of output counts indexed by prototype name.
force :: LuaForce [R] The force these statistics belong to or nil for pollution statistics.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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[LuaFluidBox] The fluidbox connections for the given fluidbox index.
get_filter(index) → FluidBoxFilter Get a fluid box filter
set_filter(index, filter) → boolean Set a fluid box filter.
get_flow(index) → double Flow through the fluidbox in the last tick.
get_locked_fluid(index) → string Returns the fluid the fluidbox is locked onto Returns 'nil' for no lock
flush(index, fluid) → dictionary[stringfloat] Flushes all fluid from this fluidbox and its fluid system.
operator # :: uint [R] Number of fluid boxes.
owner :: LuaEntity [R] The entity that owns this fluidbox.
operator [] :: Fluid [R] Access, set or clear a fluid box.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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[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[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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaFluidEnergySourcePrototype - sort
emissions :: double [R]
render_no_network_icon :: boolean [R]
render_no_power_icon :: boolean [R]
effectivity :: double [R]
burns_fluid :: boolean [R]
scale_fluid_usage :: boolean [R]
fluid_usage_per_tick :: double [R]
smoke :: array[SmokeSource] [R] The smoke sources for this prototype if any.
maximum_temperature :: double [R]
fluid_box :: LuaFluidBoxPrototype [R] The fluid box for this energy source.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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 this fluid.
max_temperature :: double [R] Maximum temperature this fluid can reach.
heat_capacity :: double [R] The amount of energy in Joules required to heat one unit of this fluid by 1°C.
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] The temperature above which this fluid will be shown as gaseous inside tanks and pipes.
emissions_multiplier :: double [R] A multiplier on the amount of emissions produced when this fluid is burnt in a generator.
fuel_value :: double [R] The amount of energy in Joules one unit of this fluid will produce when burnt in a generator.
hidden :: boolean [R] Whether this fluid is hidden from the fluid and signal selectors.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaFontPrototype - sort
name :: string [R] Name of this prototype.
from :: string [R]
size :: int [R]
spacing :: float [R]
border :: boolean [R]
filtered :: boolean [R]
border_color :: Color [R] The border color or nil if not set.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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) Add other force to this force's cease fire list.
get_cease_fire(other) → boolean Is other force in this force's cease fire list?
set_friend(other, friend) Add other force to this force's friends list.
get_friend(other) → boolean Is other force in this force's friends list.
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[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[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, progress) Sets the saved progress for the given technology.
reset_evolution() Resets evolution for this force to zero.
play_sound{path = …, position = …, volume_modifier = …, override_sound_type = …} Play a sound for every player in this force.
get_train_stops{name = …, surface = …} → array[LuaEntity] Gets train stops matching the given filters.
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.
get_linked_inventory(prototype, link_id) → LuaInventory Gets the linked inventory for the given prototype and link ID if it exists or nil.
is_friend(other) → boolean Is this force a friend?
is_enemy(other) → boolean Is this force an enemy?
name :: string [R] Name of the force.
technologies :: LuaCustomTable[stringLuaTechnology] [R] Technologies owned by this force, indexed by name.
recipes :: LuaCustomTable[stringLuaRecipe] [R] Recipes available to this force, indexed by 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_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[LuaPlayer] [R] Players belonging to this force.
ai_controllable :: boolean [RW] Enables some higher-level AI behaviour for this force.
logistic_networks :: dictionary[stringarray[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] Modifies the running speed of all characters in this force by the given value as a percentage.
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]
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.
character_logistic_requests :: boolean [RW] true if character requester logistics is enabled.
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[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[TechnologyIdentification] [RW] The research queue of this force.
research_enabled :: boolean [R] Whether research is enabled for this force, see LuaForce::enable_research and LuaForce::disable_research
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaGameScript - sort
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 = …, wrapper_frame_style = …} Show an in-game message dialog.
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 = …, show_cursor_building_preview = …, anti_alias = …, quality = …, allow_in_replay = …, daytime = …, water_tick = …, force_render = …} 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) → AnyBasic Convert a JSON string to a table.
write_file(filename, data, append, for_player) Write a string to a file.
remove_path(path) Remove file or directory.
remove_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 = …, override_sound_type = …} Play a sound for every player in the game.
is_valid_sound_path(sound_path) → boolean Checks if the given SoundPath is valid.
is_valid_sprite_path(sprite_path) → boolean Checks if the given SpritePath is valid and contains a loaded sprite.
kick_player(player, reason) Kicks the given player from this multiplayer game.
ban_player(player, reason) Bans the given player from this multiplayer game.
unban_player(player) Unbans the given player from this multiplayer game.
purge_player(player) Purges the given players messages from the game.
mute_player(player) Mutes the given player.
unmute_player(player) Unmutes the given player.
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{name = …, surface = …, force = …} → array[LuaEntity] Gets train stops matching the given filters.
get_player(player) → LuaPlayer Gets the given player or returns nil if no player is found.
get_surface(surface) → LuaSurface Gets the given surface or returns nil if no surface is found.
create_profiler(stopped) → 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) → LuaCustomTable[stringLuaEntityPrototype] Returns a dictionary of all LuaEntityPrototypes that fit the given filters.
get_filtered_item_prototypes(filters) → LuaCustomTable[stringLuaItemPrototype] Returns a dictionary of all LuaItemPrototypes that fit the given filters.
get_filtered_equipment_prototypes(filters) → LuaCustomTable[stringLuaEquipmentPrototype] Returns a dictionary of all LuaEquipmentPrototypes that fit the given filters.
get_filtered_mod_setting_prototypes(filters) → LuaCustomTable[stringLuaModSettingPrototype] Returns a dictionary of all LuaModSettingPrototypes that fit the given filters.
get_filtered_achievement_prototypes(filters) → LuaCustomTable[stringLuaAchievementPrototype] Returns a dictionary of all LuaAchievementPrototypes that fit the given filters.
get_filtered_tile_prototypes(filters) → LuaCustomTable[stringLuaTilePrototype] Returns a dictionary of all LuaTilePrototypes that fit the given filters.
get_filtered_decorative_prototypes(filters) → LuaCustomTable[stringLuaDecorativePrototype] Returns a dictionary of all LuaDecorativePrototypes that fit the given filters.
get_filtered_fluid_prototypes(filters) → LuaCustomTable[stringLuaFluidPrototype] Returns a dictionary of all LuaFluidPrototypes that fit the given filters.
get_filtered_recipe_prototypes(filters) → LuaCustomTable[stringLuaRecipePrototype] Returns a dictionary of all LuaRecipePrototypes that fit the given filters.
get_filtered_technology_prototypes(filters) → LuaCustomTable[stringLuaTechnologyPrototype] Returns a dictionary of all LuaTechnologyPrototypes that fit the given filters.
create_inventory(size) → LuaInventory Creates an inventory that is not owned by any game object.
get_script_inventories(mod) → dictionary[stringarray[LuaInventory]] Gets the inventories created through LuaGameScript::create_inventory
reset_time_played() Resets the amount of time played for this map.
encode_string(string) → string Deflates and base64 encodes the given string.
decode_string(string) → string Base64 decodes and inflates the given string.
object_name :: string [R] This object's name.
player :: LuaPlayer [R] The player typing at the console - nil in all other instances.
players :: LuaCustomTable[uint or stringLuaPlayer] [R] Get a table of all the players that currently exist.
map_settings :: MapSettings [R]
difficulty_settings :: DifficultySettings [R] The currently active set of difficulty settings.
difficulty :: defines.difficulty [R] Current scenario difficulty.
forces :: LuaCustomTable[uint or stringLuaForce] [R] Get a table of all the forces that currently exist.
entity_prototypes :: LuaCustomTable[stringLuaEntityPrototype] [R] A dictionary containing every LuaEntityPrototype indexed by name.
item_prototypes :: LuaCustomTable[stringLuaItemPrototype] [R] A dictionary containing every LuaItemPrototype indexed by name.
fluid_prototypes :: LuaCustomTable[stringLuaFluidPrototype] [R] A dictionary containing every LuaFluidPrototype indexed by name.
tile_prototypes :: LuaCustomTable[stringLuaTilePrototype] [R] A dictionary containing every LuaTilePrototype indexed by name.
equipment_prototypes :: LuaCustomTable[stringLuaEquipmentPrototype] [R] A dictionary containing every LuaEquipmentPrototype indexed by name.
damage_prototypes :: LuaCustomTable[stringLuaDamagePrototype] [R] A dictionary containing every LuaDamagePrototype indexed by name.
virtual_signal_prototypes :: LuaCustomTable[stringLuaVirtualSignalPrototype] [R] A dictionary containing every LuaVirtualSignalPrototype indexed by name.
equipment_grid_prototypes :: LuaCustomTable[stringLuaEquipmentGridPrototype] [R] A dictionary containing every LuaEquipmentGridPrototype indexed by name.
recipe_prototypes :: LuaCustomTable[stringLuaRecipePrototype] [R] A dictionary containing every LuaRecipePrototype indexed by name.
technology_prototypes :: LuaCustomTable[stringLuaTechnologyPrototype] [R] A dictionary containing every LuaTechnologyPrototype indexed by name.
decorative_prototypes :: LuaCustomTable[stringLuaDecorativePrototype] [R] A dictionary containing every LuaDecorativePrototype indexed by name.
particle_prototypes :: LuaCustomTable[stringLuaParticlePrototype] [R] A dictionary containing every LuaParticlePrototype indexed by name.
autoplace_control_prototypes :: LuaCustomTable[stringLuaAutoplaceControlPrototype] [R] A dictionary containing every LuaAutoplaceControlPrototype indexed by name.
noise_layer_prototypes :: LuaCustomTable[stringLuaNoiseLayerPrototype] [R] A dictionary containing every LuaNoiseLayerPrototype indexed by name.
mod_setting_prototypes :: LuaCustomTable[stringLuaModSettingPrototype] [R] A dictionary containing every LuaModSettingPrototype indexed by name.
custom_input_prototypes :: LuaCustomTable[stringLuaCustomInputPrototype] [R] A dictionary containing every LuaCustomInputPrototype indexed by name.
ammo_category_prototypes :: LuaCustomTable[stringLuaAmmoCategoryPrototype] [R] A dictionary containing every LuaAmmoCategoryPrototype indexed by name.
named_noise_expressions :: LuaCustomTable[stringLuaNamedNoiseExpression] [R] A dictionary containing every LuaNamedNoiseExpression indexed by name.
item_subgroup_prototypes :: LuaCustomTable[stringLuaGroup] [R] A dictionary containing every ItemSubgroup indexed by name.
item_group_prototypes :: LuaCustomTable[stringLuaGroup] [R] A dictionary containing every ItemGroup indexed by name.
fuel_category_prototypes :: LuaCustomTable[stringLuaFuelCategoryPrototype] [R] A dictionary containing every LuaFuelCategoryPrototype indexed by name.
resource_category_prototypes :: LuaCustomTable[stringLuaResourceCategoryPrototype] [R] A dictionary containing every LuaResourceCategoryPrototype indexed by name.
achievement_prototypes :: LuaCustomTable[stringLuaAchievementPrototype] [R] A dictionary containing every LuaAchievementPrototype indexed by name.
module_category_prototypes :: LuaCustomTable[stringLuaModuleCategoryPrototype] [R] A dictionary containing every LuaModuleCategoryPrototype indexed by name.
equipment_category_prototypes :: LuaCustomTable[stringLuaEquipmentCategoryPrototype] [R] A dictionary containing every LuaEquipmentCategoryPrototype indexed by name.
trivial_smoke_prototypes :: LuaCustomTable[stringLuaTrivialSmokePrototype] [R] A dictionary containing every LuaTrivialSmokePrototype indexed by name.
shortcut_prototypes :: LuaCustomTable[stringLuaShortcutPrototype] [R] A dictionary containing every LuaShortcutPrototype indexed by name.
recipe_category_prototypes :: LuaCustomTable[stringLuaRecipeCategoryPrototype] [R] A dictionary containing every LuaRecipeCategoryPrototype indexed by name.
font_prototypes :: LuaCustomTable[stringLuaFontPrototype] [R] A dictionary containing every LuaFontPrototype indexed by name.
map_gen_presets :: LuaCustomTable[stringMapGenPreset] [R] A dictionary containing every MapGenPreset indexed by name.
styles :: LuaCustomTable[stringstring] [R] The styles that LuaGuiElement can use, indexed by name.
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 :: LuaCustomTable[uint or stringLuaSurface] [R] Get a table of all the surfaces that currently exist.
active_mods :: dictionary[stringstring] [R] The active mods versions.
connected_players :: array[LuaPlayer] [R] The players that are currently online.
permissions :: LuaPermissionGroups [R]
backer_names :: LuaCustomTable[uintstring] [R] Array of the names of all the backers that supported the game development early on.
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.
max_force_distraction_distance :: double [R]
max_force_distraction_chunk_distance :: uint [R]
max_electric_pole_supply_area_distance :: float [R]
max_electric_pole_connection_distance :: double [R]
max_beacon_supply_area_distance :: double [R]
max_gate_activation_distance :: double [R]
max_inserter_reach_distance :: double [R]
max_pipe_to_ground_distance :: uint8 [R]
max_underground_belt_distance :: uint8 [R]
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[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?
object_name :: string [R] The class name of this object.
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.
relative :: LuaGuiElement [R] For showing a GUI somewhere relative to one of the game GUIs.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaGuiElement - sort
add{type = …, name = …, caption = …, tooltip = …, enabled = …, visible = …, ignored_by_interaction = …, style = …, tags = …, index = …, anchor = …} → LuaGuiElement Add a new child element to this GuiElement.
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.
get_index_in_parent() → uint Gets the index that this element has in its parent element.
clear_items() Removes the items in this dropdown or listbox.
get_item(index) → LocalisedString Gets the item at the given index from this dropdown or listbox.
set_item(index, string) Sets the given string at the given index in this dropdown or listbox.
add_item(string, index) Inserts a string at the end or at the given index of this dropdown or listbox.
remove_item(index) Removes the item at the given index from this dropdown or listbox.
get_slider_minimum() → double Gets this sliders minimum value.
get_slider_maximum() → double Gets this sliders maximum value.
set_slider_minimum_maximum(minimum, maximum) Sets this sliders minimum and maximum values.
get_slider_value_step() → double Gets the minimum distance this slider can move.
get_slider_discrete_slider() → boolean Returns whether this slider only allows being moved to discrete positions.
get_slider_discrete_values() → boolean Returns whether this slider only allows discrete values.
set_slider_value_step(value) Sets the minimum distance this slider can move.
set_slider_discrete_slider(value) Sets whether this slider only allows being moved to discrete positions.
set_slider_discrete_values(value) Sets whether this slider only allows discrete values.
focus() Focuses this GUI element if possible.
scroll_to_top() Scrolls this scroll bar to the top.
scroll_to_bottom() Scrolls this scroll bar to the bottom.
scroll_to_left() Scrolls this scroll bar to the left.
scroll_to_right() Scrolls this scroll bar to the right.
scroll_to_element(element, scroll_mode) Scrolls this scroll bar such that the specified GUI element is visible to the player.
select_all() Selects all the text in this textbox.
select(start, end) Selects a range of text in this textbox.
add_tab(tab, content) Adds the given tab and content widgets to this tabbed pane as a new tab.
remove_tab(tab) Removes the given tab and its associated content from this tabbed pane.
force_auto_center() Forces this frame to re-auto-center.
scroll_to_item(index, scroll_mode) Scrolls the scroll bar such that the specified listbox item is visible to the player.
bring_to_front() Moves this GUI element to the "front" so it will draw over other elements.
index :: uint [R] The index of this GUI element (unique amongst the GUI elements of a LuaPlayer).
gui :: LuaGui [R] The GUI this element is a child of.
parent :: LuaGuiElement [R] The direct parent of this element; nil if this is a top-level element.
name :: string [RW] The name of this element.
caption :: LocalisedString [RW] The text displayed on this element.
value :: double [RW] How much this progress bar is filled.
direction :: string [R] Direction of this element's layout.
style :: LuaStyle or string [RW] The style of this element.
visible :: boolean [RW] Sets whether this GUI element is visible or completely hidden, taking no space in the layout.
text :: string [RW] The text contained in this textfield or text-box.
children_names :: array[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 the image widget should resize according to the sprite in it.
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.
vertical_scroll_policy :: string [RW] Policy of the vertical scroll bar.
type :: string [R] The type of this GUI element.
children :: array[LuaGuiElement] [R] The child-elements of this GUI element.
items :: array[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 bottom right corner of this sprite-button.
show_percent_for_small_numbers :: boolean [RW] Related to the number to be shown in the bottom right corner of this 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] Whether this frame auto-centers on window resize when stored in LuaGui::screen.
badge_text :: LocalisedString [RW] The text to display after the normal tab text (designed to work with numbers)
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.
elem_filters :: array[PrototypeFilter] [RW] The elem filters of this choose-elem-button or nil if there are no filters.
selectable :: boolean [RW] Whether the contents of this text-box are selectable.
word_wrap :: boolean [RW] Whether this text-box will word-wrap automatically.
read_only :: boolean [RW] Whether this text-box is read-only.
enabled :: boolean [RW] Whether this GUI element is enabled.
ignored_by_interaction :: boolean [RW] Whether this GUI element is ignored by interaction.
locked :: boolean [RW] Whether this choose-elem-button can be changed by the player.
draw_vertical_lines :: boolean [RW] Whether this table should draw vertical grid lines.
draw_horizontal_lines :: boolean [RW] Whether this table should draw horizontal grid lines.
draw_horizontal_line_after_headers :: boolean [RW] Whether this table should draw a horizontal grid line below the first table row.
column_count :: uint [R] The number of columns in this table.
vertical_centering :: boolean [RW] Whether the content 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] Whether this textfield is limited to only numberic characters.
allow_decimal :: boolean [RW] Whether this textfield (when in numeric mode) allows decimal numbers.
allow_negative :: boolean [RW] Whether this textfield (when in numeric mode) allows negative numbers.
is_password :: boolean [RW] Whether this textfield displays as a password field, which renders all characters as *.
lose_focus_on_confirm :: boolean [RW] Whether this textfield loses focus after defines.events.on_gui_confirmed is fired.
clear_and_focus_on_right_click :: boolean [RW] Makes it so right-clicking on this textfield clears and focuses it.
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 for this tabbed pane or nil if no tab is selected.
tabs :: array[TabAndContent] [R] The tabs and contents being shown in this tabbed-pane.
entity :: LuaEntity [RW] The entity associated with this entity-preview, camera, minimap or nil if no entity is associated.
anchor :: GuiAnchor [RW] Sets the anchor for this relative widget.
tags :: Tags [RW] The tags associated with this LuaGuiElement.
switch_state :: string [RW] The switch state (left, none, right) for this switch.
allow_none_state :: boolean [RW] Whether 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 tooltip shown on the left switch label.
right_label_caption :: LocalisedString [RW] The text shown for the right switch label.
right_label_tooltip :: LocalisedString [RW] The tooltip shown on the right switch label.
operator [] :: LuaGuiElement [R] The indexing operator.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaHeatEnergySourcePrototype - sort
emissions :: double [R]
render_no_network_icon :: boolean [R]
render_no_power_icon :: boolean [R]
max_temperature :: double [R]
default_temperature :: double [R]
specific_heat :: double [R]
max_transfer :: double [R]
min_temperature_gradient :: double [R]
min_working_temperature :: double [R]
minimum_glow_temperature :: double [R]
connections :: array[HeatConnection] [R]
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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.
supports_bar() → boolean Does this inventory support a bar?
get_bar() → uint Get the current bar.
set_bar(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.
find_empty_stack(item) → LuaItemStack Finds the first empty stack.
count_empty_stacks(include_filtered) → uint Counts the number of empty stacks.
get_insertable_count(item) Gets the number of the given item that can be inserted into this inventory.
sort_and_merge() Sorts and merges the items in this inventory.
resize(size) Resizes the inventory.
destroy() Destroys this inventory.
operator # :: uint [R] Get the number of slots in this inventory.
index :: defines.inventory [R] The inventory index this inventory uses, or nil if the inventory doesn't have an index.
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 :: LuaEquipment [R] The equipment that owns this inventory or nil if this isn't owned by an equipment.
mod_owner :: string [R] The mod that owns this inventory or nil if this isn't owned by a mod.
operator [] :: LuaItemStack [R] The indexing operator.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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 :: ItemPrototypeFlags [R] The item prototype flags for this item prototype.
rocket_launch_products :: array[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 :: dictionary[stringResistance] [R] Resistances of this armour item, indexed by damage type name.
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.
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 :: ModuleEffects [R] Effects of this module; nil if this is not a module.
category :: string [R] The name of a LuaModuleCategoryPrototype.
tier :: uint [R] Tier of the module inside its category.
limitations :: array[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 :: array[TriggerItem] [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.
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?
object_name :: string [R] The class name of this object.
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[BlueprintEntity] The 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[Tile] A list of the tiles in this blueprint.
set_blueprint_tiles(tiles) Set specific 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 = …, raise_built = …} → array[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 = …, include_entities = …, include_modules = …, include_station_names = …, include_trains = …, include_fuel = …} → dictionary[uintLuaEntity] Sets up this blueprint using the found blueprintable entities/tiles on the surface.
get_tag(tag_name) → AnyBasic Gets the tag with the given name or returns nil if it doesn't exist.
set_tag(tag_name, tag) → AnyBasic 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.
get_blueprint_entity_count() → uint Gets the number of entities in this blueprint item.
get_blueprint_entity_tags(index) → Tags Gets the tags for the given blueprint entity index in this blueprint item.
set_blueprint_entity_tags(index, tags) Sets the tags on the given blueprint entity index in this blueprint item.
get_blueprint_entity_tag(index, tag) → AnyBasic Gets the given tag on the given blueprint entity index in this blueprint item.
set_blueprint_entity_tag(index, tag, value) Sets the given tag on the given blueprint entity index in this blueprint item.
create_grid() → LuaEquipmentGrid Creates the equipment grid for this item if it doesn't exist and this is an item-with-entity-data that supports equipment grids.
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[BlueprintSignalIcon] [RW] Icons of a blueprint item, blueprint book, deconstruction item or upgrade planner.
blueprint_snap_to_grid :: Position [RW] The snapping grid size in this blueprint item or nil if snapping is not enabled.
blueprint_position_relative_to_grid :: Position [RW] The offset from the absolute grid or nil if absolute snapping is not enabled.
blueprint_absolute_snapping :: boolean [RW] If absolute snapping is enabled on this 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[BlueprintItemIcon] [R] The default icons for a blueprint item.
tags :: Tags [RW]
custom_description :: LocalisedString [RW] The custom description this item-with-tags.
entity_filters :: array[string] [RW] The entity filters for this deconstruction item.
tile_filters :: array[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 identifier for this item if it has one, nil otherwise.
connected_entity :: LuaEntity [RW] If this item is a spidertron remote that has a spidertron bound to it, it returns the connected spider-vehicle entity, nil otherwise.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaLazyLoadedValue - sort
get() → Any Gets the value of this lazy loaded value.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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[LuaLogisticCell] [R] Neighbouring cells.
charging_robots :: array[LuaEntity] [R] Robots currently being charged.
to_charge_robots :: array[LuaEntity] [R] Robots waiting to charge.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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[LuaLogisticCell] [R] All cells in this network.
providers :: array[LuaEntity] [R] All entities that have logistic provider points in this network.
empty_providers :: array[LuaEntity] [R] All entities that have empty logistic provider points in this network.
requesters :: array[LuaEntity] [R] All entities that have logistic requester points in this network.
storages :: array[LuaEntity] [R] All entities that have logistic storage points in this network.
logistic_members :: array[LuaEntity] [R] All other entities that have logistic points in this network (inserters mostly).
provider_points :: array[LuaLogisticPoint] [R] All things that have provider points in this network.
passive_provider_points :: array[LuaLogisticPoint] [R] All passive provider points in this network.
active_provider_points :: array[LuaLogisticPoint] [R] All active provider points in this network.
empty_provider_points :: array[LuaLogisticPoint] [R] All things that have empty provider points in this network.
requester_points :: array[LuaLogisticPoint] [R] All things that have requester points in this network.
storage_points :: array[LuaLogisticPoint] [R] All things that have storage points in this network.
robots :: array[LuaEntity] [R] All robots in this logistic network.
construction_robots :: array[LuaEntity] [R] All construction robots in this logistic network.
logistic_robots :: array[LuaEntity] [R] All logistic robots in this logistic network.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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[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?
object_name :: string [R] The class name of this object.
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[string] or array[int] or array[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.
hidden :: boolean [R] If this setting is hidden from the GUI.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaParticlePrototype - sort
name :: string [R] Name of this prototype.
order :: string [R] Order string of this prototype.
localised_name :: LocalisedString [R]
localised_description :: LocalisedString [R]
regular_trigger_effect :: TriggerEffectItem [R]
ended_in_water_trigger_effect :: TriggerEffectItem [R]
render_layer :: RenderLayer [R]
render_layer_when_on_ground :: RenderLayer [R]
life_time :: uint [R]
regular_trigger_effect_frequency :: uint [R]
movement_modifier_when_on_ground :: float [R]
movement_modifier :: float [R]
mining_particle_frame_speed :: float [R]
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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 Whether this group allows the given action.
set_allows_action(action, allow_action) → boolean Sets whether this group allows the performance the given action.
destroy() → boolean Destroys this group.
name :: string [RW] The name of this group.
players :: array[LuaPlayer] [R] The players in this group.
group_id :: uint [R] The group ID
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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[LuaPermissionGroup] [R] All of the permission groups.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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 = …, start_position = …, start_zoom = …, final_transition_time = …, chart_mode_cutoff = …} Set the controller type of the player.
drag_wire{position = …} → boolean Start/end wire dragging at the specified location, wire type is based on the cursor contents
disable_recipe_groups() 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.
log_active_entity_chunk_counts() Logs a dictionary of chunks -> active entities for the surface this player is on.
log_active_entity_counts() Logs a dictionary of active entities -> count for the surface this player is on.
unlock_achievement(name) Unlock the achievements of the given player.
clear_cursor() → boolean Invokes the "clear cursor" action on the player as if the user pressed it.
create_character(character) → boolean Creates and attaches a character entity to this player.
add_alert(entity, type) Adds an alert to this player for the given entity of the given alert type.
add_custom_alert(entity, icon, message, show_on_map) Adds a custom alert to this player.
remove_alert{entity = …, prototype = …, position = …, type = …, surface = …, icon = …, message = …} Removes all alerts matching the given filters or if an empty filters table is given all alerts are removed.
get_alerts{entity = …, prototype = …, position = …, type = …, surface = …} → dictionary[uintdictionary[defines.alert_typearray[Alert]]] Get all alerts matching the given filters, or all alerts if no filters are given.
mute_alert(alert_type) → boolean Mutes alerts for the given alert category.
unmute_alert(alert_type) → boolean Unmutes alerts for the given alert category.
is_alert_muted(alert_type) → boolean If the given alert type is currently muted.
enable_alert(alert_type) → boolean Enables alerts for the given alert category.
disable_alert(alert_type) → boolean Disables alerts for the given alert category.
is_alert_enabled(alert_type) → boolean If the given alert type is currently enabled.
pipette_entity(entity) → boolean Invokes the "smart pipette" action on the player as if the user pressed it.
can_place_entity{name = …, position = …, direction = …} → boolean Checks if this player can build the give entity at the given location on the surface the player is on.
can_build_from_cursor{position = …, direction = …, alt = …, terrain_building_size = …, skip_fog_of_war = …} → boolean Checks if this player can build what ever is in the cursor on the surface the player is on.
build_from_cursor{position = …, direction = …, alt = …, terrain_building_size = …, skip_fog_of_war = …} Builds what ever is in the cursor on the surface the player is on.
use_from_cursor(position) Uses the current item in the cursor if it's a capsule or does nothing if not.
play_sound{path = …, position = …, volume_modifier = …, override_sound_type = …} Play a sound for this player.
get_associated_characters() → array[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 = …, create_at_cursor = …, color = …, time_to_live = …, speed = …} Spawn 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 Lua shortcut currently toggled?
is_shortcut_available(prototype_name) → boolean Is a custom Lua shortcut currently available?
set_shortcut_toggled(prototype_name, toggled) Toggle or untoggle a custom Lua shortcut
set_shortcut_available(prototype_name, available) Make a custom Lua shortcut available or unavailable.
connect_to_server{address = …, name = …, description = …, password = …} Asks the player if they would like to connect to the given server.
toggle_map_editor() Toggles this player into or out of the map editor.
request_translation(localised_string) → boolean Requests a translation for the given localised string.
get_infinity_inventory_filter(index) → InfinityInventoryFilter Gets the filter for this map editor infinity filters at the given index or nil if the filter index doesn't exist or is empty.
set_infinity_inventory_filter(index, filter) Sets the filter for this map editor infinity filters at the given index.
clear_recipe_notifications() Clears all recipe notifications for this player.
add_recipe_notification(recipe) Adds the given recipe to the list of recipe notifications for this player.
add_to_clipboard(blueprint) Adds the given blueprint to this player's clipboard queue.
activate_paste() Gets a copy of the currently selected blueprint in the clipboard queue into the player's cursor, as if the player activated Paste.
start_selection(position, selection_mode) Starts selection with selection tool from the specified position.
clear_selection() Clears the players selection tool selection position.
character :: LuaEntity [RW] The character attached to this player, or nil if no character.
cutscene_character :: LuaEntity [R] When in a cutscene; the character this player would be using once the cutscene is over.
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]
stashed_controller_type :: defines.controllers [R] The stashed controller type or nil if no controller is stashed.
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 [R] 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 :: LuaCustomTable[stringModSetting] [R] Gets the current per-player settings for the this player, indexed by prototype name.
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.
remove_unfiltered_items :: boolean [RW] If items not included in this map editor infinity inventory filters should be removed.
infinity_inventory_filters :: array[InfinityInventoryFilter] [RW] The filters for this map editor infinity inventory settings.
auto_sort_main_inventory :: boolean [R] If the main inventory will be auto sorted.
hand_location :: ItemStackLocation [RW] The original location of the item in the cursor, marked with a hand.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
Inherited from LuaControl: get_inventory, get_main_inventory, can_insert, insert, set_gui_arrow, clear_gui_arrow, get_item_count, has_items_inside, can_reach_entity, clear_items_inside, remove_item, teleport, update_selected_entity, clear_selected_entity, disable_flashlight, enable_flashlight, is_flashlight_enabled, get_craftable_count, begin_crafting, cancel_crafting, mine_entity, mine_tile, is_player, open_technology_gui, set_personal_logistic_slot, set_vehicle_logistic_slot, get_personal_logistic_slot, get_vehicle_logistic_slot, clear_personal_logistic_slot, clear_vehicle_logistic_slot, is_cursor_blueprint, get_blueprint_entities, is_cursor_empty, surface, position, vehicle, force, selected, opened, crafting_queue_size, crafting_queue_progress, walking_state, riding_state, mining_state, shooting_state, picking_state, repair_state, cursor_stack, cursor_ghost, driving, crafting_queue, following_robots, cheat_mode, character_crafting_speed_modifier, character_mining_speed_modifier, character_additional_mining_categories, character_running_speed_modifier, character_build_distance_bonus, character_item_drop_distance_bonus, character_reach_distance_bonus, character_resource_reach_distance_bonus, character_item_pickup_distance_bonus, character_loot_pickup_distance_bonus, character_inventory_slots_bonus, character_trash_slot_count_bonus, character_maximum_following_robot_count_bonus, character_health_bonus, character_personal_logistic_requests_enabled, vehicle_logistic_requests_enabled, opened_gui_type, build_distance, drop_item_distance, reach_distance, item_pickup_distance, loot_pickup_distance, resource_reach_distance, in_combat, character_running_speed, character_mining_progress
class LuaProfiler - sort
reset() Resets the clock, also restarting it.
stop() Stops the clock.
restart() Start the clock again, without resetting it.
add(other) Add the duration of another timer to this timer.
divide(number) Divides the current duration by a set value.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaRCON - sort
print(message) Print text to the calling RCON interface if any.
object_name :: string [R] This object's name.
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 :: LuaCustomTable[uintLuaEntity] [R] Array of the rails that this path travels over.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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[Ingredient] [R] Ingredients for this recipe.
products :: array[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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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[Ingredient] [R] Ingredients for this recipe.
products :: array[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 (item/fluid production 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_inserter_overload :: boolean [R] If the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size).
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] Is this recipe allowed to be broken down for the recipe tooltip "Total raw" calculations?
unlock_results :: boolean [R] Is this recipe unlocks the result item(s) so they're shown in filter-select GUIs.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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, ...) → Any Call a function of an interface.
object_name :: string [R] This object's name.
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 = …, vertical_alignment = …, scale_with_zoom = …, only_in_alt_mode = …} → uint64 Create a text.
draw_circle{color = …, radius = …, width = …, filled = …, target = …, target_offset = …, surface = …, time_to_live = …, forces = …, players = …, visible = …, draw_on_ground = …, only_in_alt_mode = …} → uint64 Create a circle.
draw_rectangle{color = …, width = …, filled = …, left_top = …, left_top_offset = …, right_bottom = …, right_bottom_offset = …, surface = …, time_to_live = …, forces = …, players = …, visible = …, draw_on_ground = …, only_in_alt_mode = …} → uint64 Create a rectangle.
draw_arc{color = …, max_radius = …, min_radius = …, start_angle = …, angle = …, target = …, target_offset = …, surface = …, time_to_live = …, forces = …, players = …, visible = …, draw_on_ground = …, only_in_alt_mode = …} → uint64 Create an arc.
draw_polygon{color = …, vertices = …, target = …, target_offset = …, orientation = …, orientation_target = …, orientation_target_offset = …, surface = …, time_to_live = …, forces = …, players = …, visible = …, draw_on_ground = …, only_in_alt_mode = …} → uint64 Create a triangle mesh defined by a triangle strip.
draw_sprite{sprite = …, orientation = …, x_scale = …, y_scale = …, tint = …, render_layer = …, orientation_target = …, orientation_target_offset = …, oriented_offset = …, target = …, target_offset = …, surface = …, time_to_live = …, forces = …, players = …, visible = …, only_in_alt_mode = …} → uint64 Create a sprite.
draw_light{sprite = …, orientation = …, scale = …, intensity = …, minimum_darkness = …, oriented = …, color = …, target = …, target_offset = …, surface = …, time_to_live = …, forces = …, players = …, visible = …, only_in_alt_mode = …} → uint64 Create a light.
draw_animation{animation = …, orientation = …, x_scale = …, y_scale = …, tint = …, render_layer = …, animation_speed = …, animation_offset = …, orientation_target = …, orientation_target_offset = …, oriented_offset = …, target = …, target_offset = …, surface = …, time_to_live = …, forces = …, players = …, visible = …, only_in_alt_mode = …} → uint64 Create an animation.
destroy(id) Destroy the object with the given id.
is_font_valid(font_name) → boolean Does a font with this name exist?
is_valid(id) → boolean Does a valid object with this id exist?
get_all_ids(mod_name) → array[uint64] Gets an array of all valid object ids.
clear(mod_name) Destroys all render objects.
get_type(id) → string Gets the type of the given object.
bring_to_front(id) Reorder this object so that it is drawn in front of the already existing objects.
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[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[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) → RealOrientation 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_vertical_alignment(id) → string Get the vertical alignment of the text with this id or nil if the object is not a text.
set_vertical_alignment(id, alignment) Set the vertical 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[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.
object_name :: string [R] This object's name.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaSettings - sort
get_player_settings(player) → LuaCustomTable[stringModSetting] Gets the current per-player settings for the given player, indexed by prototype name.
startup :: LuaCustomTable[stringModSetting] [R] The startup mod settings, indexed by prototype name.
global :: LuaCustomTable[stringModSetting] [R] The current global mod settings, indexed by prototype name.
player :: LuaCustomTable[stringModSetting] [R] The default player mod settings for this map, indexed by prototype name.
object_name :: string [R] This object's name.
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_spawn :: LuaItemPrototype [R]
technology_to_unlock :: LuaTechnologyPrototype [R]
toggleable :: boolean [R]
associated_control_input :: string [R]
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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] Minimal width ensures, that the widget will never be smaller than than that size.
maximal_width :: int [RW] Maximal width ensures, that the widget will never be bigger than than that size.
minimal_height :: int [RW] Minimal height ensures, that the widget will never be smaller than than that size.
maximal_height :: int [RW] Maximal height ensures, that the widget will never be bigger than than that size.
natural_width :: int [RW] Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a smaller or bigger size.
natural_height :: int [RW] Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a smaller or bigger size.
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 width of some parent element) horizontally.
vertically_squashable :: boolean [RW] If the GUI element can be squashed (by maximal height of some parent element) vertically.
rich_text_setting :: defines.rich_text_setting [RW] How this GUI element handles rich text.
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 :: LuaCustomTable[uintAlignment] [R] Array containing the alignment for every column of this table element.
single_line :: boolean [RW]
extra_top_padding_when_activated :: int [RW]
extra_bottom_padding_when_activated :: int [RW]
extra_left_padding_when_activated :: int [RW]
extra_right_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.
size :: int or array[int] [W] Sets both width and height to the given value.
padding :: int or array[int] [W] Sets top/right/bottom/left paddings to this value.
margin :: int or array[int] [W] Sets top/right/bottom/left margins to this value.
cell_padding :: int [W] Space between the table cell contents and border.
extra_padding_when_activated :: int or array[int] [W] Sets extra_top/right/bottom/left_padding_when_actived to this value.
extra_margin_when_activated :: int or array[int] [W] Sets extra_top/right/bottom/left_margin_when_activated to this value.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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 = …, inner_name = …} → boolean Check for collisions with terrain or other entities.
can_fast_replace{name = …, position = …, direction = …, force = …} → boolean If there exists an entity at the given location that can be fast-replaced with the given entity parameters.
find_entity(entity, position) → LuaEntity Find a specific entity at a specific position.
find_entities(area) → array[LuaEntity] Find entities in a given area.
find_entities_filtered{area = …, position = …, radius = …, name = …, type = …, ghost_name = …, ghost_type = …, direction = …, collision_mask = …, force = …, to_be_deconstructed = …, to_be_upgraded = …, limit = …, invert = …} → array[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[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 = …, to_be_deconstructed = …, to_be_upgraded = …, 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) → array[LuaEntity] Spill items on the ground centered at a given location.
find_enemy_units(center, radius, force) → array[LuaEntity] Find enemy units (entities with type "unit") of a given force within an area.
find_units{area = …, force = …, condition = …} → array[LuaEntity] Find units (entities with type "unit") of a given force and force condition within a given area.
find_nearest_enemy{position = …, max_distance = …, force = …} → LuaEntity Find the enemy entity-with-force (military entity) closest to the given position.
find_nearest_enemy_entity_with_owner{position = …, max_distance = …, force = …} → LuaEntity Find the enemy entity-with-owner closest to the given position.
set_multi_command{command = …, unit_count = …, force = …, unit_search_distance = …} → uint Give a command to multiple units.
create_entity{name = …, position = …, direction = …, force = …, target = …, source = …, fast_replace = …, player = …, spill = …, raise_built = …, create_build_effect_smoke = …, spawn_decorations = …, move_stuck_players = …, item = …} → LuaEntity Create an entity on this surface.
create_trivial_smoke{name = …, position = …}
create_particle{name = …, position = …, movement = …, height = …, vertical_speed = …, frame_speed = …} Creates a particle at the given location
create_unit_group{position = …, force = …} → 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, remove_colliding_entities, remove_colliding_decoratives, raise_event) 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[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) Set the hidden tile for the specified position.
get_connected_tiles(position, tiles) → array[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[DecorativeResult] Find decoratives of a given name in a given area.
get_trains(force) → array[LuaTrain]
clear_pollution() Clears all pollution on this surface.
play_sound{path = …, position = …, volume_modifier = …, override_sound_type = …} Play a sound for every player 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_entities = …, clear_destination_decoratives = …, expand_map = …, create_build_effect_smoke = …} Clones the given area.
clone_brush{source_offset = …, destination_offset = …, source_positions = …, destination_surface = …, destination_force = …, clone_tiles = …, clone_entities = …, clone_decoratives = …, clear_destination_entities = …, clear_destination_decoratives = …, expand_map = …, manual_collision_mode = …, create_build_effect_smoke = …} Clones the given area.
clone_entities{entities = …, destination_offset = …, destination_surface = …, destination_force = …, snap_to_grid = …, create_build_effect_smoke = …} Clones the given entities.
clear(ignore_characters) Clears this surface deleting all entities and chunks on it.
request_path{bounding_box = …, collision_mask = …, start = …, goal = …, force = …, radius = …, pathfind_flags = …, can_open_gates = …, path_resolution_modifier = …, entity_to_ignore = …} → uint Generates a path with the specified constraints (as an array of PathfinderWaypoints) using the unit pathfinding algorithm.
get_script_areas(name) → array[ScriptArea] Gets the script areas that match the given name or if no name is given all areas are returned.
get_script_area(key) → ScriptArea Gets the first script area by name or id.
edit_script_area(id, area) Sets the given script area to the new values.
add_script_area(area) → uint Adds the given script area.
remove_script_area(id) → boolean Removes the given script area.
get_script_positions(name) → array[ScriptPosition] Gets the script positions that match the given name or if no name is given all positions are returned.
get_script_position(key) → ScriptPosition Gets the first script position by name or id.
edit_script_position(id, area) Sets the given script position to the new values.
add_script_position(area) → uint Adds the given script position.
remove_script_position(id) → boolean Removes the given script position.
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{name = …, force = …} → array[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[double]]
get_entities_with_force(position, force) → array[LuaEntity] Returns all the entities with force on this chunk for the given force.
build_checkerboard(area) Sets the given area to the checkerboard lab tiles.
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 this surface.
generate_with_lab_tiles :: boolean [RW] When set to true, new chunks will be generated with lab tiles, instead of using the surface's map generation settings.
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 :: double [RW] Current wind speed.
wind_orientation :: RealOrientation [RW] Current wind direction.
wind_orientation_change :: double [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.
brightness_visual_weights :: ColorModifier [RW] Defines how surface daytime brightness influences each color channel of the current color lookup table (LUT).
show_clouds :: boolean [RW] If clouds are shown on this surface.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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[Ingredient] [R] Ingredients labs will require to research this technology.
effects :: array[TechnologyModifier] [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?
object_name :: string [R] The class name of this object.
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.
ignore_tech_cost_multiplier :: boolean [R] If this technology ignores the technology cost multiplier setting.
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[Ingredient] [R] Ingredients labs will require to research this technology.
effects :: array[TechnologyModifier] [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?
object_name :: string [R] The class name of this object.
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?
to_be_deconstructed() → boolean Is this tile marked for deconstruction?
order_deconstruction(force, player) → LuaEntity Orders deconstruction of this tile by the given force.
cancel_deconstruction(force, player) Cancels deconstruction if it is scheduled, does nothing otherwise.
name :: string [R] Prototype name of this tile.
prototype :: LuaTilePrototype [R]
position :: Position [R] The position this tile references.
hidden_tile :: string [R] The name of the LuaTilePrototype hidden under this tile or nil if there is no hidden tile.
surface :: LuaSurface [R] The surface this tile is on.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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 :: CollisionMask [R] The collision mask this tile uses
collision_mask_with_flags :: CollisionMaskWithFlags [R]
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]
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[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 second this tile will absorb.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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[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[LuaEntity] [R] Rolling stocks the train is composed of.
locomotives :: dictionary[stringarray[LuaEntity]] [R] Arrays of locomotives.
cargo_wagons :: array[LuaEntity] [R] The cargo carriages the train contains.
fluid_wagons :: array[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[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?
object_name :: string [R] The class name of this object.
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[LuaTransportLine] [R] The transport lines that this transport line outputs items to or an empty table if none.
input_lines :: array[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?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
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_distraction_command(command) Give this group a distraction 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[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.
is_script_driven :: boolean [R] Whether this unit group is controlled by a script or by the game engine.
command :: Command [R] The command given to this group or nil is the group has no command.
distraction_command :: Command [R] The distraction command given to this group or nil is the group currently isn't distracted.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
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?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
class LuaVoidEnergySourcePrototype - sort
emissions :: double [R]
render_no_network_icon :: boolean [R]
render_no_power_icon :: boolean [R]
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.