---@meta ---@diagnostic disable --$Factorio 1.1.35 --$Overlay 1 -- This file is automatically generated. Edits will be overwritten. ---A double-precision floating-point number. This is the same data type as all Lua numbers use. --- ---[View documentation](https://lua-api.factorio.com/latest/Builtin-Types.html#double) ---@class double:number ---A floating-point number. This is a single-precision floating point number. Whilst Lua only uses double-precision numbers, when a function takes a float, the game engine will immediately convert the double-precision number to single-precision. --- ---[View documentation](https://lua-api.factorio.com/latest/Builtin-Types.html#float) ---@class float:number ---32-bit signed integer. Possible values are -2,147,483,648 to 2,147,483,647. --- ---[View documentation](https://lua-api.factorio.com/latest/Builtin-Types.html#int) ---@class int:number ---8-bit signed integer. Possible values are -128 to 127. --- ---[View documentation](https://lua-api.factorio.com/latest/Builtin-Types.html#int8) ---@class int8:number ---32-bit unsigned integer. Possible values are 0 to 4,294,967,295. --- ---[View documentation](https://lua-api.factorio.com/latest/Builtin-Types.html#uint) ---@class uint:number ---16-bit unsigned integer. Possible values are 0 to 65535. --- ---[View documentation](https://lua-api.factorio.com/latest/Builtin-Types.html#uint16) ---@class uint16:number ---64-bit unsigned integer. Possible values are 0 to 18,446,744,073,709,551,615. --- ---[View documentation](https://lua-api.factorio.com/latest/Builtin-Types.html#uint64) ---@class uint64:number ---8-bit unsigned integer. Possible values are 0 to 255. --- ---[View documentation](https://lua-api.factorio.com/latest/Builtin-Types.html#uint8) ---@class uint8:number ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines) ---@class defines defines={} ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type) ---@class defines.alert_type defines.alert_type={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type.custom) custom=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type.entity_destroyed) entity_destroyed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type.entity_under_attack) entity_under_attack=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type.no_material_for_construction) no_material_for_construction=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type.no_storage) no_storage=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type.not_enough_construction_robots) not_enough_construction_robots=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type.not_enough_repair_packs) not_enough_repair_packs=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type.train_out_of_fuel) train_out_of_fuel=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.alert_type.turret_fire) turret_fire=0, } ---AI command exit status. See [LuaEntity::set_command](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_command) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.behavior_result) ---@class defines.behavior_result defines.behavior_result={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.behavior_result.deleted) deleted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.behavior_result.fail) fail=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.behavior_result.in_progress) in_progress=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.behavior_result.success) success=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.build_check_type) ---@class defines.build_check_type defines.build_check_type={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.build_check_type.blueprint_ghost) blueprint_ghost=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.build_check_type.ghost_revive) ghost_revive=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.build_check_type.manual) manual=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.build_check_type.manual_ghost) manual_ghost=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.build_check_type.script) script=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.build_check_type.script_ghost) script_ghost=0, } ---State of a chain signal. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chain_signal_state) ---@class defines.chain_signal_state defines.chain_signal_state={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chain_signal_state.all_open) all_open=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chain_signal_state.none) none=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chain_signal_state.none_open) none_open=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chain_signal_state.partially_open) partially_open=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chunk_generated_status) ---@class defines.chunk_generated_status defines.chunk_generated_status={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chunk_generated_status.basic_tiles) basic_tiles=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chunk_generated_status.corrected_tiles) corrected_tiles=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chunk_generated_status.custom_tiles) custom_tiles=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chunk_generated_status.entities) entities=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chunk_generated_status.nothing) nothing=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.chunk_generated_status.tiles) tiles=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_condition_index) ---@class defines.circuit_condition_index defines.circuit_condition_index={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_condition_index.arithmetic_combinator) arithmetic_combinator=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_condition_index.constant_combinator) constant_combinator=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_condition_index.decider_combinator) decider_combinator=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_condition_index.inserter_circuit) inserter_circuit=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_condition_index.inserter_logistic) inserter_logistic=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_condition_index.lamp) lamp=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_condition_index.offshore_pump) offshore_pump=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_condition_index.pump) pump=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id) ---@class defines.circuit_connector_id defines.circuit_connector_id={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.accumulator) accumulator=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.combinator_input) combinator_input=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.combinator_output) combinator_output=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.constant_combinator) constant_combinator=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.container) container=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.electric_pole) electric_pole=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.inserter) inserter=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.lamp) lamp=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.offshore_pump) offshore_pump=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.programmable_speaker) programmable_speaker=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.pump) pump=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.rail_chain_signal) rail_chain_signal=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.rail_signal) rail_signal=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.roboport) roboport=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.storage_tank) storage_tank=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.circuit_connector_id.wall) wall=0, } ---Command given to units describing what they should do. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command) ---@class defines.command defines.command={ ---Attack another entity. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command.attack) attack=0, ---Go to a place and attack what you see. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command.attack_area) attack_area=0, ---Go to a position and build a base there. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command.build_base) build_base=0, ---Chain commands together, see [defines.compound_command](https://lua-api.factorio.com/latest/defines.html#defines.compound_command). --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command.compound) compound=0, ---Flee from another entity. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command.flee) flee=0, ---Go to a specific position. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command.go_to_location) go_to_location=0, ---Do what your group wants you to do. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command.group) group=0, ---Stop moving and stay where you are. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command.stop) stop=0, ---Chill. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.command.wander) wander=0, } ---How commands are joined together in a compound command (see [defines.command.compound](https://lua-api.factorio.com/latest/defines.html#defines.command.compound)). --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.compound_command) ---@class defines.compound_command defines.compound_command={ ---Fail on first failure. Only succeeds if all commands (executed one after another) succeed. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.compound_command.logical_and) logical_and=0, ---Succeed on first success. Only fails if all commands (executed one after another) fail. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.compound_command.logical_or) logical_or=0, ---Execute all commands in sequence and fail or succeed depending on the return status of the last command. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.compound_command.return_last) return_last=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior) ---@class defines.control_behavior defines.control_behavior={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter) ---@class defines.control_behavior.inserter defines.control_behavior.inserter={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter.circuit_mode_of_operation) ---@class defines.control_behavior.inserter.circuit_mode_of_operation defines.control_behavior.inserter.circuit_mode_of_operation={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter.circuit_mode_of_operation.enable_disable) enable_disable=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter.circuit_mode_of_operation.none) none=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter.circuit_mode_of_operation.read_hand_contents) read_hand_contents=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter.circuit_mode_of_operation.set_filters) set_filters=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter.circuit_mode_of_operation.set_stack_size) set_stack_size=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter.hand_read_mode) ---@class defines.control_behavior.inserter.hand_read_mode defines.control_behavior.inserter.hand_read_mode={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter.hand_read_mode.hold) hold=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.inserter.hand_read_mode.pulse) pulse=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.lamp) ---@class defines.control_behavior.lamp defines.control_behavior.lamp={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.lamp.circuit_mode_of_operation) ---@class defines.control_behavior.lamp.circuit_mode_of_operation defines.control_behavior.lamp.circuit_mode_of_operation={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.lamp.circuit_mode_of_operation.use_colors) use_colors=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.logistic_container) ---@class defines.control_behavior.logistic_container defines.control_behavior.logistic_container={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.logistic_container.circuit_mode_of_operation) ---@class defines.control_behavior.logistic_container.circuit_mode_of_operation defines.control_behavior.logistic_container.circuit_mode_of_operation={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.logistic_container.circuit_mode_of_operation.send_contents) send_contents=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.logistic_container.circuit_mode_of_operation.set_requests) set_requests=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.mining_drill) ---@class defines.control_behavior.mining_drill defines.control_behavior.mining_drill={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.mining_drill.resource_read_mode) ---@class defines.control_behavior.mining_drill.resource_read_mode defines.control_behavior.mining_drill.resource_read_mode={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.mining_drill.resource_read_mode.entire_patch) entire_patch=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.mining_drill.resource_read_mode.this_miner) this_miner=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.transport_belt) ---@class defines.control_behavior.transport_belt defines.control_behavior.transport_belt={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.transport_belt.content_read_mode) ---@class defines.control_behavior.transport_belt.content_read_mode defines.control_behavior.transport_belt.content_read_mode={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.transport_belt.content_read_mode.hold) hold=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.transport_belt.content_read_mode.pulse) pulse=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type) ---@class defines.control_behavior.type defines.control_behavior.type={ ---[LuaAccumulatorControlBehavior](https://lua-api.factorio.com/latest/LuaAccumulatorControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.accumulator) accumulator=0, ---[LuaArithmeticCombinatorControlBehavior](https://lua-api.factorio.com/latest/LuaArithmeticCombinatorControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.arithmetic_combinator) arithmetic_combinator=0, ---[LuaConstantCombinatorControlBehavior](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.constant_combinator) constant_combinator=0, ---[LuaContainerControlBehavior](https://lua-api.factorio.com/latest/LuaContainerControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.container) container=0, ---[LuaDeciderCombinatorControlBehavior](https://lua-api.factorio.com/latest/LuaDeciderCombinatorControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.decider_combinator) decider_combinator=0, ---[LuaGenericOnOffControlBehavior](https://lua-api.factorio.com/latest/LuaGenericOnOffControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.generic_on_off) generic_on_off=0, ---[LuaInserterControlBehavior](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.inserter) inserter=0, ---[LuaLampControlBehavior](https://lua-api.factorio.com/latest/LuaLampControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.lamp) lamp=0, ---[LuaLogisticContainerControlBehavior](https://lua-api.factorio.com/latest/LuaLogisticContainerControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.logistic_container) logistic_container=0, ---[LuaMiningDrillControlBehavior](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.mining_drill) mining_drill=0, ---[LuaProgrammableSpeakerControlBehavior](https://lua-api.factorio.com/latest/LuaProgrammableSpeakerControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.programmable_speaker) programmable_speaker=0, ---[LuaRailChainSignalControlBehavior](https://lua-api.factorio.com/latest/LuaRailChainSignalControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.rail_chain_signal) rail_chain_signal=0, ---[LuaRailSignalControlBehavior](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.rail_signal) rail_signal=0, ---[LuaRoboportControlBehavior](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.roboport) roboport=0, ---[LuaStorageTankControlBehavior](https://lua-api.factorio.com/latest/LuaStorageTankControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.storage_tank) storage_tank=0, ---[LuaTrainStopControlBehavior](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.train_stop) train_stop=0, ---[LuaTransportBeltControlBehavior](https://lua-api.factorio.com/latest/LuaTransportBeltControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.transport_belt) transport_belt=0, ---[LuaWallControlBehavior](https://lua-api.factorio.com/latest/LuaWallControlBehavior.html) --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.control_behavior.type.wall) wall=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.controllers) ---@class defines.controllers defines.controllers={ ---The controller controls a character. This is the default controller in freeplay. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.controllers.character) character=0, ---The player can't interact with the world, and the camera pans around in a predefined manner. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene) cutscene=0, ---The Editor Controller near ultimate power to do almost anything in the game. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.controllers.editor) editor=0, ---Can't interact with the world, can only observe. Used in the multiplayer waiting-to-respawn screen. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.controllers.ghost) ghost=0, ---The controller isn't tied to a character. This is the default controller in sandbox. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.controllers.god) god=0, ---Can't change anything in the world but can view anything. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.controllers.spectator) spectator=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item) ---@class defines.deconstruction_item defines.deconstruction_item={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.entity_filter_mode) ---@class defines.deconstruction_item.entity_filter_mode defines.deconstruction_item.entity_filter_mode={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.entity_filter_mode.blacklist) blacklist=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.entity_filter_mode.whitelist) whitelist=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.tile_filter_mode) ---@class defines.deconstruction_item.tile_filter_mode defines.deconstruction_item.tile_filter_mode={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.tile_filter_mode.blacklist) blacklist=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.tile_filter_mode.whitelist) whitelist=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.tile_selection_mode) ---@class defines.deconstruction_item.tile_selection_mode defines.deconstruction_item.tile_selection_mode={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.tile_selection_mode.always) always=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.tile_selection_mode.never) never=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.tile_selection_mode.normal) normal=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.deconstruction_item.tile_selection_mode.only) only=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty) ---@class defines.difficulty defines.difficulty={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty.easy) easy=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty.hard) hard=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty.normal) normal=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty_settings) ---@class defines.difficulty_settings defines.difficulty_settings={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty_settings.recipe_difficulty) ---@class defines.difficulty_settings.recipe_difficulty defines.difficulty_settings.recipe_difficulty={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty_settings.recipe_difficulty.expensive) expensive=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty_settings.recipe_difficulty.normal) normal=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty_settings.technology_difficulty) ---@class defines.difficulty_settings.technology_difficulty defines.difficulty_settings.technology_difficulty={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty_settings.technology_difficulty.expensive) expensive=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.difficulty_settings.technology_difficulty.normal) normal=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.direction) ---@class defines.direction defines.direction={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.direction.east) east=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.direction.north) north=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.direction.northeast) northeast=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.direction.northwest) northwest=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.direction.south) south=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.direction.southeast) southeast=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.direction.southwest) southwest=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.direction.west) west=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason) ---@class defines.disconnect_reason defines.disconnect_reason={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.afk) afk=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.banned) banned=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.cannot_keep_up) cannot_keep_up=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.desync_limit_reached) desync_limit_reached=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.dropped) dropped=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.kicked) kicked=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.kicked_and_deleted) kicked_and_deleted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.quit) quit=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.reconnect) reconnect=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.switching_servers) switching_servers=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.disconnect_reason.wrong_input) wrong_input=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.distraction) ---@class defines.distraction defines.distraction={ ---Attack closer enemy entities, including entities "built" by player (belts, inserters, chests). --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.distraction.by_anything) by_anything=0, ---Attack when attacked. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.distraction.by_damage) by_damage=0, ---Attack closer enemy entities with force. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.distraction.by_enemy) by_enemy=0, ---Perform command even if someone attacks the unit. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.distraction.none) none=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status) ---@class defines.entity_status defines.entity_status={ ---Used by rail signals. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.cant_divide_segments) cant_divide_segments=0, ---Used by accumulators. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.charging) charging=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.closed_by_circuit_network) closed_by_circuit_network=0, ---Used by constant combinators: Combinator is turned off via switch in GUI. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.disabled) disabled=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.disabled_by_control_behavior) disabled_by_control_behavior=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.disabled_by_script) disabled_by_script=0, ---Used by accumulators. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.discharging) discharging=0, ---Used by crafting machines. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.fluid_ingredient_shortage) fluid_ingredient_shortage=0, ---Used by crafting machines, boilers, burner energy sources and reactors: Reactor/burner has full burnt result inventory, boiler has full output fluidbox. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.full_output) full_output=0, ---Used by accumulators. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.fully_charged) fully_charged=0, ---Used by crafting machines. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.item_ingredient_shortage) item_ingredient_shortage=0, ---Used by the rocket silo. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.launching_rocket) launching_rocket=0, ---Used by boilers and fluid turrets: Boiler still has some fluid but is about to run out. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.low_input_fluid) low_input_fluid=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.low_power) low_power=0, ---Used by heat energy sources. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.low_temperature) low_temperature=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.marked_for_deconstruction) marked_for_deconstruction=0, ---Used by mining drills when the mining fluid is missing. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.missing_required_fluid) missing_required_fluid=0, ---Used by labs. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.missing_science_packs) missing_science_packs=0, ---Used by power switches. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.networks_connected) networks_connected=0, ---Used by power switches. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.networks_disconnected) networks_disconnected=0, ---Used by ammo turrets. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.no_ammo) no_ammo=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.no_fuel) no_fuel=0, ---Used by furnaces. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.no_ingredients) no_ingredients=0, ---Used by boilers, fluid turrets and fluid energy sources: Boiler has no fluid to work with. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.no_input_fluid) no_input_fluid=0, ---Used by mining drills. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.no_minable_resources) no_minable_resources=0, ---Used by beacons. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.no_modules_to_transmit) no_modules_to_transmit=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.no_power) no_power=0, ---Used by assembling machines. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.no_recipe) no_recipe=0, ---Used by labs. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.no_research_in_progress) no_research_in_progress=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.normal) normal=0, ---Used by rail signals. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.not_connected_to_rail) not_connected_to_rail=0, ---Used by generators and solar panels. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.not_plugged_in_electric_network) not_plugged_in_electric_network=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.opened_by_circuit_network) opened_by_circuit_network=0, ---Used by logistic containers. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.out_of_logistic_network) out_of_logistic_network=0, ---Used by the rocket silo. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.preparing_rocket_for_launch) preparing_rocket_for_launch=0, ---Used by roboports. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.recharging_after_power_outage) recharging_after_power_outage=0, ---Used by lamps. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.turned_off_during_daytime) turned_off_during_daytime=0, ---Used by inserters. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.waiting_for_source_items) waiting_for_source_items=0, ---Used by inserters and mining drills. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.waiting_for_space_in_destination) waiting_for_space_in_destination=0, ---Used by inserters targeting entity ghosts. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.waiting_for_target_to_be_built) waiting_for_target_to_be_built=0, ---Used by inserters targeting rails. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.waiting_for_train) waiting_for_train=0, ---Used by the rocket silo. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.waiting_to_launch_rocket) waiting_to_launch_rocket=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.entity_status.working) working=0, } ---See the [events page](https://lua-api.factorio.com/latest/events.html) for more info on what events contain and when they get raised. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events) ---@class defines.events defines.events={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_ai_command_completed) on_ai_command_completed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_area_cloned) on_area_cloned=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_biter_base_built) on_biter_base_built=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_brush_cloned) on_brush_cloned=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_build_base_arrived) on_build_base_arrived=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_built_entity) on_built_entity=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_cancelled_deconstruction) on_cancelled_deconstruction=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_cancelled_upgrade) on_cancelled_upgrade=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_character_corpse_expired) on_character_corpse_expired=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_chart_tag_added) on_chart_tag_added=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_chart_tag_modified) on_chart_tag_modified=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_chart_tag_removed) on_chart_tag_removed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_chunk_charted) on_chunk_charted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_chunk_deleted) on_chunk_deleted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_chunk_generated) on_chunk_generated=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_combat_robot_expired) on_combat_robot_expired=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_console_chat) on_console_chat=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_console_command) on_console_command=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_cutscene_cancelled) on_cutscene_cancelled=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_cutscene_waypoint_reached) on_cutscene_waypoint_reached=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_difficulty_settings_changed) on_difficulty_settings_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_cloned) on_entity_cloned=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_damaged) on_entity_damaged=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_destroyed) on_entity_destroyed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_died) on_entity_died=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_logistic_slot_changed) on_entity_logistic_slot_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_renamed) on_entity_renamed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_settings_pasted) on_entity_settings_pasted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_spawned) on_entity_spawned=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_force_cease_fire_changed) on_force_cease_fire_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_force_created) on_force_created=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_force_friends_changed) on_force_friends_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_force_reset) on_force_reset=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_forces_merged) on_forces_merged=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_forces_merging) on_forces_merging=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_game_created_from_scenario) on_game_created_from_scenario=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_checked_state_changed) on_gui_checked_state_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_click) on_gui_click=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_closed) on_gui_closed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_confirmed) on_gui_confirmed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_elem_changed) on_gui_elem_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_location_changed) on_gui_location_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_opened) on_gui_opened=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_selected_tab_changed) on_gui_selected_tab_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_selection_state_changed) on_gui_selection_state_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_switch_state_changed) on_gui_switch_state_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_text_changed) on_gui_text_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_value_changed) on_gui_value_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_land_mine_armed) on_land_mine_armed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_lua_shortcut) on_lua_shortcut=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_marked_for_deconstruction) on_marked_for_deconstruction=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_marked_for_upgrade) on_marked_for_upgrade=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_market_item_purchased) on_market_item_purchased=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_mod_item_opened) on_mod_item_opened=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_permission_group_added) on_permission_group_added=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_permission_group_deleted) on_permission_group_deleted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_permission_group_edited) on_permission_group_edited=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_permission_string_imported) on_permission_string_imported=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_picked_up_item) on_picked_up_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_alt_selected_area) on_player_alt_selected_area=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_ammo_inventory_changed) on_player_ammo_inventory_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_armor_inventory_changed) on_player_armor_inventory_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_banned) on_player_banned=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_built_tile) on_player_built_tile=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_cancelled_crafting) on_player_cancelled_crafting=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_changed_force) on_player_changed_force=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_changed_position) on_player_changed_position=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_changed_surface) on_player_changed_surface=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_cheat_mode_disabled) on_player_cheat_mode_disabled=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_cheat_mode_enabled) on_player_cheat_mode_enabled=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_clicked_gps_tag) on_player_clicked_gps_tag=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_configured_blueprint) on_player_configured_blueprint=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_configured_spider_remote) on_player_configured_spider_remote=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_crafted_item) on_player_crafted_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_created) on_player_created=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_cursor_stack_changed) on_player_cursor_stack_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_deconstructed_area) on_player_deconstructed_area=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_demoted) on_player_demoted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_died) on_player_died=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_display_resolution_changed) on_player_display_resolution_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_display_scale_changed) on_player_display_scale_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_driving_changed_state) on_player_driving_changed_state=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_dropped_item) on_player_dropped_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_fast_transferred) on_player_fast_transferred=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_flushed_fluid) on_player_flushed_fluid=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_gun_inventory_changed) on_player_gun_inventory_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_joined_game) on_player_joined_game=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_kicked) on_player_kicked=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_left_game) on_player_left_game=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_main_inventory_changed) on_player_main_inventory_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_mined_entity) on_player_mined_entity=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_mined_item) on_player_mined_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_mined_tile) on_player_mined_tile=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_muted) on_player_muted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_pipette) on_player_pipette=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_placed_equipment) on_player_placed_equipment=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_promoted) on_player_promoted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_removed) on_player_removed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_removed_equipment) on_player_removed_equipment=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_repaired_entity) on_player_repaired_entity=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_respawned) on_player_respawned=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_rotated_entity) on_player_rotated_entity=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_selected_area) on_player_selected_area=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_set_quick_bar_slot) on_player_set_quick_bar_slot=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_setup_blueprint) on_player_setup_blueprint=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_toggled_alt_mode) on_player_toggled_alt_mode=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_toggled_map_editor) on_player_toggled_map_editor=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_trash_inventory_changed) on_player_trash_inventory_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_unbanned) on_player_unbanned=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_unmuted) on_player_unmuted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_used_capsule) on_player_used_capsule=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_player_used_spider_remote) on_player_used_spider_remote=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_post_entity_died) on_post_entity_died=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_build) on_pre_build=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_chunk_deleted) on_pre_chunk_deleted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_entity_settings_pasted) on_pre_entity_settings_pasted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_ghost_deconstructed) on_pre_ghost_deconstructed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_permission_group_deleted) on_pre_permission_group_deleted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_permission_string_imported) on_pre_permission_string_imported=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_player_crafted_item) on_pre_player_crafted_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_player_died) on_pre_player_died=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_player_left_game) on_pre_player_left_game=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_player_mined_item) on_pre_player_mined_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_player_removed) on_pre_player_removed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_player_toggled_map_editor) on_pre_player_toggled_map_editor=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_robot_exploded_cliff) on_pre_robot_exploded_cliff=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_script_inventory_resized) on_pre_script_inventory_resized=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_surface_cleared) on_pre_surface_cleared=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_surface_deleted) on_pre_surface_deleted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_research_finished) on_research_finished=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_research_reversed) on_research_reversed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_research_started) on_research_started=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_resource_depleted) on_resource_depleted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_robot_built_entity) on_robot_built_entity=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_robot_built_tile) on_robot_built_tile=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_robot_exploded_cliff) on_robot_exploded_cliff=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_robot_mined) on_robot_mined=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_robot_mined_entity) on_robot_mined_entity=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_robot_mined_tile) on_robot_mined_tile=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_robot_pre_mined) on_robot_pre_mined=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_rocket_launch_ordered) on_rocket_launch_ordered=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_rocket_launched) on_rocket_launched=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_runtime_mod_setting_changed) on_runtime_mod_setting_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_script_inventory_resized) on_script_inventory_resized=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_script_path_request_finished) on_script_path_request_finished=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_script_trigger_effect) on_script_trigger_effect=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_sector_scanned) on_sector_scanned=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_selected_entity_changed) on_selected_entity_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_spider_command_completed) on_spider_command_completed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_string_translated) on_string_translated=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_surface_cleared) on_surface_cleared=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_surface_created) on_surface_created=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_surface_deleted) on_surface_deleted=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_surface_imported) on_surface_imported=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_surface_renamed) on_surface_renamed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_technology_effects_reset) on_technology_effects_reset=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_tick) on_tick=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_train_changed_state) on_train_changed_state=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_train_created) on_train_created=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_train_schedule_changed) on_train_schedule_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_trigger_created_entity) on_trigger_created_entity=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_trigger_fired_artillery) on_trigger_fired_artillery=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_unit_added_to_group) on_unit_added_to_group=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_unit_group_created) on_unit_group_created=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_unit_group_finished_gathering) on_unit_group_finished_gathering=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.on_unit_removed_from_group) on_unit_removed_from_group=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.script_raised_built) script_raised_built=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.script_raised_destroy) script_raised_destroy=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.script_raised_revive) script_raised_revive=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.events.script_raised_set_tiles) script_raised_set_tiles=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.flow_precision_index) ---@class defines.flow_precision_index defines.flow_precision_index={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.flow_precision_index.fifty_hours) fifty_hours=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.flow_precision_index.five_seconds) five_seconds=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.flow_precision_index.one_hour) one_hour=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.flow_precision_index.one_minute) one_minute=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.flow_precision_index.one_thousand_hours) one_thousand_hours=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.flow_precision_index.ten_hours) ten_hours=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.flow_precision_index.ten_minutes) ten_minutes=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.flow_precision_index.two_hundred_fifty_hours) two_hundred_fifty_hours=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.group_state) ---@class defines.group_state defines.group_state={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.group_state.attacking_distraction) attacking_distraction=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.group_state.attacking_target) attacking_target=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.group_state.finished) finished=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.group_state.gathering) gathering=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.group_state.moving) moving=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.group_state.pathfinding) pathfinding=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.group_state.wander_in_group) wander_in_group=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type) ---@class defines.gui_type defines.gui_type={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.achievement) achievement=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.blueprint_library) blueprint_library=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.bonus) bonus=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.controller) controller=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.custom) custom=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.entity) entity=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.equipment) equipment=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.item) item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.logistic) logistic=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.none) none=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.other_player) other_player=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.permissions) permissions=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.player_management) player_management=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.production) production=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.research) research=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.server_management) server_management=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.tile) tile=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.trains) trains=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.gui_type.tutorials) tutorials=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action) ---@class defines.input_action defines.input_action={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.activate_copy) activate_copy=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.activate_cut) activate_cut=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.activate_paste) activate_paste=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.add_permission_group) add_permission_group=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.add_train_station) add_train_station=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.admin_action) admin_action=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.alt_select_area) alt_select_area=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.alt_select_blueprint_entities) alt_select_blueprint_entities=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.alternative_copy) alternative_copy=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.begin_mining) begin_mining=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.begin_mining_terrain) begin_mining_terrain=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.build) build=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.build_rail) build_rail=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.build_terrain) build_terrain=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.cancel_craft) cancel_craft=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.cancel_deconstruct) cancel_deconstruct=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.cancel_new_blueprint) cancel_new_blueprint=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.cancel_research) cancel_research=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.cancel_upgrade) cancel_upgrade=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_active_character_tab) change_active_character_tab=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_active_item_group_for_crafting) change_active_item_group_for_crafting=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_active_item_group_for_filters) change_active_item_group_for_filters=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_active_quick_bar) change_active_quick_bar=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_arithmetic_combinator_parameters) change_arithmetic_combinator_parameters=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_decider_combinator_parameters) change_decider_combinator_parameters=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_entity_label) change_entity_label=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_item_description) change_item_description=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_item_label) change_item_label=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_multiplayer_config) change_multiplayer_config=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_picking_state) change_picking_state=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_programmable_speaker_alert_parameters) change_programmable_speaker_alert_parameters=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_programmable_speaker_circuit_parameters) change_programmable_speaker_circuit_parameters=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_programmable_speaker_parameters) change_programmable_speaker_parameters=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_riding_state) change_riding_state=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_shooting_state) change_shooting_state=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_train_stop_station) change_train_stop_station=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_train_wait_condition) change_train_wait_condition=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.change_train_wait_condition_data) change_train_wait_condition_data=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.clear_cursor) clear_cursor=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.connect_rolling_stock) connect_rolling_stock=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.copy) copy=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.copy_entity_settings) copy_entity_settings=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.copy_opened_blueprint) copy_opened_blueprint=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.copy_opened_item) copy_opened_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.craft) craft=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.cursor_split) cursor_split=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.cursor_transfer) cursor_transfer=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.custom_input) custom_input=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.cycle_blueprint_book_backwards) cycle_blueprint_book_backwards=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.cycle_blueprint_book_forwards) cycle_blueprint_book_forwards=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.deconstruct) deconstruct=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.delete_blueprint_library) delete_blueprint_library=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.delete_blueprint_record) delete_blueprint_record=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.delete_custom_tag) delete_custom_tag=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.delete_permission_group) delete_permission_group=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.destroy_item) destroy_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.destroy_opened_item) destroy_opened_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.disconnect_rolling_stock) disconnect_rolling_stock=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.drag_train_schedule) drag_train_schedule=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.drag_train_wait_condition) drag_train_wait_condition=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.drop_blueprint_record) drop_blueprint_record=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.drop_item) drop_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.edit_blueprint_tool_preview) edit_blueprint_tool_preview=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.edit_custom_tag) edit_custom_tag=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.edit_permission_group) edit_permission_group=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.export_blueprint) export_blueprint=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.fast_entity_split) fast_entity_split=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.fast_entity_transfer) fast_entity_transfer=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.flush_opened_entity_fluid) flush_opened_entity_fluid=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.flush_opened_entity_specific_fluid) flush_opened_entity_specific_fluid=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.go_to_train_station) go_to_train_station=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.grab_blueprint_record) grab_blueprint_record=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_checked_state_changed) gui_checked_state_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_click) gui_click=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_confirmed) gui_confirmed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_elem_changed) gui_elem_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_location_changed) gui_location_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_selected_tab_changed) gui_selected_tab_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_selection_state_changed) gui_selection_state_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_switch_state_changed) gui_switch_state_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_text_changed) gui_text_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.gui_value_changed) gui_value_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.import_blueprint) import_blueprint=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.import_blueprint_string) import_blueprint_string=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.import_blueprints_filtered) import_blueprints_filtered=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.import_permissions_string) import_permissions_string=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.inventory_split) inventory_split=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.inventory_transfer) inventory_transfer=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.launch_rocket) launch_rocket=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.lua_shortcut) lua_shortcut=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.map_editor_action) map_editor_action=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.market_offer) market_offer=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.mod_settings_changed) mod_settings_changed=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_achievements_gui) open_achievements_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_blueprint_library_gui) open_blueprint_library_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_blueprint_record) open_blueprint_record=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_bonus_gui) open_bonus_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_character_gui) open_character_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_current_vehicle_gui) open_current_vehicle_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_equipment) open_equipment=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_gui) open_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_item) open_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_logistic_gui) open_logistic_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_mod_item) open_mod_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_parent_of_opened_item) open_parent_of_opened_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_production_gui) open_production_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_technology_gui) open_technology_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_tips_and_tricks_gui) open_tips_and_tricks_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_train_gui) open_train_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_train_station_gui) open_train_station_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.open_trains_gui) open_trains_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.paste_entity_settings) paste_entity_settings=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.place_equipment) place_equipment=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.quick_bar_pick_slot) quick_bar_pick_slot=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.quick_bar_set_selected_page) quick_bar_set_selected_page=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.quick_bar_set_slot) quick_bar_set_slot=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.reassign_blueprint) reassign_blueprint=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.remove_cables) remove_cables=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.remove_train_station) remove_train_station=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.reset_assembling_machine) reset_assembling_machine=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.reset_item) reset_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.rotate_entity) rotate_entity=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.select_area) select_area=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.select_blueprint_entities) select_blueprint_entities=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.select_entity_slot) select_entity_slot=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.select_item) select_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.select_mapper_slot) select_mapper_slot=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.select_next_valid_gun) select_next_valid_gun=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.select_tile_slot) select_tile_slot=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.send_spidertron) send_spidertron=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_auto_launch_rocket) set_auto_launch_rocket=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_autosort_inventory) set_autosort_inventory=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_behavior_mode) set_behavior_mode=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_car_weapons_control) set_car_weapons_control=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_circuit_condition) set_circuit_condition=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_circuit_mode_of_operation) set_circuit_mode_of_operation=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_controller_logistic_trash_filter_item) set_controller_logistic_trash_filter_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_deconstruction_item_tile_selection_mode) set_deconstruction_item_tile_selection_mode=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_deconstruction_item_trees_and_rocks_only) set_deconstruction_item_trees_and_rocks_only=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_entity_color) set_entity_color=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_entity_energy_property) set_entity_energy_property=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_entity_logistic_trash_filter_item) set_entity_logistic_trash_filter_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_filter) set_filter=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_flat_controller_gui) set_flat_controller_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_heat_interface_mode) set_heat_interface_mode=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_heat_interface_temperature) set_heat_interface_temperature=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_infinity_container_filter_item) set_infinity_container_filter_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_infinity_container_remove_unfiltered_items) set_infinity_container_remove_unfiltered_items=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_infinity_pipe_filter) set_infinity_pipe_filter=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_inserter_max_stack_size) set_inserter_max_stack_size=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_inventory_bar) set_inventory_bar=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_linked_container_link_i_d) set_linked_container_link_i_d=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_logistic_filter_item) set_logistic_filter_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_logistic_filter_signal) set_logistic_filter_signal=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_player_color) set_player_color=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_recipe_notifications) set_recipe_notifications=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_request_from_buffers) set_request_from_buffers=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_research_finished_stops_game) set_research_finished_stops_game=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_signal) set_signal=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_splitter_priority) set_splitter_priority=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_train_stopped) set_train_stopped=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_trains_limit) set_trains_limit=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.set_vehicle_automatic_targeting_parameters) set_vehicle_automatic_targeting_parameters=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.setup_assembling_machine) setup_assembling_machine=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.setup_blueprint) setup_blueprint=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.setup_single_blueprint_record) setup_single_blueprint_record=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.smart_pipette) smart_pipette=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.spawn_item) spawn_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.stack_split) stack_split=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.stack_transfer) stack_transfer=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.start_repair) start_repair=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.start_research) start_research=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.start_walking) start_walking=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.stop_building_by_moving) stop_building_by_moving=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.switch_connect_to_logistic_network) switch_connect_to_logistic_network=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.switch_constant_combinator_state) switch_constant_combinator_state=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.switch_inserter_filter_mode_state) switch_inserter_filter_mode_state=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.switch_power_switch_state) switch_power_switch_state=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.switch_to_rename_stop_gui) switch_to_rename_stop_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.take_equipment) take_equipment=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_deconstruction_item_entity_filter_mode) toggle_deconstruction_item_entity_filter_mode=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_deconstruction_item_tile_filter_mode) toggle_deconstruction_item_tile_filter_mode=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_driving) toggle_driving=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_enable_vehicle_logistics_while_moving) toggle_enable_vehicle_logistics_while_moving=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_entity_logistic_requests) toggle_entity_logistic_requests=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_equipment_movement_bonus) toggle_equipment_movement_bonus=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_map_editor) toggle_map_editor=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_personal_logistic_requests) toggle_personal_logistic_requests=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_personal_roboport) toggle_personal_roboport=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.toggle_show_entity_info) toggle_show_entity_info=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.translate_string) translate_string=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.undo) undo=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.upgrade) upgrade=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.upgrade_opened_blueprint_by_item) upgrade_opened_blueprint_by_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.upgrade_opened_blueprint_by_record) upgrade_opened_blueprint_by_record=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.use_artillery_remote) use_artillery_remote=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.use_item) use_item=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.wire_dragging) wire_dragging=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.input_action.write_to_console) write_to_console=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory) ---@class defines.inventory defines.inventory={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.artillery_turret_ammo) artillery_turret_ammo=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.artillery_wagon_ammo) artillery_wagon_ammo=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.assembling_machine_input) assembling_machine_input=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.assembling_machine_modules) assembling_machine_modules=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.assembling_machine_output) assembling_machine_output=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.beacon_modules) beacon_modules=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.burnt_result) burnt_result=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.car_ammo) car_ammo=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.car_trunk) car_trunk=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.cargo_wagon) cargo_wagon=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.character_ammo) character_ammo=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.character_armor) character_armor=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.character_corpse) character_corpse=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.character_guns) character_guns=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.character_main) character_main=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.character_trash) character_trash=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.character_vehicle) character_vehicle=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.chest) chest=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.editor_ammo) editor_ammo=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.editor_armor) editor_armor=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.editor_guns) editor_guns=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.editor_main) editor_main=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.fuel) fuel=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.furnace_modules) furnace_modules=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.furnace_result) furnace_result=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.furnace_source) furnace_source=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.god_main) god_main=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.item_main) item_main=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.lab_input) lab_input=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.lab_modules) lab_modules=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.mining_drill_modules) mining_drill_modules=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.roboport_material) roboport_material=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.roboport_robot) roboport_robot=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.robot_cargo) robot_cargo=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.robot_repair) robot_repair=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.rocket) rocket=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.rocket_silo_result) rocket_silo_result=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.rocket_silo_rocket) rocket_silo_rocket=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.spider_ammo) spider_ammo=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.spider_trash) spider_trash=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.spider_trunk) spider_trunk=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.inventory.turret_ammo) turret_ammo=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_member_index) ---@class defines.logistic_member_index defines.logistic_member_index={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_member_index.character_provider) character_provider=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_member_index.character_requester) character_requester=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_member_index.character_storage) character_storage=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_member_index.generic_on_off_behavior) generic_on_off_behavior=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_member_index.logistic_container) logistic_container=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_member_index.vehicle_storage) vehicle_storage=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_mode) ---@class defines.logistic_mode defines.logistic_mode={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_mode.active_provider) active_provider=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_mode.buffer) buffer=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_mode.none) none=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_mode.passive_provider) passive_provider=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_mode.requester) requester=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.logistic_mode.storage) storage=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.mouse_button_type) ---@class defines.mouse_button_type defines.mouse_button_type={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.mouse_button_type.left) left=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.mouse_button_type.middle) middle=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.mouse_button_type.none) none=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.mouse_button_type.right) right=0, } ---A dictionary mapping all top-level prototypes by name to a list of their associated subtypes. This list is organized as a lookup table, meaning it maps the sub-prototype names to `0`. As an example, `defines.prototypes['entity']` looks like this: `{furnace=0, inserter=0, container=0, ...}`. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.prototypes) ---@class defines.prototypes defines.prototypes={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rail_connection_direction) ---@class defines.rail_connection_direction defines.rail_connection_direction={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rail_connection_direction.left) left=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rail_connection_direction.none) none=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rail_connection_direction.right) right=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rail_connection_direction.straight) straight=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rail_direction) ---@class defines.rail_direction defines.rail_direction={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rail_direction.back) back=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rail_direction.front) front=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_position) ---@class defines.relative_gui_position defines.relative_gui_position={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_position.bottom) bottom=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_position.left) left=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_position.right) right=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_position.top) top=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type) ---@class defines.relative_gui_type defines.relative_gui_type={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.accumulator_gui) accumulator_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.achievement_gui) achievement_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.additional_entity_info_gui) additional_entity_info_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.admin_gui) admin_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.arithmetic_combinator_gui) arithmetic_combinator_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.armor_gui) armor_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.assembling_machine_gui) assembling_machine_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.assembling_machine_select_recipe_gui) assembling_machine_select_recipe_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.beacon_gui) beacon_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.blueprint_book_gui) blueprint_book_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.blueprint_library_gui) blueprint_library_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.blueprint_setup_gui) blueprint_setup_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.bonus_gui) bonus_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.burner_equipment_gui) burner_equipment_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.car_gui) car_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.constant_combinator_gui) constant_combinator_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.container_gui) container_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.controller_gui) controller_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.decider_combinator_gui) decider_combinator_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.deconstruction_item_gui) deconstruction_item_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.electric_energy_interface_gui) electric_energy_interface_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.electric_network_gui) electric_network_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.entity_variations_gui) entity_variations_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.entity_with_energy_source_gui) entity_with_energy_source_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.equipment_grid_gui) equipment_grid_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.furnace_gui) furnace_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.generic_on_off_entity_gui) generic_on_off_entity_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.heat_interface_gui) heat_interface_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.infinity_pipe_gui) infinity_pipe_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.inserter_gui) inserter_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.item_with_inventory_gui) item_with_inventory_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.lab_gui) lab_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.lamp_gui) lamp_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.linked_container_gui) linked_container_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.loader_gui) loader_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.logistic_gui) logistic_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.market_gui) market_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.mining_drill_gui) mining_drill_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.other_player_gui) other_player_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.permissions_gui) permissions_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.pipe_gui) pipe_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.power_switch_gui) power_switch_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.production_gui) production_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.programmable_speaker_gui) programmable_speaker_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.rail_chain_signal_gui) rail_chain_signal_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.rail_signal_gui) rail_signal_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.reactor_gui) reactor_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.rename_stop_gui) rename_stop_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.resource_entity_gui) resource_entity_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.roboport_gui) roboport_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.rocket_silo_gui) rocket_silo_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.server_config_gui) server_config_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.spider_vehicle_gui) spider_vehicle_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.splitter_gui) splitter_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.standalone_character_gui) standalone_character_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.storage_tank_gui) storage_tank_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.tile_variations_gui) tile_variations_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.train_gui) train_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.train_stop_gui) train_stop_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.trains_gui) trains_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.transport_belt_gui) transport_belt_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.upgrade_item_gui) upgrade_item_gui=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.relative_gui_type.wall_gui) wall_gui=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.render_mode) ---@class defines.render_mode defines.render_mode={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.render_mode.chart) chart=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.render_mode.chart_zoomed_in) chart_zoomed_in=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.render_mode.game) game=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rich_text_setting) ---@class defines.rich_text_setting defines.rich_text_setting={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rich_text_setting.disabled) disabled=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rich_text_setting.enabled) enabled=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.rich_text_setting.highlight) highlight=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding) ---@class defines.riding defines.riding={ } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding.acceleration) ---@class defines.riding.acceleration defines.riding.acceleration={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding.acceleration.accelerating) accelerating=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding.acceleration.braking) braking=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding.acceleration.nothing) nothing=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding.acceleration.reversing) reversing=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding.direction) ---@class defines.riding.direction defines.riding.direction={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding.direction.left) left=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding.direction.right) right=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.riding.direction.straight) straight=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.shooting) ---@class defines.shooting defines.shooting={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.shooting.not_shooting) not_shooting=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.shooting.shooting_enemies) shooting_enemies=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.shooting.shooting_selected) shooting_selected=0, } ---State of an ordinary rail signal. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.signal_state) ---@class defines.signal_state defines.signal_state={ ---Red. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.signal_state.closed) closed=0, ---Green. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.signal_state.open) open=0, ---Orange. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.signal_state.reserved) reserved=0, ---Red - From circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.signal_state.reserved_by_circuit_network) reserved_by_circuit_network=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state) ---@class defines.train_state defines.train_state={ ---Braking before a rail signal. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.arrive_signal) arrive_signal=0, ---Braking before a station. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.arrive_station) arrive_station=0, ---Same as no_path but all candidate train stops are full --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.destination_full) destination_full=0, ---Can move if user explicitly sits in and rides the train. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.manual_control) manual_control=0, ---Switched to manual control and has to stop. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.manual_control_stop) manual_control_stop=0, ---Has no path and is stopped. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.no_path) no_path=0, ---Doesn't have anywhere to go. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.no_schedule) no_schedule=0, ---Normal state -- following the path. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.on_the_path) on_the_path=0, ---Had path and lost it -- must stop. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.path_lost) path_lost=0, ---Waiting at a signal. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.wait_signal) wait_signal=0, ---Waiting at a station. --- ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.train_state.wait_station) wait_station=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line) ---@class defines.transport_line defines.transport_line={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.left_line) left_line=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.left_split_line) left_split_line=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.left_underground_line) left_underground_line=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.right_line) right_line=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.right_split_line) right_split_line=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.right_underground_line) right_underground_line=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.secondary_left_line) secondary_left_line=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.secondary_left_split_line) secondary_left_split_line=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.secondary_right_line) secondary_right_line=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.transport_line.secondary_right_split_line) secondary_right_split_line=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.wire_connection_id) ---@class defines.wire_connection_id defines.wire_connection_id={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.wire_connection_id.electric_pole) electric_pole=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.wire_connection_id.power_switch_left) power_switch_left=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.wire_connection_id.power_switch_right) power_switch_right=0, } ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.wire_type) ---@class defines.wire_type defines.wire_type={ ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.wire_type.copper) copper=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.wire_type.green) green=0, ---[View documentation](https://lua-api.factorio.com/latest/defines.html#defines.wire_type.red) red=0, } ---Called when a unit/group completes a command. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_ai_command_completed) ---@class on_ai_command_completed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_ai_command_completed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_ai_command_completed) ---@field result defines.behavior_result ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_ai_command_completed) ---@field tick uint ---unit_number/group_number of the unit/group which just completed a command. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_ai_command_completed) ---@field unit_number uint ---Was this command generated by a distraction. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_ai_command_completed) ---@field was_distracted boolean ---Called when an area of the map is cloned. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@class on_area_cloned ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field clear_destination_decoratives boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field clear_destination_entities boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field clone_decoratives boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field clone_entities boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field clone_tiles boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field destination_area BoundingBox> ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field destination_force LuaForce|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field destination_surface LuaSurface ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field source_area BoundingBox> ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field source_surface LuaSurface ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_area_cloned) ---@field tick uint ---Called when a biter migration builds a base. --- ---**Note:** This will be called multiple times for each migration, once for every biter that is sacrificed to build part of the new base. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_biter_base_built) ---@class on_biter_base_built ---The entity that was built. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_biter_base_built) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_biter_base_built) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_biter_base_built) ---@field tick uint ---Called when a set of positions on the map is cloned. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@class on_brush_cloned ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field clear_destination_decoratives boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field clear_destination_entities boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field clone_decoratives boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field clone_entities boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field clone_tiles boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field destination_force LuaForce|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field destination_offset TilePosition ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field destination_surface LuaSurface ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field source_offset TilePosition ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field source_positions TilePosition[] ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field source_surface LuaSurface ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_brush_cloned) ---@field tick uint ---Called when a [defines.command.build_base](https://lua-api.factorio.com/latest/defines.html#defines.command.build_base) command reaches its destination, and before building starts. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_build_base_arrived) ---@class on_build_base_arrived ---The unit group the command was assigned to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_build_base_arrived) ---@field group LuaUnitGroup|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_build_base_arrived) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_build_base_arrived) ---@field tick uint ---The unit the command was assigned to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_build_base_arrived) ---@field unit LuaEntity|nil ---Called when player builds something. Can be filtered using [LuaPlayerBuiltEntityEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerBuiltEntityEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_built_entity) ---@class on_built_entity ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_built_entity) ---@field created_entity LuaEntity ---The item prototype used to build the entity. Note this won't exist in some situations (built from blueprint, undo, etc). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_built_entity) ---@field item LuaItemPrototype|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_built_entity) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_built_entity) ---@field player_index uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_built_entity) ---@field stack LuaItemStack ---The tags associated with this entity if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_built_entity) ---@field tags Tags|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_built_entity) ---@field tick uint ---Called when the deconstruction of an entity is canceled. Can be filtered using [LuaEntityDeconstructionCancelledEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDeconstructionCancelledEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_deconstruction) ---@class on_cancelled_deconstruction ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_deconstruction) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_deconstruction) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_deconstruction) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_deconstruction) ---@field tick uint ---Called when the upgrade of an entity is canceled. Can be filtered using [LuaUpgradeCancelledEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaUpgradeCancelledEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_upgrade) ---@class on_cancelled_upgrade ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_upgrade) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_upgrade) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_upgrade) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cancelled_upgrade) ---@field tick uint ---Called when a character corpse expires due to timeout or all of the items being removed from it. --- ---**Note:** this is not called if the corpse is mined. See [defines.events.on_pre_player_mined_item](https://lua-api.factorio.com/latest/defines.html#defines.events.on_pre_player_mined_item) to detect that. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_character_corpse_expired) ---@class on_character_corpse_expired ---The corpse. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_character_corpse_expired) ---@field corpse LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_character_corpse_expired) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_character_corpse_expired) ---@field tick uint ---Called when a chart tag is created. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_added) ---@class on_chart_tag_added ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_added) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_added) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_added) ---@field player_index uint|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_added) ---@field tag LuaCustomChartTag ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_added) ---@field tick uint ---Called when a chart tag is modified by a player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_modified) ---@class on_chart_tag_modified ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_modified) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_modified) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_modified) ---@field old_icon SignalID|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_modified) ---@field old_player uint|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_modified) ---@field old_text string ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_modified) ---@field player_index uint|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_modified) ---@field tag LuaCustomChartTag ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_modified) ---@field tick uint ---Called just before a chart tag is deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_removed) ---@class on_chart_tag_removed ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_removed) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_removed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_removed) ---@field player_index uint|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_removed) ---@field tag LuaCustomChartTag ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chart_tag_removed) ---@field tick uint ---Called when a chunk is charted or re-charted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_charted) ---@class on_chunk_charted ---Area of the chunk. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_charted) ---@field area BoundingBox> ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_charted) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_charted) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_charted) ---@field position ChunkPosition ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_charted) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_charted) ---@field tick uint ---Called when one or more chunks are deleted using [LuaSurface::delete_chunk](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.delete_chunk). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_deleted) ---@class on_chunk_deleted ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_deleted) ---@field name defines.events ---The chunks deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_deleted) ---@field positions ChunkPosition[] ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_deleted) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_deleted) ---@field tick uint ---Called when a chunk is generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_generated) ---@class on_chunk_generated ---Area of the chunk. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_generated) ---@field area BoundingBox> ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_generated) ---@field name defines.events ---Position of the chunk. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_generated) ---@field position ChunkPosition ---The surface the chunk is on. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_generated) ---@field surface LuaSurface ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_chunk_generated) ---@field tick uint ---Called when a combat robot expires through a lack of energy, or timeout. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_combat_robot_expired) ---@class on_combat_robot_expired ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_combat_robot_expired) ---@field name defines.events ---The entity that owns the robot if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_combat_robot_expired) ---@field owner LuaEntity|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_combat_robot_expired) ---@field robot LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_combat_robot_expired) ---@field tick uint ---Called when someone talks in-game either a player or through the server interface. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_chat) ---@class on_console_chat ---The chat message that was sent. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_chat) ---@field message string ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_chat) ---@field name defines.events ---The player doing the chatting, if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_chat) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_chat) ---@field tick uint ---Called when someone enters a command-like message regardless of it being a valid command. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_command) ---@class on_console_command ---The command as typed without the preceding forward slash ('/'). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_command) ---@field command string ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_command) ---@field name defines.events ---The parameters provided if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_command) ---@field parameters string ---The player if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_command) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_console_command) ---@field tick uint ---Called when a cutscene is cancelled by the player or by script. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cutscene_cancelled) ---@class on_cutscene_cancelled ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cutscene_cancelled) ---@field name defines.events ---The player the cutscene was shown to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cutscene_cancelled) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cutscene_cancelled) ---@field tick uint ---Called when a cutscene is playing, each time it reaches a waypoint in that cutscene. ---This refers to an index in the table previously passed to set_controller which started the cutscene. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cutscene_waypoint_reached) ---@class on_cutscene_waypoint_reached ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cutscene_waypoint_reached) ---@field name defines.events ---The player index of the player viewing the cutscene. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cutscene_waypoint_reached) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cutscene_waypoint_reached) ---@field tick uint ---The index of the waypoint we just completed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_cutscene_waypoint_reached) ---@field waypoint_index uint ---Called when the map difficulty settings are changed. --- ---**Note:** It's not guaranteed that both settings are changed - just that at least one has been changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_difficulty_settings_changed) ---@class on_difficulty_settings_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_difficulty_settings_changed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_difficulty_settings_changed) ---@field old_recipe_difficulty uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_difficulty_settings_changed) ---@field old_technology_difficulty uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_difficulty_settings_changed) ---@field tick uint ---Called when an entity is cloned. Can be filtered for the source entity using [LuaEntityClonedEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityClonedEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_cloned) ---@class on_entity_cloned ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_cloned) ---@field destination LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_cloned) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_cloned) ---@field source LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_cloned) ---@field tick uint ---Called when an entity is damaged. Can be filtered using [LuaEntityDamagedEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDamagedEventFilter). --- ---**Note:** This is not called when an entities health is set directly by another mod. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@class on_entity_damaged ---The entity that did the attacking if available. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@field cause LuaEntity|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@field damage_type LuaDamagePrototype ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@field entity LuaEntity ---The damage amount after resistances. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@field final_damage_amount float ---The health of the entity after the damage was applied. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@field final_health float ---The force that did the attacking if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@field force LuaForce|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@field name defines.events ---The damage amount before resistances. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@field original_damage_amount float ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) ---@field tick uint ---Called after an entity is destroyed that has been registered with [LuaBootstrap::register_on_entity_destroyed](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.register_on_entity_destroyed) --- ---**Note:** Depending on when a given entity is destroyed this will be fired at the end of the current tick or end of the next tick. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_destroyed) ---@class on_entity_destroyed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_destroyed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_destroyed) ---@field registration_number uint64 ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_destroyed) ---@field tick uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_destroyed) ---@field unit_number uint|nil ---Called when an entity dies. Can be filtered using [LuaEntityDiedEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDiedEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_died) ---@class on_entity_died ---The entity that did the killing if available. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_died) ---@field cause LuaEntity|nil ---The damage type if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_died) ---@field damage_type LuaDamagePrototype|nil ---The entity that died. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_died) ---@field entity LuaEntity ---The force that did the killing if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_died) ---@field force LuaForce|nil ---The loot generated by this entity if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_died) ---@field loot LuaInventory ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_died) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_died) ---@field tick uint ---Called when one of an entity's personal logistic slots changes. --- ---**Note:** "Personal logistic slot" refers to a character or vehicle's personal request / auto-trash slots, not the request slots on logistic chests. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_logistic_slot_changed) ---@class on_entity_logistic_slot_changed ---The entity for whom a logistic slot was changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_logistic_slot_changed) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_logistic_slot_changed) ---@field name defines.events ---The player who changed the slot, or `nil` if changed by script. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_logistic_slot_changed) ---@field player_index uint|nil ---The slot index that was changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_logistic_slot_changed) ---@field slot_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_logistic_slot_changed) ---@field tick uint ---Called after an entity has been renamed either by the player or through script. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_renamed) ---@class on_entity_renamed ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_renamed) ---@field by_script boolean ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_renamed) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_renamed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_renamed) ---@field old_name string ---If by_script is true this will not be included. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_renamed) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_renamed) ---@field tick uint ---Called after entity copy-paste is done. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_settings_pasted) ---@class on_entity_settings_pasted ---The destination entity settings were copied to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_settings_pasted) ---@field destination LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_settings_pasted) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_settings_pasted) ---@field player_index uint ---The source entity settings were copied from. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_settings_pasted) ---@field source LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_settings_pasted) ---@field tick uint ---Called when an entity is spawned by a EnemySpawner --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_spawned) ---@class on_entity_spawned ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_spawned) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_spawned) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_spawned) ---@field spawner LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_entity_spawned) ---@field tick uint ---Called when the a forces cease fire values change. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_cease_fire_changed) ---@class on_force_cease_fire_changed ---If the other force was added or removed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_cease_fire_changed) ---@field added boolean ---The force who's cease fire changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_cease_fire_changed) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_cease_fire_changed) ---@field name defines.events ---Which force was added or removed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_cease_fire_changed) ---@field other_force LuaForce ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_cease_fire_changed) ---@field tick uint ---Called when a new force is created using `game.create_force()` --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_created) ---@class on_force_created ---The newly created force. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_created) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_created) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_created) ---@field tick uint ---Called when the a forces friends change. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_friends_changed) ---@class on_force_friends_changed ---If the other force was added or removed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_friends_changed) ---@field added boolean ---The force who's friends changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_friends_changed) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_friends_changed) ---@field name defines.events ---Which force was added or removed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_friends_changed) ---@field other_force LuaForce ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_friends_changed) ---@field tick uint ---Called when [LuaForce::reset](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.reset) is finished. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_reset) ---@class on_force_reset ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_reset) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_reset) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_force_reset) ---@field tick uint ---Called after two forces have been merged using `game.merge_forces()`. --- ---**Note:** The source force is invalidated before this event is called and the name can be re-used in this event if desired. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merged) ---@class on_forces_merged ---The force entities where reassigned to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merged) ---@field destination LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merged) ---@field name defines.events ---The index of the destroyed force. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merged) ---@field source_index uint ---The force destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merged) ---@field source_name string ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merged) ---@field tick uint ---Called when two forces are about to be merged using `game.merge_forces()`. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merging) ---@class on_forces_merging ---The force to reassign entities to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merging) ---@field destination LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merging) ---@field name defines.events ---The force to be destroyed --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merging) ---@field source LuaForce ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_forces_merging) ---@field tick uint ---Called when a game is created from a scenario. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_game_created_from_scenario) ---@class on_game_created_from_scenario ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_game_created_from_scenario) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_game_created_from_scenario) ---@field tick uint ---Called when [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) checked state is changed (related to checkboxes and radio buttons). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_checked_state_changed) ---@class on_gui_checked_state_changed ---The element whose checked state changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_checked_state_changed) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_checked_state_changed) ---@field name defines.events ---The player who did the change. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_checked_state_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_checked_state_changed) ---@field tick uint ---Called when [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) is clicked. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_click) ---@class on_gui_click ---If alt was pressed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_click) ---@field alt boolean ---The mouse button used if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_click) ---@field button defines.mouse_button_type ---If control was pressed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_click) ---@field control boolean ---The clicked element. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_click) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_click) ---@field name defines.events ---The player who did the clicking. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_click) ---@field player_index uint ---If shift was pressed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_click) ---@field shift boolean ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_click) ---@field tick uint ---Called when the player closes the GUI they have open. --- ---**Note:** This is only called if the player explicitly closed the GUI. --- ---**Note:** It's not advised to open any other GUI during this event because if this is run as a request to open a different GUI the game will force close the new opened GUI without notice to ensure the original requested GUI is opened. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@class on_gui_closed ---The custom GUI element that was open --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field element LuaGuiElement|nil ---The entity that was open --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field entity LuaEntity|nil ---The equipment that was open --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field equipment LuaEquipment|nil ---The GUI type that was open. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field gui_type defines.gui_type ---The item that was open --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field item LuaItemStack|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field name defines.events ---The other player that was open --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field other_player LuaPlayer|nil ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field player_index uint ---The technology that was automatically selected when opening the research GUI --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field technology LuaTechnology|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field tick uint ---The tile position that was open --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_closed) ---@field tile_position TilePosition|nil ---Called when a [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) is confirmed, for example by pressing Enter in a textfield. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_confirmed) ---@class on_gui_confirmed ---If alt was pressed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_confirmed) ---@field alt boolean ---If control was pressed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_confirmed) ---@field control boolean ---The confirmed element. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_confirmed) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_confirmed) ---@field name defines.events ---The player who did the confirming. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_confirmed) ---@field player_index uint ---If shift was pressed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_confirmed) ---@field shift boolean ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_confirmed) ---@field tick uint ---Called when [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) element value is changed (related to choose element buttons). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_elem_changed) ---@class on_gui_elem_changed ---The element whose element value changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_elem_changed) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_elem_changed) ---@field name defines.events ---The player who did the change. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_elem_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_elem_changed) ---@field tick uint ---Called when [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) element location is changed (related to frames in `player.gui.screen`). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_location_changed) ---@class on_gui_location_changed ---The element whose location changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_location_changed) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_location_changed) ---@field name defines.events ---The player who did the change. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_location_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_location_changed) ---@field tick uint ---Called when the player opens a GUI. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@class on_gui_opened ---The custom GUI element that was opened --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@field element LuaGuiElement|nil ---The entity that was opened --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@field entity LuaEntity|nil ---The equipment that was opened --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@field equipment LuaEquipment|nil ---The GUI type that was opened. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@field gui_type defines.gui_type ---The item that was opened --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@field item LuaItemStack|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@field name defines.events ---The other player that was opened --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@field other_player LuaPlayer|nil ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_opened) ---@field tick uint ---Called when [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) selected tab is changed (related to tabbed-panes). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selected_tab_changed) ---@class on_gui_selected_tab_changed ---The tabbed pane whose selected tab changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selected_tab_changed) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selected_tab_changed) ---@field name defines.events ---The player who did the change. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selected_tab_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selected_tab_changed) ---@field tick uint ---Called when [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) selection state is changed (related to drop-downs and listboxes). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selection_state_changed) ---@class on_gui_selection_state_changed ---The element whose selection state changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selection_state_changed) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selection_state_changed) ---@field name defines.events ---The player who did the change. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selection_state_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_selection_state_changed) ---@field tick uint ---Called when [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) switch state is changed (related to switches). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_switch_state_changed) ---@class on_gui_switch_state_changed ---The switch whose switch state changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_switch_state_changed) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_switch_state_changed) ---@field name defines.events ---The player who did the change. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_switch_state_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_switch_state_changed) ---@field tick uint ---Called when [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) text is changed by the player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_text_changed) ---@class on_gui_text_changed ---The edited element. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_text_changed) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_text_changed) ---@field name defines.events ---The player who did the edit. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_text_changed) ---@field player_index uint ---The new text in the element. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_text_changed) ---@field text string ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_text_changed) ---@field tick uint ---Called when [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) slider value is changed (related to the slider element). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_value_changed) ---@class on_gui_value_changed ---The element whose value changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_value_changed) ---@field element LuaGuiElement ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_value_changed) ---@field name defines.events ---The player who did the change. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_value_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_gui_value_changed) ---@field tick uint ---Called when a land mine is armed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_land_mine_armed) ---@class on_land_mine_armed ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_land_mine_armed) ---@field mine LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_land_mine_armed) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_land_mine_armed) ---@field tick uint ---Called when a custom Lua shortcut is pressed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_lua_shortcut) ---@class on_lua_shortcut ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_lua_shortcut) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_lua_shortcut) ---@field player_index uint ---Shortcut prototype name of the shortcut that was clicked. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_lua_shortcut) ---@field prototype_name string ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_lua_shortcut) ---@field tick uint ---Called when an entity is marked for deconstruction with the Deconstruction planner or via script. Can be filtered using [LuaEntityMarkedForDeconstructionEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForDeconstructionEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_deconstruction) ---@class on_marked_for_deconstruction ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_deconstruction) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_deconstruction) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_deconstruction) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_deconstruction) ---@field tick uint ---Called when an entity is marked for upgrade with the Upgrade planner or via script. Can be filtered using [LuaEntityMarkedForUpgradeEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForUpgradeEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_upgrade) ---@class on_marked_for_upgrade ---The new direction (if any) --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_upgrade) ---@field direction defines.direction|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_upgrade) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_upgrade) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_upgrade) ---@field player_index uint|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_upgrade) ---@field target LuaEntityPrototype ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_marked_for_upgrade) ---@field tick uint ---Called after a player purchases some offer from a `market` entity. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_market_item_purchased) ---@class on_market_item_purchased ---The amount of offers purchased. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_market_item_purchased) ---@field count uint ---The market entity. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_market_item_purchased) ---@field market LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_market_item_purchased) ---@field name defines.events ---The index of the offer purchased. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_market_item_purchased) ---@field offer_index uint ---The player who did the purchasing. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_market_item_purchased) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_market_item_purchased) ---@field tick uint ---Called when the player uses the 'Open item GUI' control on an item defined with the 'mod-openable' flag --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_mod_item_opened) ---@class on_mod_item_opened ---The item clicked on. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_mod_item_opened) ---@field item LuaItemPrototype ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_mod_item_opened) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_mod_item_opened) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_mod_item_opened) ---@field tick uint ---Called directly after a permission group is added. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_added) ---@class on_permission_group_added ---The group added. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_added) ---@field group LuaPermissionGroup ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_added) ---@field name defines.events ---The player that added the group. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_added) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_added) ---@field tick uint ---Called directly after a permission group is deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_deleted) ---@class on_permission_group_deleted ---The group that was deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_deleted) ---@field group_name string ---The group id that was deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_deleted) ---@field id uint ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_deleted) ---@field name defines.events ---The player doing the deletion. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_deleted) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_deleted) ---@field tick uint ---Called directly after a permission group is edited in some way. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@class on_permission_group_edited ---The action when the `type` is "add-permission" or "remove-permission". --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@field action defines.input_action ---The group being edited. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@field group LuaPermissionGroup ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@field name defines.events ---The new group name when the `type` is "rename". --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@field new_name string ---The old group name when the `type` is "rename". --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@field old_name string ---The other player when the `type` is "add-player" or "remove-player". --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@field other_player_index uint ---The player that did the editing. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@field tick uint ---The edit type: "add-permission", "remove-permission", "enable-all", "disable-all", "add-player", "remove-player", "rename". --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_group_edited) ---@field type string ---Called directly after a permission string is imported. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_string_imported) ---@class on_permission_string_imported ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_string_imported) ---@field name defines.events ---The player that imported the string. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_string_imported) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_permission_string_imported) ---@field tick uint ---Called when a player picks up an item. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_picked_up_item) ---@class on_picked_up_item ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_picked_up_item) ---@field item_stack SimpleItemStack ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_picked_up_item) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_picked_up_item) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_picked_up_item) ---@field tick uint ---Called after a player alt-selects an area with a selection-tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area) ---@class on_player_alt_selected_area ---The area selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area) ---@field area BoundingBox> ---The entities selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area) ---@field entities LuaEntity[] ---The item used to select the area. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area) ---@field item string ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area) ---@field name defines.events ---The player doing the selection. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area) ---@field player_index uint ---The surface selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area) ---@field surface LuaSurface ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area) ---@field tick uint ---The tiles selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area) ---@field tiles LuaTile[] ---Called after a players ammo inventory changed in some way. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_ammo_inventory_changed) ---@class on_player_ammo_inventory_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_ammo_inventory_changed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_ammo_inventory_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_ammo_inventory_changed) ---@field tick uint ---Called after a players armor inventory changed in some way. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_armor_inventory_changed) ---@class on_player_armor_inventory_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_armor_inventory_changed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_armor_inventory_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_armor_inventory_changed) ---@field tick uint ---Called when a player is banned. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_banned) ---@class on_player_banned ---The player that did the banning if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_banned) ---@field by_player uint|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_banned) ---@field name defines.events ---The player banned. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_banned) ---@field player_index uint|nil ---The banned player name. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_banned) ---@field player_name string ---The reason given if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_banned) ---@field reason string|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_banned) ---@field tick uint ---Called after a player builds tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_built_tile) ---@class on_player_built_tile ---The item type used to build the tiles --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_built_tile) ---@field item LuaItemPrototype|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_built_tile) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_built_tile) ---@field player_index uint ---The stack used to build the tiles (may be empty if all of the items where used to build the tiles). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_built_tile) ---@field stack LuaItemStack|nil ---The surface the tile(s) were built on. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_built_tile) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_built_tile) ---@field tick uint ---The tile prototype that was placed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_built_tile) ---@field tile LuaTilePrototype ---The position data. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_built_tile) ---@field tiles OldTileAndPosition[] ---Called when a player cancels crafting. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cancelled_crafting) ---@class on_player_cancelled_crafting ---The number of crafts that have been cancelled. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cancelled_crafting) ---@field cancel_count uint ---The crafting items returned to the player's inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cancelled_crafting) ---@field items LuaInventory ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cancelled_crafting) ---@field name defines.events ---The player that did the crafting. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cancelled_crafting) ---@field player_index uint ---The recipe that has been cancelled. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cancelled_crafting) ---@field recipe LuaRecipe ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cancelled_crafting) ---@field tick uint ---Called after a player changes forces. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_force) ---@class on_player_changed_force ---The old force. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_force) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_force) ---@field name defines.events ---The player who changed forces. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_force) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_force) ---@field tick uint ---Called when the tile position a player is located at changes. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_position) ---@class on_player_changed_position ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_position) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_position) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_position) ---@field tick uint ---Called after a player changes surfaces. --- ---**Note:** In the instance a player is moved off a surface due to it being deleted this is not called. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_surface) ---@class on_player_changed_surface ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_surface) ---@field name defines.events ---The player who changed surfaces. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_surface) ---@field player_index uint ---The surface index the player was on. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_surface) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_changed_surface) ---@field tick uint ---Called when cheat mode is disabled on a player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_disabled) ---@class on_player_cheat_mode_disabled ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_disabled) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_disabled) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_disabled) ---@field tick uint ---Called when cheat mode is enabled on a player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_enabled) ---@class on_player_cheat_mode_enabled ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_enabled) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_enabled) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_enabled) ---@field tick uint ---Called when a player clicks a gps tag --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_clicked_gps_tag) ---@class on_player_clicked_gps_tag ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_clicked_gps_tag) ---@field name defines.events ---Index of the player --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_clicked_gps_tag) ---@field player_index uint ---Map position contained in gps tag --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_clicked_gps_tag) ---@field position Position ---Surface name contained in gps tag, even when such surface does not exists --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_clicked_gps_tag) ---@field surface string ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_clicked_gps_tag) ---@field tick uint ---Called when a player clicks the "confirm" button in the configure Blueprint GUI. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_configured_blueprint) ---@class on_player_configured_blueprint ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_configured_blueprint) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_configured_blueprint) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_configured_blueprint) ---@field tick uint ---Called when a player configures spidertron remote to be connected with a given spidertron --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_configured_spider_remote) ---@class on_player_configured_spider_remote ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_configured_spider_remote) ---@field name defines.events ---The player that configured the remote. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_configured_spider_remote) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_configured_spider_remote) ---@field tick uint ---Spider vehicle to which remote was connected to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_configured_spider_remote) ---@field vehicle LuaEntity ---Called when the player finishes crafting an item. This event fires just before the results are inserted into the player's inventory, not when the crafting is queued (see [on_pre_player_crafted_item](https://lua-api.factorio.com/latest/events.html#on_pre_player_crafted_item)). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_crafted_item) ---@class on_player_crafted_item ---The item that has been crafted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_crafted_item) ---@field item_stack LuaItemStack ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_crafted_item) ---@field name defines.events ---The player doing the crafting. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_crafted_item) ---@field player_index uint ---The recipe used to craft this item. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_crafted_item) ---@field recipe LuaRecipe ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_crafted_item) ---@field tick uint ---Called after the player was created. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_created) ---@class on_player_created ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_created) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_created) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_created) ---@field tick uint ---Called after a players cursorstack changed in some way. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cursor_stack_changed) ---@class on_player_cursor_stack_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cursor_stack_changed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cursor_stack_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_cursor_stack_changed) ---@field tick uint ---Called when a player selects an area with a deconstruction planner. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_deconstructed_area) ---@class on_player_deconstructed_area ---If normal selection or alt selection was used. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_deconstructed_area) ---@field alt boolean ---The area selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_deconstructed_area) ---@field area BoundingBox> ---The item used to select the area. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_deconstructed_area) ---@field item string ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_deconstructed_area) ---@field name defines.events ---The player doing the selection. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_deconstructed_area) ---@field player_index uint ---The surface selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_deconstructed_area) ---@field surface LuaSurface ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_deconstructed_area) ---@field tick uint ---Called when a player is demoted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_demoted) ---@class on_player_demoted ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_demoted) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_demoted) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_demoted) ---@field tick uint ---Called after a player dies. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_died) ---@class on_player_died ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_died) ---@field cause LuaEntity|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_died) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_died) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_died) ---@field tick uint ---Called when the display resolution changes for a given player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_resolution_changed) ---@class on_player_display_resolution_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_resolution_changed) ---@field name defines.events ---The old display resolution --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_resolution_changed) ---@field old_resolution DisplayResolution ---The player --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_resolution_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_resolution_changed) ---@field tick uint ---Called when the display scale changes for a given player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_scale_changed) ---@class on_player_display_scale_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_scale_changed) ---@field name defines.events ---The old display scale --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_scale_changed) ---@field old_scale double ---The player --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_scale_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_display_scale_changed) ---@field tick uint ---Called when the player's driving state has changed, this means a player has either entered or left a vehicle. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_driving_changed_state) ---@class on_player_driving_changed_state ---The vehicle if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_driving_changed_state) ---@field entity LuaEntity|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_driving_changed_state) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_driving_changed_state) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_driving_changed_state) ---@field tick uint ---Called when a player drops an item on the ground. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_dropped_item) ---@class on_player_dropped_item ---The item-on-ground entity. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_dropped_item) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_dropped_item) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_dropped_item) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_dropped_item) ---@field tick uint ---Called when a player fast-transfers something to or from an entity. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_fast_transferred) ---@class on_player_fast_transferred ---The entity transferred from or to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_fast_transferred) ---@field entity LuaEntity ---Whether the transfer was from player to entity. If `false`, the transfer was from entity to player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_fast_transferred) ---@field from_player boolean ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_fast_transferred) ---@field name defines.events ---The player transferred from or to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_fast_transferred) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_fast_transferred) ---@field tick uint ---Called after player flushed fluid --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_flushed_fluid) ---@class on_player_flushed_fluid ---Amount of fluid that was removed --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_flushed_fluid) ---@field amount double ---Entity from which flush was performed --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_flushed_fluid) ---@field entity LuaEntity ---Name of a fluid that was flushed --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_flushed_fluid) ---@field fluid string ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_flushed_fluid) ---@field name defines.events ---True if flush was requested only on this entity --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_flushed_fluid) ---@field only_this_entity boolean ---Index of the player --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_flushed_fluid) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_flushed_fluid) ---@field tick uint ---Called after a players gun inventory changed in some way. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_gun_inventory_changed) ---@class on_player_gun_inventory_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_gun_inventory_changed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_gun_inventory_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_gun_inventory_changed) ---@field tick uint ---Called after a player joins the game. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_joined_game) ---@class on_player_joined_game ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_joined_game) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_joined_game) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_joined_game) ---@field tick uint ---Called when a player is kicked. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_kicked) ---@class on_player_kicked ---The player that did the kicking if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_kicked) ---@field by_player uint|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_kicked) ---@field name defines.events ---The player kicked. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_kicked) ---@field player_index uint ---The reason given if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_kicked) ---@field reason string|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_kicked) ---@field tick uint ---Called after a player leaves the game. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_left_game) ---@class on_player_left_game ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_left_game) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_left_game) ---@field player_index uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_left_game) ---@field reason defines.disconnect_reason ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_left_game) ---@field tick uint ---Called after a players main inventory changed in some way. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_main_inventory_changed) ---@class on_player_main_inventory_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_main_inventory_changed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_main_inventory_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_main_inventory_changed) ---@field tick uint ---Called after the results of an entity being mined are collected just before the entity is destroyed. After this event any items in the buffer will be transferred into the player as if they came from mining the entity. Can be filtered using [LuaPlayerMinedEntityEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerMinedEntityEventFilter). --- ---**Note:** The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_entity) ---@class on_player_mined_entity ---The temporary inventory that holds the result of mining the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_entity) ---@field buffer LuaInventory ---The entity that has been mined. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_entity) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_entity) ---@field name defines.events ---The index of the player doing the mining. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_entity) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_entity) ---@field tick uint ---Called when the player mines something. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_item) ---@class on_player_mined_item ---The item given to the player --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_item) ---@field item_stack SimpleItemStack ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_item) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_item) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_item) ---@field tick uint ---Called after a player mines tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_tile) ---@class on_player_mined_tile ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_tile) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_tile) ---@field player_index uint ---The surface the tile(s) were mined from. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_tile) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_tile) ---@field tick uint ---The position data. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_mined_tile) ---@field tiles OldTileAndPosition[] ---Called when a player is muted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_muted) ---@class on_player_muted ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_muted) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_muted) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_muted) ---@field tick uint ---Called when a player invokes the "smart pipette" over an entity. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_pipette) ---@class on_player_pipette ---The item put in the cursor --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_pipette) ---@field item LuaItemPrototype ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_pipette) ---@field name defines.events ---The player --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_pipette) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_pipette) ---@field tick uint ---If cheat mode was used to give a free stack of the item. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_pipette) ---@field used_cheat_mode boolean ---Called after the player puts equipment in an equipment grid --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_placed_equipment) ---@class on_player_placed_equipment ---The equipment put in the equipment grid. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_placed_equipment) ---@field equipment LuaEquipment ---The equipment grid the equipment was put in. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_placed_equipment) ---@field grid LuaEquipmentGrid ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_placed_equipment) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_placed_equipment) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_placed_equipment) ---@field tick uint ---Called when a player is promoted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_promoted) ---@class on_player_promoted ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_promoted) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_promoted) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_promoted) ---@field tick uint ---Called when a player is removed (deleted) from the game. Not to be confused with the player logging of this is different in that the player is deleted as if he never existed in the save file. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed) ---@class on_player_removed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed) ---@field name defines.events ---The player index that was removed --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed) ---@field tick uint ---Called after the player removes equipment from an equipment grid --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) ---@class on_player_removed_equipment ---The count of equipment removed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) ---@field count uint ---The equipment removed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) ---@field equipment string ---The equipment grid removed from. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) ---@field grid LuaEquipmentGrid ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) ---@field tick uint ---Called when a player repairs an entity. Can be filtered using [LuaPlayerRepairedEntityEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerRepairedEntityEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_repaired_entity) ---@class on_player_repaired_entity ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_repaired_entity) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_repaired_entity) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_repaired_entity) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_repaired_entity) ---@field tick uint ---Called after a player respawns. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_respawned) ---@class on_player_respawned ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_respawned) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_respawned) ---@field player_index uint ---The player port used to respawn if one was used. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_respawned) ---@field player_port LuaEntity|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_respawned) ---@field tick uint ---Called when the player rotates an entity. This event is only fired when the entity actually changes its orientation -- pressing the rotate key on an entity that can't be rotated won't fire this event. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_rotated_entity) ---@class on_player_rotated_entity ---The rotated entity. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_rotated_entity) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_rotated_entity) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_rotated_entity) ---@field player_index uint ---The previous direction --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_rotated_entity) ---@field previous_direction defines.direction ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_rotated_entity) ---@field tick uint ---Called after a player selects an area with a selection-tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_selected_area) ---@class on_player_selected_area ---The area selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_selected_area) ---@field area BoundingBox> ---The entities selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_selected_area) ---@field entities LuaEntity[] ---The item used to select the area. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_selected_area) ---@field item string ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_selected_area) ---@field name defines.events ---The player doing the selection. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_selected_area) ---@field player_index uint ---The surface selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_selected_area) ---@field surface LuaSurface ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_selected_area) ---@field tick uint ---The tiles selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_selected_area) ---@field tiles LuaTile[] ---Called when a player sets a quickbar slot to anything (new value, or set to empty). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_set_quick_bar_slot) ---@class on_player_set_quick_bar_slot ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_set_quick_bar_slot) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_set_quick_bar_slot) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_set_quick_bar_slot) ---@field tick uint ---Called when a player selects an area with a blueprint. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint) ---@class on_player_setup_blueprint ---If normal selection or alt selection was used. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint) ---@field alt boolean ---The area selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint) ---@field area BoundingBox> ---The item used to select the area. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint) ---@field item string ---The blueprint entity index to source entity mapping. Note: if any mod changes the blueprint this will be incorrect. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint) ---@field mapping LuaLazyLoadedValue,nil> ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint) ---@field name defines.events ---The player doing the selection. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint) ---@field player_index uint ---The surface selected. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint) ---@field surface LuaSurface ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint) ---@field tick uint ---Called when a player toggles alt mode, also known as "show entity info". --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_toggled_alt_mode) ---@class on_player_toggled_alt_mode ---The new alt mode value. This value is a shortcut for accessing [GameViewSettings::show_entity_info](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_entity_info) on the player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_toggled_alt_mode) ---@field alt_mode boolean ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_toggled_alt_mode) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_toggled_alt_mode) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_toggled_alt_mode) ---@field tick uint ---Called when a player toggles the map editor on or off. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_toggled_map_editor) ---@class on_player_toggled_map_editor ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_toggled_map_editor) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_toggled_map_editor) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_toggled_map_editor) ---@field tick uint ---Called after a players trash inventory changed in some way. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_trash_inventory_changed) ---@class on_player_trash_inventory_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_trash_inventory_changed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_trash_inventory_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_trash_inventory_changed) ---@field tick uint ---Called when a player is un-banned. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unbanned) ---@class on_player_unbanned ---The player that did the un-banning if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unbanned) ---@field by_player uint|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unbanned) ---@field name defines.events ---The player un-banned. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unbanned) ---@field player_index uint|nil ---The player name un-banned. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unbanned) ---@field player_name string ---The reason the player was banned if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unbanned) ---@field reason string|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unbanned) ---@field tick uint ---Called when a player is unmuted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unmuted) ---@class on_player_unmuted ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unmuted) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unmuted) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_unmuted) ---@field tick uint ---Called when a player uses a capsule that results in some game action. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_capsule) ---@class on_player_used_capsule ---The capsule item used. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_capsule) ---@field item LuaItemPrototype ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_capsule) ---@field name defines.events ---The player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_capsule) ---@field player_index uint ---The position the capsule was used. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_capsule) ---@field position Position ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_capsule) ---@field tick uint ---Called when a player uses spidertron remote to send a spidertron to a given position --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_spider_remote) ---@class on_player_used_spider_remote ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_spider_remote) ---@field name defines.events ---The player that used the remote. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_spider_remote) ---@field player_index uint ---Goal position to which spidertron was sent to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_spider_remote) ---@field position Position ---If the use was successful. It may fail when spidertron has different driver or when player is on different surface. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_spider_remote) ---@field success boolean ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_spider_remote) ---@field tick uint ---Spider vehicle which was requested to move. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_player_used_spider_remote) ---@field vehicle LuaEntity ---Called after an entity dies. Can be filtered using [LuaPostEntityDiedEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaPostEntityDiedEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@class on_post_entity_died ---The corpses created by the entity dying if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field corpses LuaEntity[] ---The damage type if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field damage_type LuaDamagePrototype|nil ---The force that did the killing if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field force LuaForce|nil ---The ghost created by the entity dying if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field ghost LuaEntity|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field name defines.events ---Position where the entity died. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field position Position ---The entity prototype of the entity that died. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field prototype LuaEntityPrototype ---The surface the entity was on. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field tick uint ---The unit number the entity had if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) ---@field unit_number uint|nil ---Called when players uses an item to build something. Called before [on_built_entity](https://lua-api.factorio.com/latest/events.html#on_built_entity). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@class on_pre_build ---Item was placed while moving. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@field created_by_moving boolean ---The direction the item was facing when placed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@field direction defines.direction ---If building this blueprint was flipped horizontally. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@field flip_horizontal boolean ---If building this blueprint was flipped vertically. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@field flip_vertical boolean ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@field name defines.events ---The player who did the placing. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@field player_index uint ---Where the item was placed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@field position Position ---Item was placed using shift building. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@field shift_build boolean ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_build) ---@field tick uint ---Called before one or more chunks are deleted using [LuaSurface::delete_chunk](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.delete_chunk). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_chunk_deleted) ---@class on_pre_chunk_deleted ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_chunk_deleted) ---@field name defines.events ---The chunks to be deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_chunk_deleted) ---@field positions ChunkPosition[] ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_chunk_deleted) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_chunk_deleted) ---@field tick uint ---Called before entity copy-paste is done. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_entity_settings_pasted) ---@class on_pre_entity_settings_pasted ---The destination entity settings will be copied to. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_entity_settings_pasted) ---@field destination LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_entity_settings_pasted) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_entity_settings_pasted) ---@field player_index uint ---The source entity settings will be copied from. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_entity_settings_pasted) ---@field source LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_entity_settings_pasted) ---@field tick uint ---Called before a ghost entity is destroyed as a result of being marked for deconstruction. Can be filtered using [LuaPreGhostDeconstructedEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaPreGhostDeconstructedEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_ghost_deconstructed) ---@class on_pre_ghost_deconstructed ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_ghost_deconstructed) ---@field ghost LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_ghost_deconstructed) ---@field name defines.events ---The player that did the deconstruction if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_ghost_deconstructed) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_ghost_deconstructed) ---@field tick uint ---Called directly before a permission group is deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_permission_group_deleted) ---@class on_pre_permission_group_deleted ---The group to be deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_permission_group_deleted) ---@field group LuaPermissionGroup ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_permission_group_deleted) ---@field name defines.events ---The player doing the deletion. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_permission_group_deleted) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_permission_group_deleted) ---@field tick uint ---Called directly before a permission string is imported. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_permission_string_imported) ---@class on_pre_permission_string_imported ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_permission_string_imported) ---@field name defines.events ---The player importing the string. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_permission_string_imported) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_permission_string_imported) ---@field tick uint ---Called when a player queues something to be crafted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_crafted_item) ---@class on_pre_player_crafted_item ---The items removed from the players inventory to do the crafting. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_crafted_item) ---@field items LuaInventory ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_crafted_item) ---@field name defines.events ---The player doing the crafting. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_crafted_item) ---@field player_index uint ---The number of times the recipe is being queued. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_crafted_item) ---@field queued_count uint ---The recipe being queued. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_crafted_item) ---@field recipe LuaRecipe ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_crafted_item) ---@field tick uint ---Called before a players dies. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_died) ---@class on_pre_player_died ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_died) ---@field cause LuaEntity|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_died) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_died) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_died) ---@field tick uint ---Called before a player leaves the game. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_left_game) ---@class on_pre_player_left_game ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_left_game) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_left_game) ---@field player_index uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_left_game) ---@field reason defines.disconnect_reason ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_left_game) ---@field tick uint ---Called when the player finishes mining an entity, before the entity is removed from map. Can be filtered using [LuaPrePlayerMinedEntityEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaPrePlayerMinedEntityEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_mined_item) ---@class on_pre_player_mined_item ---The entity being mined --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_mined_item) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_mined_item) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_mined_item) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_mined_item) ---@field tick uint ---Called before a player is removed (deleted) from the game. Not to be confused with the player logging of this is different in that the player is deleted as if he never existed in the save file. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_removed) ---@class on_pre_player_removed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_removed) ---@field name defines.events ---The player index that will be removed --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_removed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_removed) ---@field tick uint ---Called before a player toggles the map editor on or off. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_toggled_map_editor) ---@class on_pre_player_toggled_map_editor ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_toggled_map_editor) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_toggled_map_editor) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_player_toggled_map_editor) ---@field tick uint ---Called directly before a robot explodes cliffs. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_robot_exploded_cliff) ---@class on_pre_robot_exploded_cliff ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_robot_exploded_cliff) ---@field cliff LuaEntity ---The cliff explosive used. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_robot_exploded_cliff) ---@field item LuaItemPrototype ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_robot_exploded_cliff) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_robot_exploded_cliff) ---@field robot LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_robot_exploded_cliff) ---@field tick uint ---Called just before a script inventory is resized. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized) ---@class on_pre_script_inventory_resized ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized) ---@field inventory LuaInventory ---The mod that did the resizing. This will be `"core"` if done by console command or scenario script. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized) ---@field mod string ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized) ---@field name defines.events ---The new inventory size. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized) ---@field new_size uint ---The old inventory size. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized) ---@field old_size uint ---If done by console command; the player who ran the command. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized) ---@field tick uint ---Called just before a surface is cleared (all entities removed and all chunks deleted). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_surface_cleared) ---@class on_pre_surface_cleared ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_surface_cleared) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_surface_cleared) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_surface_cleared) ---@field tick uint ---Called just before a surface is deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_surface_deleted) ---@class on_pre_surface_deleted ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_surface_deleted) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_surface_deleted) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_pre_surface_deleted) ---@field tick uint ---Called when a research finishes. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_finished) ---@class on_research_finished ---If the technology was researched by script. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_finished) ---@field by_script boolean ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_finished) ---@field name defines.events ---The researched technology --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_finished) ---@field research LuaTechnology ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_finished) ---@field tick uint ---Called when a research is reversed (unresearched). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_reversed) ---@class on_research_reversed ---If the technology was un-researched by script. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_reversed) ---@field by_script boolean ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_reversed) ---@field name defines.events ---The technology un-researched --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_reversed) ---@field research LuaTechnology ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_reversed) ---@field tick uint ---Called when a technology research starts. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_started) ---@class on_research_started ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_started) ---@field last_research LuaTechnology|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_started) ---@field name defines.events ---The technology being researched --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_started) ---@field research LuaTechnology ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_research_started) ---@field tick uint ---Called when a resource entity reaches 0 or its minimum yield for infinite resources. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_resource_depleted) ---@class on_resource_depleted ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_resource_depleted) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_resource_depleted) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_resource_depleted) ---@field tick uint ---Called when a construction robot builds an entity. Can be filtered using [LuaRobotBuiltEntityEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotBuiltEntityEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_entity) ---@class on_robot_built_entity ---The entity built. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_entity) ---@field created_entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_entity) ---@field name defines.events ---The robot that did the building. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_entity) ---@field robot LuaEntity ---The item used to do the building. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_entity) ---@field stack LuaItemStack ---The tags associated with this entity if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_entity) ---@field tags Tags|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_entity) ---@field tick uint ---Called after a robot builds tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_tile) ---@class on_robot_built_tile ---The item type used to build the tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_tile) ---@field item LuaItemPrototype ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_tile) ---@field name defines.events ---The robot. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_tile) ---@field robot LuaEntity ---The stack used to build the tiles (may be empty if all of the items where used to build the tiles). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_tile) ---@field stack LuaItemStack ---The surface the tile(s) are build on. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_tile) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_tile) ---@field tick uint ---The tile prototype that was placed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_tile) ---@field tile LuaTilePrototype ---The position data. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_built_tile) ---@field tiles OldTileAndPosition[] ---Called directly after a robot explodes cliffs. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_exploded_cliff) ---@class on_robot_exploded_cliff ---The cliff explosive used. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_exploded_cliff) ---@field item LuaItemPrototype ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_exploded_cliff) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_exploded_cliff) ---@field robot LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_exploded_cliff) ---@field tick uint ---Called when a robot mines an entity. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined) ---@class on_robot_mined ---The entity the robot just picked up. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined) ---@field item_stack SimpleItemStack ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined) ---@field name defines.events ---The robot that did the mining. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined) ---@field robot LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined) ---@field tick uint ---Called after the results of an entity being mined are collected just before the entity is destroyed. After this event any items in the buffer will be transferred into the robot as if they came from mining the entity. Can be filtered using [LuaRobotMinedEntityEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotMinedEntityEventFilter). --- ---**Note:** The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_entity) ---@class on_robot_mined_entity ---The temporary inventory that holds the result of mining the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_entity) ---@field buffer LuaInventory ---The entity that has been mined. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_entity) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_entity) ---@field name defines.events ---The robot doing the mining. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_entity) ---@field robot LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_entity) ---@field tick uint ---Called after a robot mines tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_tile) ---@class on_robot_mined_tile ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_tile) ---@field name defines.events ---The robot. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_tile) ---@field robot LuaEntity ---The surface the tile(s) were mined on. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_tile) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_tile) ---@field tick uint ---The position data. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_mined_tile) ---@field tiles OldTileAndPosition[] ---Called before a robot mines an entity. Can be filtered using [LuaPreRobotMinedEntityEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaPreRobotMinedEntityEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_pre_mined) ---@class on_robot_pre_mined ---The entity which is about to be mined. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_pre_mined) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_pre_mined) ---@field name defines.events ---The robot that's about to do the mining. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_pre_mined) ---@field robot LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_robot_pre_mined) ---@field tick uint ---Called when a rocket silo is ordered to be launched. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launch_ordered) ---@class on_rocket_launch_ordered ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launch_ordered) ---@field name defines.events ---The player that is riding the rocket, if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launch_ordered) ---@field player_index uint|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launch_ordered) ---@field rocket LuaEntity ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launch_ordered) ---@field rocket_silo LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launch_ordered) ---@field tick uint ---Called when the rocket is launched. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launched) ---@class on_rocket_launched ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launched) ---@field name defines.events ---The player that is riding the rocket, if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launched) ---@field player_index uint|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launched) ---@field rocket LuaEntity ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launched) ---@field rocket_silo LuaEntity|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_rocket_launched) ---@field tick uint ---Called when a runtime mod setting is changed by a player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_runtime_mod_setting_changed) ---@class on_runtime_mod_setting_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_runtime_mod_setting_changed) ---@field name defines.events ---If the `setting_type` is `"global"` and it was changed through the mod settings GUI, this is the index of the player that changed the global setting. If the `setting_type` is `"runtime-per-user"` and it changed a current setting of the player, this is the index of the player whose setting was changed. In all other cases, this is `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_runtime_mod_setting_changed) ---@field player_index uint|nil ---The prototype name of the setting that was changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_runtime_mod_setting_changed) ---@field setting string ---Either "runtime-per-user" or "runtime-global". --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_runtime_mod_setting_changed) ---@field setting_type string ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_runtime_mod_setting_changed) ---@field tick uint ---Called just after a script inventory is resized. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) ---@class on_script_inventory_resized ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) ---@field inventory LuaInventory ---The mod that did the resizing. This will be `"core"` if done by console command or scenario script. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) ---@field mod string ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) ---@field name defines.events ---The new inventory size. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) ---@field new_size uint ---The old inventory size. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) ---@field old_size uint ---Any items which didn't fit into the new inventory size. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) ---@field overflow_inventory LuaInventory ---If done by console command; the player who ran the command. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized) ---@field tick uint ---Called when a [LuaSurface::request_path](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) call completes. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_path_request_finished) ---@class on_script_path_request_finished ---Handle to associate the callback with a particular call to [LuaSurface::request_path](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_path_request_finished) ---@field id uint ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_path_request_finished) ---@field name defines.events ---The actual path that the pathfinder has determined. `nil` if pathfinding failed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_path_request_finished) ---@field path PathfinderWaypoint[]|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_path_request_finished) ---@field tick uint ---Indicates that the pathfinder failed because it is too busy, and that you can retry later. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_path_request_finished) ---@field try_again_later boolean ---Called when a script trigger effect is triggered. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect) ---@class on_script_trigger_effect ---The effect_id specified in the trigger effect. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect) ---@field effect_id string ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect) ---@field source_entity LuaEntity|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect) ---@field source_position Position|nil ---The surface the effect happened on. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect) ---@field surface_index uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect) ---@field target_entity LuaEntity|nil ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect) ---@field target_position Position|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect) ---@field tick uint ---Called when the radar finishes scanning a sector. Can be filtered for the radar using [LuaSectorScannedEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaSectorScannedEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_sector_scanned) ---@class on_sector_scanned ---Area of the scanned chunk. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_sector_scanned) ---@field area BoundingBox> ---The chunk scanned. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_sector_scanned) ---@field chunk_position ChunkPosition ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_sector_scanned) ---@field name defines.events ---The radar that did the scanning. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_sector_scanned) ---@field radar LuaEntity ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_sector_scanned) ---@field tick uint ---Called after the selected entity changes for a given player. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_selected_entity_changed) ---@class on_selected_entity_changed ---The last selected entity if it still exists and there was one. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_selected_entity_changed) ---@field last_entity LuaEntity|nil ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_selected_entity_changed) ---@field name defines.events ---The player whose selected entity changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_selected_entity_changed) ---@field player_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_selected_entity_changed) ---@field tick uint ---Called when a spider finishes moving to its autopilot position. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_spider_command_completed) ---@class on_spider_command_completed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_spider_command_completed) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_spider_command_completed) ---@field tick uint ---Spider vehicle which was requested to move. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_spider_command_completed) ---@field vehicle LuaEntity ---Called when a translation request generated through [LuaPlayer::request_translation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.request_translation) is translated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_string_translated) ---@class on_string_translated ---The localised string being translated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_string_translated) ---@field localised_string LocalisedString ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_string_translated) ---@field name defines.events ---The player whose locale was used for the translation. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_string_translated) ---@field player_index uint ---The translated `localised_string`. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_string_translated) ---@field result string ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_string_translated) ---@field tick uint ---Whether the requested localised string was valid and could be translated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_string_translated) ---@field translated boolean ---Called just after a surface is cleared (all entities removed and all chunks deleted). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_cleared) ---@class on_surface_cleared ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_cleared) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_cleared) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_cleared) ---@field tick uint ---Called when a surface is created. --- ---**Note:** This is not called when the default surface is created as it will always exist. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_created) ---@class on_surface_created ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_created) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_created) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_created) ---@field tick uint ---Called after a surface is deleted. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_deleted) ---@class on_surface_deleted ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_deleted) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_deleted) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_deleted) ---@field tick uint ---Called after a surface is imported. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_imported) ---@class on_surface_imported ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_imported) ---@field name defines.events ---The original surface name. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_imported) ---@field original_name string ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_imported) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_imported) ---@field tick uint ---Called when a surface is renamed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_renamed) ---@class on_surface_renamed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_renamed) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_renamed) ---@field new_name string ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_renamed) ---@field old_name string ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_renamed) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_surface_renamed) ---@field tick uint ---Called when [LuaForce::reset_technology_effects](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.reset_technology_effects) is finished. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_technology_effects_reset) ---@class on_technology_effects_reset ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_technology_effects_reset) ---@field force LuaForce ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_technology_effects_reset) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_technology_effects_reset) ---@field tick uint ---It is fired once every tick. Since this event is fired every tick, its handler shouldn't include performance heavy code. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_tick) ---@class on_tick ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_tick) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_tick) ---@field tick uint ---Called when a train changes state (started to stopped and vice versa) --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_changed_state) ---@class on_train_changed_state ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_changed_state) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_changed_state) ---@field old_state defines.train_state ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_changed_state) ---@field tick uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_changed_state) ---@field train LuaTrain ---Called when a new train is created either through disconnecting/connecting an existing one or building a new one. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_created) ---@class on_train_created ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_created) ---@field name defines.events ---The first old train id when splitting/merging trains. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_created) ---@field old_train_id_1 uint|nil ---The second old train id when splitting/merging trains. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_created) ---@field old_train_id_2 uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_created) ---@field tick uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_created) ---@field train LuaTrain ---Called when a trains schedule is changed either by the player or through script. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_schedule_changed) ---@class on_train_schedule_changed ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_schedule_changed) ---@field name defines.events ---The player who made the change if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_schedule_changed) ---@field player_index uint|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_schedule_changed) ---@field tick uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_train_schedule_changed) ---@field train LuaTrain ---Called when an entity with a trigger prototype (such as capsules) create an entity AND that trigger prototype defined `trigger_created_entity="true"`. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_created_entity) ---@class on_trigger_created_entity ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_created_entity) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_created_entity) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_created_entity) ---@field source LuaEntity|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_created_entity) ---@field tick uint ---Called when an entity with a trigger prototype (such as capsules) fire an artillery projectile AND that trigger prototype defined `trigger_fired_artillery="true"`. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_fired_artillery) ---@class on_trigger_fired_artillery ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_fired_artillery) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_fired_artillery) ---@field name defines.events ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_fired_artillery) ---@field source LuaEntity|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_trigger_fired_artillery) ---@field tick uint ---Called when a unit is added to a unit group. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_added_to_group) ---@class on_unit_added_to_group ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_added_to_group) ---@field group LuaUnitGroup ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_added_to_group) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_added_to_group) ---@field tick uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_added_to_group) ---@field unit LuaEntity ---Called when a new unit group is created, before any members are added to it. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_group_created) ---@class on_unit_group_created ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_group_created) ---@field group LuaUnitGroup ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_group_created) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_group_created) ---@field tick uint ---Called when a unit group finishes gathering and starts executing its command. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_group_finished_gathering) ---@class on_unit_group_finished_gathering ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_group_finished_gathering) ---@field group LuaUnitGroup ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_group_finished_gathering) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_group_finished_gathering) ---@field tick uint ---Called when a unit is removed from a unit group. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_removed_from_group) ---@class on_unit_removed_from_group ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_removed_from_group) ---@field group LuaUnitGroup ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_removed_from_group) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_removed_from_group) ---@field tick uint ---[View documentation](https://lua-api.factorio.com/latest/events.html#on_unit_removed_from_group) ---@field unit LuaEntity ---A static event mods can use to tell other mods they built something by script. This event is only raised if a mod does so with [LuaBootstrap::raise_event](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_event) or [LuaBootstrap::raise_script_built](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_built), or when `raise_built` is passed to [LuaSurface::create_entity](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity). Can be filtered using [LuaScriptRaisedBuiltEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedBuiltEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_built) ---@class script_raised_built ---The entity that has been built. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_built) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_built) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_built) ---@field tick uint ---A static event mods can use to tell other mods they destroyed something by script. This event is only raised if a mod does so with [LuaBootstrap::raise_event](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_event) or [LuaBootstrap::raise_script_destroy](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_destroy), or when `raise_destroy` is passed to [LuaEntity::destroy](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy). Can be filtered using [LuaScriptRaisedDestroyEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedDestroyEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) ---@class script_raised_destroy ---The entity that was destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) ---@field name defines.events ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) ---@field tick uint ---A static event mods can use to tell other mods they revived something by script. This event is only raised if a mod does so with [LuaBootstrap::raise_event](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_event) or [LuaBootstrap::raise_script_revive](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_revive), or when `raise_revive` is passed to [LuaEntity::revive](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.revive). Can be filtered using [LuaScriptRaisedReviveEventFilter](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedReviveEventFilter). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_revive) ---@class script_raised_revive ---The entity that was revived. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_revive) ---@field entity LuaEntity ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_revive) ---@field name defines.events ---The tags associated with this entity, if any. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_revive) ---@field tags Tags|nil ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_revive) ---@field tick uint ---A static event mods can use to tell other mods they changed tiles on a surface by script. This event is only raised if a mod does so with [LuaBootstrap::raise_event](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_event) or [LuaBootstrap::raise_script_set_tiles](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_set_tiles), or when `raise_event` is passed to [LuaSurface::set_tiles](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_tiles). --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) ---@class script_raised_set_tiles ---Identifier of the event --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) ---@field name defines.events ---The surface whose tiles were changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) ---@field surface_index uint ---Tick the event was generated. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) ---@field tick uint ---The tiles that were changed. --- ---[View documentation](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) ---@field tiles Tile[] ---Collection of settings for overriding default ai behavior. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAISettings.html) ---@class LuaAISettings ---[RW] ---If enabled, units that repeatedly fail to succeed at commands will be destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAISettings.html#LuaAISettings.allow_destroy_when_commands_fail) ---@field allow_destroy_when_commands_fail boolean ---[RW] ---If enabled, units that have nothing else to do will attempt to return to a spawner. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAISettings.html#LuaAISettings.allow_try_return_to_spawner) ---@field allow_try_return_to_spawner boolean ---[RW] ---If enabled, units will try to separate themselves from nearby friendly units. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAISettings.html#LuaAISettings.do_separation) ---@field do_separation boolean ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAISettings.html#LuaAISettings.object_name) ---@field object_name string ---[RW] ---The pathing resolution modifier, must be between -8 and 8. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAISettings.html#LuaAISettings.path_resolution_modifier) ---@field path_resolution_modifier int8 ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAISettings.html#LuaAISettings.valid) ---@field valid boolean local LuaAISettings={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAISettings.html#LuaAISettings.help) ---@return string help=function()end, } ---Control behavior for accumulators. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAccumulatorControlBehavior.html) ---@class LuaAccumulatorControlBehavior:LuaControlBehavior ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAccumulatorControlBehavior.html#LuaAccumulatorControlBehavior.object_name) ---@field object_name string ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAccumulatorControlBehavior.html#LuaAccumulatorControlBehavior.output_signal) ---@field output_signal SignalID ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAccumulatorControlBehavior.html#LuaAccumulatorControlBehavior.valid) ---@field valid boolean local LuaAccumulatorControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAccumulatorControlBehavior.html#LuaAccumulatorControlBehavior.help) ---@return string help=function()end, } ---Prototype of a achievement. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html) ---@class LuaAchievementPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html#LuaAchievementPrototype.allowed_without_fight) ---@field allowed_without_fight boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html#LuaAchievementPrototype.hidden) ---@field hidden boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html#LuaAchievementPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html#LuaAchievementPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html#LuaAchievementPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html#LuaAchievementPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html#LuaAchievementPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html#LuaAchievementPrototype.valid) ---@field valid boolean local LuaAchievementPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAchievementPrototype.html#LuaAchievementPrototype.help) ---@return string help=function()end, } ---Prototype of a ammo category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html) ---@class LuaAmmoCategoryPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.bonus_gui_order) ---@field bonus_gui_order string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.valid) ---@field valid boolean local LuaAmmoCategoryPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html#LuaAmmoCategoryPrototype.help) ---@return string help=function()end, } ---Control behavior for arithmetic combinators. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaArithmeticCombinatorControlBehavior.html) ---@class LuaArithmeticCombinatorControlBehavior:LuaCombinatorControlBehavior ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaArithmeticCombinatorControlBehavior.html#LuaArithmeticCombinatorControlBehavior.object_name) ---@field object_name string ---[RW] ---The arithmetic combinator parameters. --- ---**Note:** `parameters` may be `nil` in order to clear the parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaArithmeticCombinatorControlBehavior.html#LuaArithmeticCombinatorControlBehavior.parameters) ---@field parameters ArithmeticCombinatorParameters ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaArithmeticCombinatorControlBehavior.html#LuaArithmeticCombinatorControlBehavior.valid) ---@field valid boolean local LuaArithmeticCombinatorControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaArithmeticCombinatorControlBehavior.html#LuaArithmeticCombinatorControlBehavior.help) ---@return string help=function()end, } ---Prototype of an autoplace control. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html) ---@class LuaAutoplaceControlPrototype ---[R] ---Category name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.category) ---@field category string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.control_order) ---@field control_order string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.order) ---@field order string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.richness) ---@field richness boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.valid) ---@field valid boolean local LuaAutoplaceControlPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html#LuaAutoplaceControlPrototype.help) ---@return string help=function()end, } ---**Global Description:** ---Provides an interface for registering event handlers. --- ---**Class Description:** ---Entry point for registering event handlers. It is accessible through the global object named `script`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html) ---@class LuaBootstrap ---[R] ---A dictionary listing the names of all currently active mods and mapping them to their version. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.active_mods) --- ---### Example ---This will print the names and versions of all active mods to the console. ---``` ---for name, version in pairs(script.active_mods) do --- game.print(name .. " version " .. version) ---end ---``` ---@field active_mods table ---[R] ---Information about the currently running scenario/campaign/tutorial. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.level) ---@field level LuaBootstrap.level ---[R] ---The name of the mod from the environment this is used in. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.mod_name) ---@field mod_name string ---[R] ---This object's name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.object_name) ---@field object_name string script={ ---Generate a new, unique event ID that can be used to raise custom events with [LuaBootstrap::raise_event](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_event). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.generate_event_name) ---@return uint@The newly generated event ID. generate_event_name=function()end, ---Gets the filters for the given event. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.get_event_filter) ---@param event uint@ID of the event to get. ---@return EventFilter[]@The filters or `nil` if none are defined. get_event_filter=function(event)end, ---Find the event handler for an event. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.get_event_handler) ---@param event uint@The event identifier to get a handler for. ---@return fun(param1:EventData)@Reference to the function currently registered as the handler. get_event_handler=function(event)end, ---Gets the mod event order as a string. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.get_event_order) ---@return string get_event_order=function()end, ---Register a function to be run when mod configuration changes. This is called when the game version or any mod version changes; when any mod is added or removed; or when prototypes or startup mod settings have changed. It allows the mod to make any changes it deems appropriate to both the data structures in its `global` table or to the game state through [LuaGameScript](https://lua-api.factorio.com/latest/LuaGameScript.html). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_configuration_changed) ---@param f fun(param1:ConfigurationChangedData)@The handler for this event. Passing `nil` will unregister it. on_configuration_changed=function(f)end, ---Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_event) --- ---### Example ---Register for the [on_tick](https://lua-api.factorio.com/latest/events.html#on_tick) event to print the current tick to console each tick. ---``` ---script.on_event(defines.events.on_tick, ---function(event) game.print(event.tick) end) ---``` ---Register for the [on_built_entity](https://lua-api.factorio.com/latest/events.html#on_built_entity) event, limiting it to only be received when a `"fast-inserter"` is built. ---``` ---script.on_event(defines.events.on_built_entity, ---function(event) game.print("Gotta go fast!") end, ---{{filter = "name", name = "fast-inserter"}}) ---``` ---@param event defines.events|defines.events[]|string@The event(s) or custom-input to invoke the handler on. ---@param f fun(param1:EventData)@The handler for this event. Passing `nil` will unregister it. ---@param filters?EventFilter[]@The filters for this event. Can only be used when registering for individual events. on_event=function(event,f,filters)end, ---Register a callback to be run on mod initialization. This is only called when a new save game is created or when a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up initial values that it will use for its lifetime. It has full access to [LuaGameScript](https://lua-api.factorio.com/latest/LuaGameScript.html) and the `global` table and can change anything about them that it deems appropriate. No other events will be raised for the mod until it has finished this step. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_init) --- ---### Example ---Initialize a `players` table in `global` for later use. ---``` ---script.on_init(function() --- global.players = {} ---end) ---``` ---@param f fun()@The handler for this event. Passing `nil` will unregister it. on_init=function(f)end, ---Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to [LuaGameScript](https://lua-api.factorio.com/latest/LuaGameScript.html) and [LuaRendering](https://lua-api.factorio.com/latest/LuaRendering.html) is not available. The `global` table can be accessed and is safe to read from, but not write to. ---For all other purposes, [LuaBootstrap::on_init](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_init), [LuaBootstrap::on_configuration_changed](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_configuration_changed) or migration scripts should be used instead. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_load) ---@param f fun()@The handler for this event. Passing `nil` will unregister it. on_load=function(f)end, ---Register a handler to run every nth-tick(s). When the game is on tick 0 it will trigger all registered handlers. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_nth_tick) ---@param tick uint|uint[]@The nth-tick(s) to invoke the handler on. Passing `nil` as the only parameter will unregister all nth-tick handlers. ---@param f fun(param1:NthTickEventData)@The handler to run. Passing `nil` will unregister it for the provided nth-tick(s). on_nth_tick=function(tick,f)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_biter_base_built) ---@class LuaBootstrap.raise_biter_base_built_param ---The entity that was built. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_biter_base_built) ---@field entity LuaEntity ---Raises [on_biter_base_built](https://lua-api.factorio.com/latest/events.html#on_biter_base_built) with the given parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_biter_base_built) ---@param param LuaBootstrap.raise_biter_base_built_param raise_biter_base_built=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_console_chat) ---@class LuaBootstrap.raise_console_chat_param ---The player doing the chatting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_console_chat) ---@field player_index uint ---The chat message to send. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_console_chat) ---@field message string ---Raises [on_console_chat](https://lua-api.factorio.com/latest/events.html#on_console_chat) with the given parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_console_chat) ---@param param LuaBootstrap.raise_console_chat_param raise_console_chat=function(param)end, ---Raise an event. Only events generated with [LuaBootstrap::generate_event_name](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.generate_event_name) and the following can be raised: --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_event) --- ---### Example ---Raise the [on_console_chat](https://lua-api.factorio.com/latest/events.html#on_console_chat) event with the desired message 'from' the first player. ---``` ---local data = {player_index = 1, message = "Hello friends!"} ---script.raise_event(defines.events.on_console_chat, data) ---``` ---@param event uint@ID of the event to raise. ---@param data table@Table with extra data that will be passed to the event handler. raise_event=function(event,data)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_market_item_purchased) ---@class LuaBootstrap.raise_market_item_purchased_param ---The player who did the purchasing. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_market_item_purchased) ---@field player_index uint ---The market entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_market_item_purchased) ---@field market LuaEntity ---The index of the offer purchased. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_market_item_purchased) ---@field offer_index uint ---The amount of offers purchased. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_market_item_purchased) ---@field count uint ---Raises [on_market_item_purchased](https://lua-api.factorio.com/latest/events.html#on_market_item_purchased) with the given parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_market_item_purchased) ---@param param LuaBootstrap.raise_market_item_purchased_param raise_market_item_purchased=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_crafted_item) ---@class LuaBootstrap.raise_player_crafted_item_param ---The item that has been crafted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_crafted_item) ---@field item_stack LuaItemStack ---The player doing the crafting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_crafted_item) ---@field player_index uint ---The recipe used to craft this item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_crafted_item) ---@field recipe LuaRecipe ---Raises [on_player_crafted_item](https://lua-api.factorio.com/latest/events.html#on_player_crafted_item) with the given parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_crafted_item) ---@param param LuaBootstrap.raise_player_crafted_item_param raise_player_crafted_item=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_fast_transferred) ---@class LuaBootstrap.raise_player_fast_transferred_param ---The player transferred from or to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_fast_transferred) ---@field player_index uint ---The entity transferred from or to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_fast_transferred) ---@field entity LuaEntity ---Whether the transfer was from player to entity. If `false`, the transfer was from entity to player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_fast_transferred) ---@field from_player boolean ---Raises [on_player_fast_transferred](https://lua-api.factorio.com/latest/events.html#on_player_fast_transferred) with the given parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_player_fast_transferred) ---@param param LuaBootstrap.raise_player_fast_transferred_param raise_player_fast_transferred=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_built) ---@class LuaBootstrap.raise_script_built_param ---The entity that has been built. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_built) ---@field entity LuaEntity ---Raises [script_raised_built](https://lua-api.factorio.com/latest/events.html#script_raised_built) with the given parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_built) ---@param param LuaBootstrap.raise_script_built_param raise_script_built=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_destroy) ---@class LuaBootstrap.raise_script_destroy_param ---The entity that was destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_destroy) ---@field entity LuaEntity ---Raises [script_raised_destroy](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) with the given parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_destroy) ---@param param LuaBootstrap.raise_script_destroy_param raise_script_destroy=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_revive) ---@class LuaBootstrap.raise_script_revive_param ---The entity that was revived. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_revive) ---@field entity LuaEntity ---The tags associated with this entity, if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_revive) ---@field tags Tags|nil ---Raises [script_raised_revive](https://lua-api.factorio.com/latest/events.html#script_raised_revive) with the given parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_revive) ---@param param LuaBootstrap.raise_script_revive_param raise_script_revive=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_set_tiles) ---@class LuaBootstrap.raise_script_set_tiles_param ---The surface whose tiles have been changed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_set_tiles) ---@field surface_index uint ---The tiles that have been changed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_set_tiles) ---@field tiles Tile[] ---Raises [script_raised_set_tiles](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) with the given parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_set_tiles) ---@param param LuaBootstrap.raise_script_set_tiles_param raise_script_set_tiles=function(param)end, ---Registers an entity so that after it's destroyed, [on_entity_destroyed](https://lua-api.factorio.com/latest/events.html#on_entity_destroyed) is called. Once an entity is registered, it stays registered until it is actually destroyed, even through save/load cycles. The registration is global across all mods, meaning once one mod registers an entity, all mods listening to [on_entity_destroyed](https://lua-api.factorio.com/latest/events.html#on_entity_destroyed) will receive the event when it is destroyed. Registering the same entity multiple times will still only fire the destruction event once, and will return the same registration number. --- ---**Note:** Depending on when a given entity is destroyed, [on_entity_destroyed](https://lua-api.factorio.com/latest/events.html#on_entity_destroyed) will either be fired at the end of the current tick or at the end of the next tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.register_on_entity_destroyed) ---@param entity LuaEntity@The entity to register. ---@return uint64@The registration number. It is used to identify the entity in the [on_entity_destroyed](https://lua-api.factorio.com/latest/events.html#on_entity_destroyed) event. register_on_entity_destroyed=function(entity)end, ---Sets the filters for the given event. The filters are only retained when set after the actual event registration, because registering for an event with different or no filters will overwrite previously set ones. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.set_event_filter) --- ---### Example ---Limit the [on_marked_for_deconstruction](https://lua-api.factorio.com/latest/events.html#on_marked_for_deconstruction) event to only be received when a non-ghost entity is marked for deconstruction. ---``` ---script.set_event_filter(defines.events.on_marked_for_deconstruction, {{filter = "ghost", invert = true}}) ---``` ---Limit the [on_built_entity](https://lua-api.factorio.com/latest/events.html#on_built_entity) event to only be received when either a `unit` or a `unit-spawner` is built. ---``` ---script.set_event_filter(defines.events.on_built_entity, {{filter = "type", type = "unit"}, {filter = "type", type = "unit-spawner"}}) ---``` ---Limit the [on_entity_damaged](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) event to only be received when a `rail` is damaged by an `acid` attack. ---``` ---script.set_event_filter(defines.events.on_entity_damaged, {{filter = "rail"}, {filter = "damage-type", type = "acid", mode = "and"}}) ---``` ---@param event uint@ID of the event to filter. ---@param filters?EventFilter[]@The filters or `nil` to clear them. set_event_filter=function(event,filters)end, } ---A reference to the burner energy source owned by a specific [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) or [LuaEquipment](https://lua-api.factorio.com/latest/LuaEquipment.html). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html) ---@class LuaBurner ---[R] ---The burnt result inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.burnt_result_inventory) ---@field burnt_result_inventory LuaInventory ---[RW] --- ---**Note:** Writing automatically handles correcting [LuaBurner::remaining_burning_fuel](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.remaining_burning_fuel). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.currently_burning) ---@field currently_burning LuaItemPrototype ---[R] ---The fuel categories this burner uses. --- ---**Note:** The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.fuel_categories) ---@field fuel_categories table ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.heat) ---@field heat double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.heat_capacity) ---@field heat_capacity double ---[R] ---The fuel inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.inventory) ---@field inventory LuaInventory ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.object_name) ---@field object_name string ---[R] ---The owner of this burner energy source --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.owner) ---@field owner LuaEntity|LuaEquipment ---[RW] --- ---**Note:** Writing will silently do nothing if there's no [LuaBurner::currently_burning](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.currently_burning) set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.remaining_burning_fuel) ---@field remaining_burning_fuel double ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.valid) ---@field valid boolean local LuaBurner={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.help) ---@return string help=function()end, } ---Prototype of a burner energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html) ---@class LuaBurnerPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.burnt_inventory_size) ---@field burnt_inventory_size uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.effectivity) ---@field effectivity double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.emissions) ---@field emissions double ---[R] --- ---**Note:** The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.fuel_categories) ---@field fuel_categories table ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.fuel_inventory_size) ---@field fuel_inventory_size uint ---[R] ---The light flicker definition for this burner prototype if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@field light_flicker LuaBurnerPrototype.light_flicker ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.object_name) ---@field object_name string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.render_no_network_icon) ---@field render_no_network_icon boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.render_no_power_icon) ---@field render_no_power_icon boolean ---[R] ---The smoke sources for this burner prototype if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.smoke) ---@field smoke SmokeSource[] ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.valid) ---@field valid boolean local LuaBurnerPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.help) ---@return string help=function()end, } ---A chunk iterator can be used for iterating chunks coordinates of a surface. ---The returned type is a [ChunkPositionAndArea](https://lua-api.factorio.com/latest/Concepts.html#ChunkPositionAndArea) containing the chunk coordinates and its area. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaChunkIterator.html) --- ---### Example ---``` ---for chunk in some_surface.get_chunks() do --- game.player.print("x: " .. chunk.x .. ", y: " .. chunk.y) --- game.player.print("area: " .. serpent.line(chunk.area)) ---end ---``` ---@class LuaChunkIterator ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaChunkIterator.html#LuaChunkIterator.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaChunkIterator.html#LuaChunkIterator.valid) ---@field valid boolean local LuaChunkIterator={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaChunkIterator.html#LuaChunkIterator.help) ---@return string help=function()end, ---Get the next chunk position or `nil`, and increments the iterator. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaChunkIterator.html#LuaChunkIterator.operator%20()) ---@return ChunkPositionAndArea __call=function()end, } ---A circuit network associated with a given entity, connector, and wire type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html) ---@class LuaCircuitNetwork ---[R] ---The circuit connector ID on the associated entity this network was gotten from. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.circuit_connector_id) ---@field circuit_connector_id defines.circuit_connector_id ---[R] ---The number of circuits connected to this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.connected_circuit_count) ---@field connected_circuit_count uint ---[R] ---The entity this circuit network reference is associated with --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.entity) ---@field entity LuaEntity ---[R] ---The circuit networks ID. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.network_id) ---@field network_id uint ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.object_name) ---@field object_name string ---[R] ---The circuit network signals last tick. `nil` if there are no signals. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.signals) ---@field signals Signal[] ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.valid) ---@field valid boolean ---[R] ---The wire type this network is associated with. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.wire_type) ---@field wire_type defines.wire_type local LuaCircuitNetwork={ ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.get_signal) ---@param signal SignalID@The signal to read. ---@return int@The current value of the signal. get_signal=function(signal)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCircuitNetwork.html#LuaCircuitNetwork.help) ---@return string help=function()end, } ---[View documentation](https://lua-api.factorio.com/latest/LuaCombinatorControlBehavior.html) ---@class LuaCombinatorControlBehavior:LuaControlBehavior ---[R] ---The circuit network signals sent by this combinator last tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCombinatorControlBehavior.html#LuaCombinatorControlBehavior.signals_last_tick) ---@field signals_last_tick Signal[] local LuaCombinatorControlBehavior={ ---Gets the value of a specific signal sent by this combinator behavior last tick or nil if the signal didn't exist. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCombinatorControlBehavior.html#LuaCombinatorControlBehavior.get_signal_last_tick) ---@param signal SignalID@The signal to get ---@return int@The value or `nil` if none. get_signal_last_tick=function(signal)end, } ---**Global Description:** ---Allows registering custom commands for the in-game console accessible via the grave key. --- ---**Class Description:** ---Allows for the registration of custom console commands. Similarly to [event subscriptions](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_event), these don't persist through a save-and-load cycle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCommandProcessor.html) ---@class LuaCommandProcessor ---[R] ---Lists the custom commands registered by scripts through `LuaCommandProcessor`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCommandProcessor.html#LuaCommandProcessor.commands) ---@field commands table ---[R] ---Lists the built-in commands of the core game. The [wiki](https://wiki.factorio.com/Console) has an overview of these. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCommandProcessor.html#LuaCommandProcessor.game_commands) ---@field game_commands table ---[R] ---This object's name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCommandProcessor.html#LuaCommandProcessor.object_name) ---@field object_name string commands={ ---Add a custom console command. --- ---**Note:** Trying to add a command with the `name` of a game command or the name of a custom command that is already in use will result in an error. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCommandProcessor.html#LuaCommandProcessor.add_command) --- ---### Example ---This will register a custom event called `print_tick` that prints the current tick to either the player issuing the command or to everyone on the server, depending on the command parameter. It shows the usage of the table that gets passed to any function handling a custom command. This specific example makes use of the `tick` and the optional `player_index` and `parameter` fields. The user is supposed to either call it without any parameter (`"/print_tick"`) or with the `"me"` parameter (`"/print_tick me"`). ---``` ---commands.add_command("print_tick", nil, function(command) --- if command.player_index ~= nil and command.parameter == "me" then --- game.get_player(command.player_index).print(command.tick) --- else --- game.print(command.tick) --- end ---end) ---``` ---@param name string@The desired name of the command (case sensitive). ---@param help LocalisedString@The localised help message. It will be shown to players using the `/help` command. ---@param function_ fun(param1:CustomCommandData)@The function that will be called when this command is invoked. add_command=function(name,help,function_)end, ---Remove a custom console command. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCommandProcessor.html#LuaCommandProcessor.remove_command) ---@param name string@The name of the command to remove (case sensitive). ---@return boolean@Whether the command was successfully removed. Returns `false` if the command didn't exist. remove_command=function(name)end, } ---Control behavior for constant combinators. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html) ---@class LuaConstantCombinatorControlBehavior:LuaControlBehavior ---[RW] ---Turns this constant combinator on and off. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.enabled) ---@field enabled boolean ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.object_name) ---@field object_name string ---[RW] ---The constant combinator parameters --- ---**Note:** Setting to `nil` clears the parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.parameters) ---@field parameters ConstantCombinatorParameters[] ---[R] ---The number of signals this constant combinator supports --- ---[View documentation](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.signals_count) ---@field signals_count uint ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.valid) ---@field valid boolean local LuaConstantCombinatorControlBehavior={ ---Gets the signal at the given index. Returned [Signal](https://lua-api.factorio.com/latest/Concepts.html#Signal) will not contain signal if none is set for the index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.get_signal) ---@param index uint ---@return Signal get_signal=function(index)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.help) ---@return string help=function()end, ---Sets the signal at the given index --- ---[View documentation](https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.set_signal) ---@param index uint ---@param signal Signal set_signal=function(index,signal)end, } ---Control behavior for container entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaContainerControlBehavior.html) ---@class LuaContainerControlBehavior:LuaControlBehavior ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaContainerControlBehavior.html#LuaContainerControlBehavior.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaContainerControlBehavior.html#LuaContainerControlBehavior.valid) ---@field valid boolean local LuaContainerControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaContainerControlBehavior.html#LuaContainerControlBehavior.help) ---@return string help=function()end, } ---This is an abstract base class containing the common functionality between [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html) and entities (see [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html)). When accessing player-related functions through a [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html), it must refer to a character entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html) ---@class LuaControl ---[R] ---The build distance of this character or max uint when not a character or player connected to a character. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.build_distance) ---@field build_distance uint ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_additional_mining_categories) ---@field character_additional_mining_categories string[] ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_build_distance_bonus) ---@field character_build_distance_bonus uint ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_crafting_speed_modifier) ---@field character_crafting_speed_modifier double ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_health_bonus) ---@field character_health_bonus float ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_inventory_slots_bonus) ---@field character_inventory_slots_bonus uint ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_item_drop_distance_bonus) ---@field character_item_drop_distance_bonus uint ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_item_pickup_distance_bonus) ---@field character_item_pickup_distance_bonus uint ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_loot_pickup_distance_bonus) ---@field character_loot_pickup_distance_bonus uint ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_maximum_following_robot_count_bonus) ---@field character_maximum_following_robot_count_bonus uint ---[R] ---Gets the current mining progress between 0 and 1 of this character, or 0 if they aren't mining. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_mining_progress) ---@field character_mining_progress double ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_mining_speed_modifier) ---@field character_mining_speed_modifier double ---[RW] ---If personal logistic requests are enabled for this character or players character. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_personal_logistic_requests_enabled) ---@field character_personal_logistic_requests_enabled boolean ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_reach_distance_bonus) ---@field character_reach_distance_bonus uint ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_resource_reach_distance_bonus) ---@field character_resource_reach_distance_bonus uint ---[R] ---Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_running_speed) ---@field character_running_speed double ---[RW] ---Modifies the running speed of this character by the given value as a percentage. Setting the running modifier to `0.5` makes the character run 50% faster. The minimum value of `-1` reduces the movement speed by 100%, resulting in a speed of `0`. --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_running_speed_modifier) ---@field character_running_speed_modifier double ---[RW] --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character (see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.character_trash_slot_count_bonus) ---@field character_trash_slot_count_bonus uint ---[RW] ---When `true` hand crafting is free and instant --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cheat_mode) ---@field cheat_mode boolean ---[R] ---Gets the current crafting queue items. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.crafting_queue) ---@field crafting_queue CraftingQueueItem[] ---[R] ---The crafting queue progress [0-1] 0 when no recipe is being crafted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.crafting_queue_progress) ---@field crafting_queue_progress double ---[R] ---Size of the crafting queue. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.crafting_queue_size) ---@field crafting_queue_size uint ---[RW] ---The ghost prototype in the player's cursor. --- ---**Note:** When read, it will be a [LuaItemPrototype](https://lua-api.factorio.com/latest/LuaItemPrototype.html). --- ---**Note:** Items in the cursor stack will take priority over the cursor ghost. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cursor_ghost) ---@field cursor_ghost ItemPrototypeIdentification ---[R] ---The player's cursor stack, or `nil` if the player controller is a spectator. Even though this property is marked as read-only, it returns a [LuaItemStack](https://lua-api.factorio.com/latest/LuaItemStack.html), meaning it can be manipulated like so: --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cursor_stack) --- ---### Example ---``` ---player.cursor_stack.clear() ---``` ---@field cursor_stack LuaItemStack ---[RW] ---`true` if the player is in a vehicle. Writing to this attribute puts the player in or out of a vehicle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.driving) ---@field driving boolean ---[R] ---The item drop distance of this character or max uint when not a character or player connected to a character. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.drop_item_distance) ---@field drop_item_distance uint ---[R] ---The current combat robots following the character --- ---**Note:** When called on a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), it must be associated with a character(see [LuaPlayer::character](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.following_robots) ---@field following_robots LuaEntity[] ---[RW] ---The force of this entity. Reading will always give a [LuaForce](https://lua-api.factorio.com/latest/LuaForce.html), but it is possible to assign either [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) or [LuaForce](https://lua-api.factorio.com/latest/LuaForce.html) to this attribute to change the force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.force) ---@field force ForceIdentification ---[R] ---If this character entity is in combat. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.in_combat) ---@field in_combat boolean ---[R] ---The item pickup distance of this character or max double when not a character or player connected to a character. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.item_pickup_distance) ---@field item_pickup_distance double ---[R] ---The loot pickup distance of this character or max double when not a character or player connected to a character. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.loot_pickup_distance) ---@field loot_pickup_distance double ---[RW] ---Current mining state. --- ---**Note:** When the player isn't mining tiles the player will mine what ever entity is currently selected. See [LuaControl::selected](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.selected) and [LuaControl::update_selected_entity](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.update_selected_entity). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.mining_state) ---@field mining_state LuaControl.mining_state ---[RW] ---The GUI target the player currently has open; `nil` if none. --- ---**Note:** Write supports any of the types. Read will return the entity, equipment, equipment-grid, player, element or nil. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.opened) ---@field opened LuaEntity|LuaItemStack|LuaEquipment|LuaEquipmentGrid|LuaPlayer|LuaGuiElement|defines.gui_type ---[R] ---Returns the [defines.gui_type](https://lua-api.factorio.com/latest/defines.html#defines.gui_type) or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.opened_gui_type) ---@field opened_gui_type defines.gui_type ---[RW] ---Current item-picking state. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.picking_state) ---@field picking_state boolean ---[R] ---Current position of the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.position) ---@field position Position ---[R] ---The reach distance of this character or max uint when not a character or player connected to a character. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.reach_distance) ---@field reach_distance uint ---[RW] ---Current repair state. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.repair_state) ---@field repair_state LuaControl.repair_state ---[R] ---The resource reach distance of this character or max double when not a character or player connected to a character. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.resource_reach_distance) ---@field resource_reach_distance double ---[RW] ---Current riding state of this car or the vehicle this player is riding in. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.riding_state) ---@field riding_state RidingState ---[RW] ---The currently selected entity; `nil` if none. Assigning an entity will select it if selectable otherwise clears selection. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.selected) ---@field selected LuaEntity ---[RW] ---Current shooting state. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.shooting_state) ---@field shooting_state LuaControl.shooting_state ---[R] ---The surface this entity is currently on. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.surface) ---@field surface LuaSurface ---[R] ---The vehicle the player is currently sitting in; `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.vehicle) ---@field vehicle LuaEntity ---[RW] ---If personal logistic requests are enabled for this vehicle (spidertron). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.vehicle_logistic_requests_enabled) ---@field vehicle_logistic_requests_enabled boolean ---[RW] ---Current walking state. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.walking_state) --- ---### Example ---Make the player go north. Note that a one-shot action like this will only make the player walk for one tick. ---``` ---game.player.walking_state = {walking = true, direction = defines.direction.north} ---``` ---@field walking_state LuaControl.walking_state local LuaControl={ ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.begin_crafting) ---@class LuaControl.begin_crafting_param ---The count to craft. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.begin_crafting) ---@field count uint ---The recipe to craft. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.begin_crafting) ---@field recipe string|LuaRecipe ---If false and the recipe can't be crafted the requested number of times printing the failure is skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.begin_crafting) ---@field silent boolean|nil ---Begins crafting the given count of the given recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.begin_crafting) ---@param param LuaControl.begin_crafting_param ---@return uint@The count that was actually started crafting. begin_crafting=function(param)end, ---Can at least some items be inserted? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.can_insert) ---@param items ItemStackIdentification@Items that would be inserted. ---@return boolean@`true` if at least a part of the given items could be inserted into this inventory. can_insert=function(items)end, ---Can a given entity be opened or accessed? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.can_reach_entity) ---@param entity LuaEntity ---@return boolean can_reach_entity=function(entity)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cancel_crafting) ---@class LuaControl.cancel_crafting_param ---The crafting queue index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cancel_crafting) ---@field index uint ---The count to cancel crafting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cancel_crafting) ---@field count uint ---Cancels crafting the given count of the given crafting queue index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cancel_crafting) ---@param param LuaControl.cancel_crafting_param cancel_crafting=function(param)end, ---Removes the arrow created by `set_gui_arrow`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.clear_gui_arrow) clear_gui_arrow=function()end, ---Remove all items from this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.clear_items_inside) clear_items_inside=function()end, ---**Note:** This will silently fail if personal logistics are not researched. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.clear_personal_logistic_slot) ---@param slot_index uint@The slot to clear. clear_personal_logistic_slot=function(slot_index)end, ---Unselect any selected entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.clear_selected_entity) clear_selected_entity=function()end, ---**Note:** This will silently fail if the vehicle does not use logistics. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.clear_vehicle_logistic_slot) ---@param slot_index uint@The slot to clear. clear_vehicle_logistic_slot=function(slot_index)end, ---Disable the flashlight. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.disable_flashlight) disable_flashlight=function()end, ---Enable the flashlight. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.enable_flashlight) enable_flashlight=function()end, ---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. Returns `nil` if there is no currently selected blueprint. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.get_blueprint_entities) ---@return BlueprintEntity[] get_blueprint_entities=function()end, ---Gets the count of the given recipe that can be crafted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.get_craftable_count) ---@param recipe string|LuaRecipe@The recipe. ---@return uint@The count that can be crafted. get_craftable_count=function(recipe)end, ---Get an inventory belonging to this entity. This can be either the "main" inventory or some auxiliary one, like the module slots or logistic trash slots. --- ---**Note:** A given [defines.inventory](https://lua-api.factorio.com/latest/defines.html#defines.inventory) is only meaningful for the corresponding LuaObject type. EG: get_inventory(defines.inventory.character_main) is only meaningful if 'this' is a player character. You may get a value back but if the type of 'this' isn't the type referred to by the [defines.inventory](https://lua-api.factorio.com/latest/defines.html#defines.inventory) it's almost guaranteed to not be the inventory asked for. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.get_inventory) ---@param inventory defines.inventory ---@return LuaInventory@or `nil` if this entity doesn't have an inventory with the given index. get_inventory=function(inventory)end, ---Get the number of all or some items in this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.get_item_count) ---@param item?string@Prototype name of the item to count. If not specified, count all items. ---@return uint get_item_count=function(item)end, ---Gets the main inventory for this character or player if this is a character or player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.get_main_inventory) ---@return LuaInventory@or `nil` if this entity is not a character or player. get_main_inventory=function()end, ---Sets the personal request and trash to the given values. --- ---**Note:** This will silently return an empty value (.name will be nil) if personal logistics aren't researched yet. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.get_personal_logistic_slot) ---@param slot_index uint@The slot to get. ---@return PersonalLogisticParameters get_personal_logistic_slot=function(slot_index)end, ---Sets the vehicle logistic request and trash to the given values. --- ---**Note:** This will silently return an empty value (.name will be nil) if the vehicle does not use logistics. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.get_vehicle_logistic_slot) ---@param slot_index uint@The slot to get. ---@return PersonalLogisticParameters get_vehicle_logistic_slot=function(slot_index)end, ---Does this entity have any item inside it? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.has_items_inside) ---@return boolean has_items_inside=function()end, ---Insert items into this entity. This works the same way as inserters or shift-clicking: the "best" inventory is chosen automatically. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.insert) ---@param items ItemStackIdentification@Items to insert. ---@return uint@Number of items actually inserted. insert=function(items)end, ---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. Note that the is_cursor_blueprint and get_cursor_blueprint_entities refer to the currently selected blueprint, so it returns blueprint related information also when holding a blueprint book with a blueprint being selected in it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.is_cursor_blueprint) ---@return boolean is_cursor_blueprint=function()end, ---Is the flashlight enabled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.is_flashlight_enabled) is_flashlight_enabled=function()end, ---When `true` control adapter is a LuaPlayer object, `false` for entities including characters with players --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.is_player) ---@return boolean is_player=function()end, ---Mines the given entity as if this player (or character) mined it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.mine_entity) ---@param entity LuaEntity@The entity to mine ---@param force?boolean@Forces mining the entity even if the items can't fit in the player. ---@return boolean@If the mining succeeded. mine_entity=function(entity,force)end, ---Mines the given tile as if this player (or character) mined it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.mine_tile) ---@param tile LuaTile@The tile to mine. ---@return boolean@If the mining succeeded. mine_tile=function(tile)end, ---Open the technology GUI and select a given technology. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.open_technology_gui) ---@param technology?TechnologyIdentification@The technology to select after opening the GUI. open_technology_gui=function(technology)end, ---Remove items from this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.remove_item) ---@param items ItemStackIdentification@Items to remove. ---@return uint@Number of items actually removed. remove_item=function(items)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_gui_arrow) ---@class LuaControl.set_gui_arrow_param ---Where to point to. This field determines what other fields are mandatory. May be `"nowhere"`, `"goal"`, `"entity_info"`, `"active_window"`, `"entity"`, `"position"`, `"crafting_queue"`, or `"item_stack"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_gui_arrow) ---@field type string ---Applies to **"entity"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_gui_arrow) ---@field entity LuaEntity ---Applies to **"position"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_gui_arrow) ---@field position Position ---Applies to **"crafting_queue"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_gui_arrow) ---@field crafting_queueindex uint ---Applies to **"item_stack"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_gui_arrow) ---@field inventory_index defines.inventory ---Applies to **"item_stack"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_gui_arrow) ---@field item_stack_index uint ---Applies to **"item_stack"**: (required) ---May be either `"player"` or `"target"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_gui_arrow) ---@field source string ---Create an arrow which points at this entity. This is used in the tutorial. For examples, see `control.lua` in the campaign missions. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_gui_arrow) ---@param param LuaControl.set_gui_arrow_param set_gui_arrow=function(param)end, ---Sets the personal request and trash to the given values. --- ---**Note:** This will silently fail if personal logistics are not researched. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_personal_logistic_slot) ---@param slot_index uint@The slot to set/ ---@param value PersonalLogisticParameters ---@return boolean@If the slot was set. set_personal_logistic_slot=function(slot_index,value)end, ---Sets the vehicle logistic request and trash to the given values. --- ---**Note:** This will silently fail if the spider does not use logistics. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.set_vehicle_logistic_slot) ---@param slot_index uint@The slot to set/ ---@param value PersonalLogisticParameters ---@return boolean@If the slot was set. set_vehicle_logistic_slot=function(slot_index,value)end, ---Teleport the entity to a given position, possibly on another surface. --- ---**Note:** Some entities may not be teleported. For instance, transport belts won't allow teleportation and this method will always return `false` when used on any such entity. --- ---**Note:** You can also pass 1 or 2 numbers as the parameters and they will be used as relative teleport coordinates `'teleport(0, 1)'` to move the entity 1 tile positive y. `'teleport(4)'` to move the entity 4 tiles to the positive x. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.teleport) ---@param position Position@Where to teleport to. ---@param surface?SurfaceIdentification@Surface to teleport to. If not given, will teleport to the entity's current surface. Only players, cars, and spidertrons can be teleported cross-surface. ---@return boolean@`true` when the entity was successfully teleported. teleport=function(position,surface)end, ---Select an entity, as if by hovering the mouse above it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.update_selected_entity) ---@param position Position@Position of the entity to select update_selected_entity=function(position)end, } ---The control behavior for an entity. Inserters have logistic network and circuit network behavior logic, lamps have circuit logic and so on. This is an abstract base class that concrete control behaviors inherit. --- ---**Note:** An control reference becomes invalid once the control behavior is removed or the entity (see [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html)) it resides in is destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControlBehavior.html) ---@class LuaControlBehavior ---[R] ---The entity this control behavior belongs to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControlBehavior.html#LuaControlBehavior.entity) ---@field entity LuaEntity ---[R] ---The concrete type of this control behavior. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControlBehavior.html#LuaControlBehavior.type) ---@field type defines.control_behavior.type local LuaControlBehavior={ ---[View documentation](https://lua-api.factorio.com/latest/LuaControlBehavior.html#LuaControlBehavior.get_circuit_network) ---@param wire defines.wire_type@Wire color of the network connected to this entity. ---@param circuit_connector?defines.circuit_connector_id@The connector to get circuit network for. Must be specified for entities with more than one circuit network connector. ---@return LuaCircuitNetwork@The circuit network or nil. get_circuit_network=function(wire,circuit_connector)end, } ---A custom tag that shows on the map view. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html) ---@class LuaCustomChartTag ---[R] ---The force this tag belongs to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.force) ---@field force LuaForce ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.icon) ---@field icon SignalID ---[RW] ---The player who last edited this tag. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.last_user) ---@field last_user LuaPlayer ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.object_name) ---@field object_name string ---[R] ---The position of this tag. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.position) ---@field position Position ---[R] ---The surface this tag belongs to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.surface) ---@field surface LuaSurface ---[R] ---The unique ID for this tag on this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.tag_number) ---@field tag_number uint ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.text) ---@field text string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.valid) ---@field valid boolean local LuaCustomChartTag={ ---Destroys this tag. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.destroy) destroy=function()end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomChartTag.html#LuaCustomChartTag.help) ---@return string help=function()end, } ---Prototype of a custom input. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html) ---@class LuaCustomInputPrototype ---[R] ---The action that happens when this custom input is triggered. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.action) ---@field action string ---[R] ---The default alternative key sequence for this custom input. `nil` when not defined. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.alternative_key_sequence) ---@field alternative_key_sequence string ---[R] ---The consuming type: `"none"` or `"game-only"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.consuming) ---@field consuming string ---[R] ---If this custom input is enabled. Disabled custom inputs exist but are not used by the game. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.enabled) ---@field enabled boolean ---[R] ---If this custom input is enabled while using the cutscene controller. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.enabled_while_in_cutscene) ---@field enabled_while_in_cutscene boolean ---[R] ---If this custom input is enabled while using the spectator controller. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.enabled_while_spectating) ---@field enabled_while_spectating boolean ---[R] ---If this custom input will include the selected prototype (if any) when triggered. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.include_selected_prototype) ---@field include_selected_prototype boolean ---[R] ---The item that gets spawned when this custom input is fired or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.item_to_spawn) ---@field item_to_spawn LuaItemPrototype ---[R] ---The default key sequence for this custom input. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.key_sequence) ---@field key_sequence string ---[R] ---The linked game control name or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.linked_game_control) ---@field linked_game_control string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.valid) ---@field valid boolean local LuaCustomInputPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.help) ---@return string help=function()end, } ---Lazily evaluated table. For performance reasons, we sometimes return a custom table-like type instead of a native Lua table. This custom type lazily constructs the necessary Lua wrappers of the corresponding C++ objects, therefore preventing their unnecessary construction in some cases. ---There are some notable consequences to the usage of a custom table type rather than the native Lua table type: Iterating a custom table is only possible using the `pairs` Lua function; `ipairs` won't work. Another key difference is that custom tables cannot be serialised into a game save file -- if saving the game would require serialisation of a custom table, an error will be displayed and the game will not be saved. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomTable.html) --- ---### Example ---In previous versions of Factorio, this would create a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html) instance for every player in the game, even though only one such wrapper is needed. In the current version, accessing [game.players](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players) by itself does not create any [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html) instances; they are created lazily when accessed. Therefore, this example only constructs one [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html) instance, no matter how many elements there are in `game.players`. ---``` ---game.players["Oxyd"].character.die() ---``` --- ---### Example ---Custom tables may be iterated using `pairs`. ---``` ---for _, p in pairs(game.players) do game.player.print(p.name); end ---``` ---The following will produce no output because `ipairs` is not supported with custom tables. ---``` ---for _, p in ipairs(game.players) do game.player.print(p.name); end -- incorrect; use pairs instead ---``` --- ---### Example ---This statement will execute successfully and `global.p` will be useable as one might expect. However, as soon as the user tries to save the game, a "LuaCustomTable cannot be serialized" error will be shown. The game will remain unsaveable so long as `global.p` refers to an instance of a custom table. ---``` ---global.p = game.players -- This has high potential to make the game unsaveable ---``` ---@class LuaCustomTable ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomTable.html#LuaCustomTable.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomTable.html#LuaCustomTable.valid) ---@field valid boolean ---[RW] ---Access an element of this custom table. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomTable.html#LuaCustomTable.operator%20[]) ---@field __index Any ---[R] ---Number of elements in this table. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomTable.html#LuaCustomTable.operator%20#) ---@field __len uint local LuaCustomTable={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaCustomTable.html#LuaCustomTable.help) ---@return string help=function()end, } ---Prototype of a damage. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDamagePrototype.html) ---@class LuaDamagePrototype ---[R] ---Whether this damage type is hidden from entity tooltips. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDamagePrototype.html#LuaDamagePrototype.hidden) ---@field hidden boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDamagePrototype.html#LuaDamagePrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDamagePrototype.html#LuaDamagePrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDamagePrototype.html#LuaDamagePrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDamagePrototype.html#LuaDamagePrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDamagePrototype.html#LuaDamagePrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDamagePrototype.html#LuaDamagePrototype.valid) ---@field valid boolean local LuaDamagePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDamagePrototype.html#LuaDamagePrototype.help) ---@return string help=function()end, } ---Control behavior for decider combinators. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDeciderCombinatorControlBehavior.html) ---@class LuaDeciderCombinatorControlBehavior:LuaCombinatorControlBehavior ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDeciderCombinatorControlBehavior.html#LuaDeciderCombinatorControlBehavior.object_name) ---@field object_name string ---[RW] ---The decider combinator parameters --- ---**Note:** Setting to `nil` clears the parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDeciderCombinatorControlBehavior.html#LuaDeciderCombinatorControlBehavior.parameters) ---@field parameters DeciderCombinatorParameters ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDeciderCombinatorControlBehavior.html#LuaDeciderCombinatorControlBehavior.valid) ---@field valid boolean local LuaDeciderCombinatorControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDeciderCombinatorControlBehavior.html#LuaDeciderCombinatorControlBehavior.help) ---@return string help=function()end, } ---Prototype of an optimized decorative. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html) ---@class LuaDecorativePrototype ---[R] ---Autoplace specification for this decorative prototype. `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.autoplace_specification) ---@field autoplace_specification AutoplaceSpecification ---[R] ---The bounding box used for collision checking. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.collision_box) ---@field collision_box BoundingBox> ---[R] ---The collision masks this decorative uses --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.collision_mask) ---@field collision_mask CollisionMask ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.collision_mask_with_flags) ---@field collision_mask_with_flags CollisionMaskWithFlags ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.valid) ---@field valid boolean local LuaDecorativePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaDecorativePrototype.html#LuaDecorativePrototype.help) ---@return string help=function()end, } ---Prototype of an electric energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html) ---@class LuaElectricEnergySourcePrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.buffer_capacity) ---@field buffer_capacity double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.drain) ---@field drain double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.emissions) ---@field emissions double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.input_flow_limit) ---@field input_flow_limit double ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.object_name) ---@field object_name string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.output_flow_limit) ---@field output_flow_limit double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.render_no_network_icon) ---@field render_no_network_icon boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.render_no_power_icon) ---@field render_no_power_icon boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.usage_priority) ---@field usage_priority string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.valid) ---@field valid boolean local LuaElectricEnergySourcePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaElectricEnergySourcePrototype.html#LuaElectricEnergySourcePrototype.help) ---@return string help=function()end, } ---The primary interface for interacting with entities through the Lua API. Entities are everything that exists on the map except for tiles (see [LuaTile](https://lua-api.factorio.com/latest/LuaTile.html)). ---Most functions on LuaEntity also work when the entity is contained in a ghost. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html) ---@class LuaEntity:LuaControl ---[RW] ---Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will stop moving etc). --- ---**Note:** Entities that are not active naturally can't be set to be active (setting it to be active will do nothing) --- ---**Note:** Ghosts, simple smoke, and corpses can't be modified at this time. --- ---**Note:** It is even possible to set the character to not be active, so he can't move and perform most of the tasks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.active) ---@field active boolean ---[R] ---The ai settings of this unit. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ai_settings) --- ---_Can only be used if this is Unit_ ---@field ai_settings LuaAISettings ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.alert_parameters) --- ---_Can only be used if this is ProgrammableSpeaker_ ---@field alert_parameters ProgrammableSpeakerAlertParameters ---[RW] ---Whether this character's personal roboports are allowed to dispatch robots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.allow_dispatching_robots) --- ---_Can only be used if this is Character_ ---@field allow_dispatching_robots boolean ---[RW] ---Count of resource units contained. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.amount) --- ---_Can only be used if this is ResourceEntity_ ---@field amount uint ---[R] ---If this land mine is armed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.armed) --- ---_Can only be used if this is LandMine_ ---@field armed boolean ---[RW] ---The player this character is associated with or `nil` if none. When the player logs off in multiplayer all of the associated characters will be logged off with him. --- ---**Note:** A character associated with a player is not directly controlled by any player. --- ---**Note:** Set to `nil` to clear. The player will be automatically disassociated when a controller is set on the character. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.associated_player) --- ---_Can only be used if this is Character_ ---@field associated_player LuaPlayer ---[RW] ---Whether this rocket silo automatically launches the rocket when cargo is inserted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.auto_launch) --- ---_Can only be used if this is RocketSilo_ ---@field auto_launch boolean ---[RW] ---Destination position of spidertron's autopilot. Returns `nil` if autopilot doesn't have destination set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.autopilot_destination) --- ---_Can only be used if this is SpiderVehicle_ ---@field autopilot_destination Position ---[R] ---The queued destination positions of spidertron's autopilot. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.autopilot_destinations) --- ---_Can only be used if this is SpiderVehicle_ ---@field autopilot_destinations Position[] ---[RW] ---The backer name assigned to this entity, or `nil` if this entity doesn't support backer names. Entities that support backer names are labs, locomotives, radars, roboports, and train stops. --- ---**Note:** While train stops get the name of a backer when placed down, players can rename them if they want to. In this case, `backer_name` returns the player-given name of the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.backer_name) ---@field backer_name string ---[R] ---The belt connectable neighbours of this belt connectable entity. Only entities that input to or are outputs of this entity. Does not contain the other end of an underground belt, see [LuaEntity::neighbours](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.neighbours) for that. This is a dictionary with `"inputs"`, `"outputs"` entries that are arrays of transport belt connectable entities, or empty tables if no entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.belt_neighbours) --- ---_Can only be used if this is TransportBeltConnectable_ ---@field belt_neighbours table ---[R] ---`"input"` or `"output"`, depending on whether this underground belt goes down or up. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.belt_to_ground_type) --- ---_Can only be used if this is TransportBeltToGround_ ---@field belt_to_ground_type string ---[RW] ---The bonus mining progress for this mining drill or `nil` if this isn't a mining drill. Read yields a number in range [0, mining_target.prototype.mineable_properties.mining_time] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.bonus_mining_progress) ---@field bonus_mining_progress double ---[RW] ---The current productivity bonus progress, as a number in range [0, 1]. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.bonus_progress) --- ---_Can only be used if this is CraftingMachine_ ---@field bonus_progress double ---[R] ---[LuaEntityPrototype::collision_box](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_box) around entity's given position and respecting the current entity orientation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.bounding_box) ---@field bounding_box BoundingBox> ---[R] ---The burner energy source for this entity or `nil` if there isn't one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.burner) ---@field burner LuaBurner ---[R] ---The state of this chain signal. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.chain_signal_state) --- ---_Can only be used if this is RailChainSignal_ ---@field chain_signal_state defines.chain_signal_state ---[RW] ---The reason this character corpse character died (if any). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.character_corpse_death_cause) --- ---_Can only be used if this is CharacterCorpse_ ---@field character_corpse_death_cause LocalisedString ---[RW] ---The player index associated with this character corpse. --- ---**Note:** The index is not guaranteed to be valid so it should always be checked first if a player with that index actually exists. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.character_corpse_player_index) --- ---_Can only be used if this is CharacterCorpse_ ---@field character_corpse_player_index uint ---[RW] ---The tick this character corpse died at. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.character_corpse_tick_of_death) --- ---_Can only be used if this is CharacterCorpse_ ---@field character_corpse_tick_of_death uint ---[R] ---Entities that are directly connected to this entity via the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.circuit_connected_entities) ---@field circuit_connected_entities LuaEntity.circuit_connected_entities ---[R] ---The connection definition for entities that are directly connected to this entity via the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.circuit_connection_definitions) ---@field circuit_connection_definitions CircuitConnectionDefinition[] ---[R] ---The orientation of this cliff. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.cliff_orientation) ---@field cliff_orientation CliffOrientation ---[RW] ---The character, rolling stock, train stop, car, spider-vehicle, flying text, corpse or simple-entity-with-owner color. Returns `nil` if this entity doesn't use custom colors. --- ---**Note:** Car color is overridden by the color of the current driver/passenger, if there is one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.color) ---@field color Color ---[RW] ---The owner of this combat robot if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.combat_robot_owner) ---@field combat_robot_owner LuaEntity ---[R] ---The command given to this unit or `nil` is the unit has no command. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.command) --- ---_Can only be used if this is Unit_ ---@field command Command ---[R] ---The rail entity this train stop is connected to or `nil` if there is none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.connected_rail) --- ---_Can only be used if this is TrainStop_ ---@field connected_rail LuaEntity ---[R] ---The consumption bonus of this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.consumption_bonus) ---@field consumption_bonus double ---[RW] ---Multiplies the energy consumption. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.consumption_modifier) --- ---_Can only be used if this is Car_ ---@field consumption_modifier float ---[RW] ---Whether this corpse will ever fade away. --- ---**Note:** Useable only on corpses. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.corpse_expires) ---@field corpse_expires boolean ---[RW] ---If true, corpse won't be destroyed when entities are placed over it. If false, whether corpse will be removed or not depends on value of CorpsePrototype::remove_on_entity_placement. --- ---**Note:** Useable only on corpses. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.corpse_immune_to_entity_placement) ---@field corpse_immune_to_entity_placement boolean ---[RW] ---The current crafting progress, as a number in range [0, 1]. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.crafting_progress) --- ---_Can only be used if this is CraftingMachine_ ---@field crafting_progress float ---[R] ---The current crafting speed, including speed bonuses from modules and beacons. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.crafting_speed) --- ---_Can only be used if this is CraftingMachine_ ---@field crafting_speed double ---[RW] ---The damage dealt by this turret, artillery turret, or artillery wagon. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.damage_dealt) --- ---_Can only be used if this is Turret_ ---@field damage_dealt double ---[RW] ---When the entity is not destructible it can't be damaged. --- ---**Note:** An indestructible entity can still be mined. --- ---**Note:** Entities that are indestructible naturally (they have no health, like smoke, resource etc) can't be set to be destructible. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destructible) ---@field destructible boolean ---[RW] ---The current direction this entity is facing. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.direction) ---@field direction defines.direction ---[R] ---The distraction command given to this unit or `nil` is the unit currently isn't distracted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.distraction_command) --- ---_Can only be used if this is Unit_ ---@field distraction_command Command ---[RW] ---Whether the driver of this car or spidertron is the gunner, if false, the passenger is the gunner. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.driver_is_gunner) ---@field driver_is_gunner boolean ---[RW] ---Position where the entity puts its stuff. --- ---**Note:** Meaningful only for entities that put stuff somewhere, such as mining drills or inserters. Mining drills can't have their drop position changed; inserters must have `allow_custom_vectors` set to true on their prototype to allow changing the drop position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.drop_position) ---@field drop_position Position ---[RW] ---The entity this entity is putting its stuff to or `nil` if there is no such entity. --- ---**Note:** Meaningful only for entities that put stuff somewhere, such as mining drills or inserters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.drop_target) ---@field drop_target LuaEntity ---[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. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.effective_speed) --- ---_Can only be used if this is Unit_ ---@field effective_speed float ---[RW] ---Multiplies the acceleration the vehicle can create for one unit of energy. By default is `1`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.effectivity_modifier) --- ---_Can only be used if this is Car_ ---@field effectivity_modifier float ---[R] ---The effects being applied to this entity or `nil`. For beacons this is the effect the beacon is broadcasting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.effects) ---@field effects ModuleEffects ---[RW] ---The buffer size for the electric energy source or nil if the entity doesn't have an electric energy source. --- ---**Note:** Write access is limited to the ElectricEnergyInterface type --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_buffer_size) ---@field electric_buffer_size double ---[R] ---The electric drain for the electric energy source or nil if the entity doesn't have an electric energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_drain) ---@field electric_drain double ---[R] ---The emissions for the electric energy source or nil if the entity doesn't have an electric energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_emissions) ---@field electric_emissions double ---[R] ---The input flow limit for the electric energy source or nil if the entity doesn't have an electric energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_input_flow_limit) ---@field electric_input_flow_limit double ---[R] ---Returns the id of the electric network that this entity is connected to or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_network_id) ---@field electric_network_id uint ---[R] ---The electric network statistics for this electric pole. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_network_statistics) --- ---_Can only be used if this is ElectricPole_ ---@field electric_network_statistics LuaFlowStatistics ---[R] ---The output flow limit for the electric energy source or nil if the entity doesn't have an electric energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_output_flow_limit) ---@field electric_output_flow_limit double ---[RW] ---If equipment grid logistics are enabled while this vehicle is moving. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.enable_logistics_while_moving) --- ---_Can only be used if this is Vehicle_ ---@field enable_logistics_while_moving boolean ---[RW] ---Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.). always 0 for entities that don't have the concept of energy stored inside. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.energy) --- ---### Example ---``` ---game.player.print("Machine energy: " .. game.player.selected.energy .. "J") ---game.player.selected.energy = 3000 ---``` ---@field energy double ---[R] ---How much energy this generator generated in the last tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.energy_generated_last_tick) --- ---_Can only be used if this is Generator_ ---@field energy_generated_last_tick double ---[RW] ---The label of this entity if it has one or `nil`. Changing the value will trigger on_entity_renamed event --- ---**Note:** only usable on entities that have labels (currently only spider-vehicles). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.entity_label) ---@field entity_label string ---[R] ---The number of filter slots this inserter, loader, or logistic storage container has. 0 if not one of those entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.filter_slot_count) ---@field filter_slot_count uint ---[RW] ---Fluidboxes of this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.fluidbox) ---@field fluidbox LuaFluidBox ---[RW] ---The follow offset of this spidertron if any. If it is not following an entity this will be nil. This is randomized each time the follow entity is set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.follow_offset) --- ---_Can only be used if this is SpiderVehicle_ ---@field follow_offset Position ---[RW] ---The follow target of this spidertron if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.follow_target) --- ---_Can only be used if this is SpiderVehicle_ ---@field follow_target LuaEntity ---[RW] ---Multiplies the car friction rate. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.friction_modifier) --- ---### Example ---This will allow the car to go much faster ---``` ---game.player.vehicle.friction_modifier = 0.5 ---``` --- ---_Can only be used if this is Car_ ---@field friction_modifier float ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_localised_description) --- ---_Can only be used if this is Ghost_ ---@field ghost_localised_description LocalisedString ---[R] ---Localised name of the entity or tile contained in this ghost. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_localised_name) --- ---_Can only be used if this is Ghost_ ---@field ghost_localised_name LocalisedString ---[R] ---Name of the entity or tile contained in this ghost --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_name) --- ---_Can only be used if this is Ghost_ ---@field ghost_name string ---[R] ---The prototype of the entity or tile contained in this ghost. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_prototype) --- ---_Can only be used if this is Ghost_ ---@field ghost_prototype LuaEntityPrototype|LuaTilePrototype ---[R] ---The prototype type of the entity or tile contained in this ghost. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_type) --- ---_Can only be used if this is Ghost_ ---@field ghost_type string ---[R] ---The unit number of the entity contained in this ghost or nil if the entity doesn't have one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_unit_number) --- ---_Can only be used if this is EntityGhost_ ---@field ghost_unit_number uint ---[RW] ---The graphics variation for this entity or `nil` if this entity doesn't use graphics variations. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.graphics_variation) ---@field graphics_variation uint8 ---[R] ---The equipment grid or `nil` if this entity doesn't have an equipment grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.grid) ---@field grid LuaEquipmentGrid ---[RW] ---Health of the entity. Setting health to less than 0 will set health to 0, entities with 0 health can not be attacked. Setting health to higher than max health will set health to max health. --- ---**Note:** If used on an entity that doesn't support health, this field will be `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.health) ---@field health float ---[R] ---The item stack currently held in an inserter's hand. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.held_stack) --- ---_Can only be used if this is Inserter_ ---@field held_stack LuaItemStack ---[R] ---Current position of the inserter's "hand". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.held_stack_position) --- ---_Can only be used if this is Inserter_ ---@field held_stack_position Position ---[RW] ---The blink interval of this highlight box entity. 0 indicates no blink. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.highlight_box_blink_interval) --- ---_Can only be used if this is HighlightBox_ ---@field highlight_box_blink_interval uint ---[RW] ---The hightlight box type of this highlight box entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.highlight_box_type) --- ---_Can only be used if this is HighlightBox_ ---@field highlight_box_type string ---[RW] ---The filters for this infinity container. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.infinity_container_filters) --- ---_Can only be used if this is InfinityContainer_ ---@field infinity_container_filters InfinityInventoryFilter[] ---[RW] ---Count of initial resource units contained. --- ---**Note:** If this is not an infinite resource reading will give `nil` and writing will give an error. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.initial_amount) --- ---_Can only be used if this is ResourceEntity_ ---@field initial_amount uint ---[RW] ---The filter mode for this filter inserter: "whitelist", "blacklist", or `nil` if this inserter doesn't use filters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.inserter_filter_mode) --- ---_Can only be used if this is Inserter_ ---@field inserter_filter_mode string ---[RW] ---Sets the stack size limit on this inserter. If the stack size is > than the force stack size limit the value is ignored. --- ---**Note:** Set to 0 to reset. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.inserter_stack_size_override) ---@field inserter_stack_size_override uint ---[R] ---If this entity is EntityWithForce --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_entity_with_force) ---@field is_entity_with_force boolean ---[R] ---If this entity is EntityWithHealth --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_entity_with_health) ---@field is_entity_with_health boolean ---[R] ---If this entity is EntityWithOwner --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_entity_with_owner) ---@field is_entity_with_owner boolean ---[RW] ---Items this ghost will request when revived or items this item request proxy is requesting. Result is a dictionary mapping each item prototype name to the required count. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.item_requests) ---@field item_requests table ---[RW] ---The number of units killed by this turret, artillery turret, or artillery wagon. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.kills) --- ---_Can only be used if this is Turret_ ---@field kills uint ---[RW] ---The player who built the entity --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.last_user) --- ---_Can only be used if this is EntityWithOwner_ ---@field last_user LuaPlayer ---[RW] ---The link ID this linked container is using. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.link_id) ---@field link_id uint ---[R] ---Neighbour to which this linked belt is connected to. Returns nil if not connected. --- ---**Note:** Can also be used on entity ghost if it contains linked-belt --- ---**Note:** May return entity ghost which contains linked belt to which connection is made --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.linked_belt_neighbour) --- ---_Can only be used if this is LinkedBelt_ ---@field linked_belt_neighbour LuaEntity ---[RW] ---Type of linked belt: it is either `"input"` or `"output"`. Changing type will also flip direction so the belt is out of the same side --- ---**Note:** Can only be changed when linked belt is disconnected (has no neighbour set) --- ---**Note:** Can also be used on entity ghost if it contains linked-belt --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.linked_belt_type) --- ---_Can only be used if this is LinkedBelt_ ---@field linked_belt_type string ---[R] ---The container entity this loader is pointing at/pulling from depending on the [LuaEntity::loader_type](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.loader_type). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.loader_container) --- ---_Can only be used if this is Loader_ ---@field loader_container LuaEntity ---[RW] ---`"input"` or `"output"`, depending on whether this loader puts to or gets from a container. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.loader_type) --- ---_Can only be used if this is Loader_ ---@field loader_type string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.localised_description) ---@field localised_description LocalisedString ---[R] ---Localised name of the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.localised_name) ---@field localised_name LocalisedString ---[R] ---The logistic cell this entity is a part of. Will be `nil` if this entity is not a part of any logistic cell. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.logistic_cell) ---@field logistic_cell LuaLogisticCell ---[RW] ---The logistic network this entity is a part of. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.logistic_network) ---@field logistic_network LuaLogisticNetwork ---[RW] --- ---**Note:** Not minable entities can still be destroyed. --- ---**Note:** Entities that are not minable naturally (like smoke, character, enemy units etc) can't be set to minable. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.minable) ---@field minable boolean ---[RW] ---The mining progress for this mining drill or `nil` if this isn't a mining drill. Is a number in range [0, mining_target.prototype.mineable_properties.mining_time] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mining_progress) ---@field mining_progress double ---[R] ---The mining target or `nil` if none --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mining_target) --- ---_Can only be used if this is MiningDrill_ ---@field mining_target LuaEntity ---[R] ---Returns true if this unit is moving. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.moving) --- ---_Can only be used if this is Unit_ ---@field moving boolean ---[R] ---Name of the entity prototype. E.g. "inserter" or "filter-inserter". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.name) ---@field name string ---[R] ---The current total neighbour bonus of this reactor. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.neighbour_bonus) --- ---_Can only be used if this is Reactor_ ---@field neighbour_bonus double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.neighbours) ---@field neighbours table|LuaEntity[][]|LuaEntity ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.object_name) ---@field object_name string ---[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. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.operable) ---@field operable boolean ---[RW] ---The smooth orientation of this entity, if it supports orientation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.orientation) ---@field orientation RealOrientation ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.parameters) --- ---_Can only be used if this is ProgrammableSpeaker_ ---@field parameters ProgrammableSpeakerParameters ---[RW] ---Where the inserter will pick up items from. --- ---**Note:** Inserters must have `allow_custom_vectors` set to true on their prototype to allow changing the pickup position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.pickup_position) --- ---_Can only be used if this is Inserter_ ---@field pickup_position Position ---[RW] ---The entity the inserter will attempt to pick up from. For example, this can be a transport belt or a storage chest. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.pickup_target) --- ---_Can only be used if this is Inserter_ ---@field pickup_target LuaEntity ---[R] ---The player connected to this character or `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.player) --- ---_Can only be used if this is Character_ ---@field player LuaPlayer ---[R] ---The pollution bonus of this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.pollution_bonus) ---@field pollution_bonus double ---[RW] ---The power production specific to the ElectricEnergyInterface entity type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.power_production) --- ---_Can only be used if this is ElectricEnergyInterface_ ---@field power_production double ---[RW] ---The state of this power switch. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.power_switch_state) ---@field power_switch_state boolean ---[RW] ---The power usage specific to the ElectricEnergyInterface entity type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.power_usage) --- ---_Can only be used if this is ElectricEnergyInterface_ ---@field power_usage double ---[R] ---The previous recipe this furnace was using or nil if the furnace had no previous recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.previous_recipe) --- ---_Can only be used if this is Furnace_ ---@field previous_recipe LuaRecipe ---[R] ---The productivity bonus of this entity. --- ---**Note:** This includes force based bonuses as well as beacon/module bonuses. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.productivity_bonus) ---@field productivity_bonus double ---[RW] ---The number of products this machine finished crafting in its lifetime. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.products_finished) --- ---_Can only be used if this is CraftingMachine_ ---@field products_finished uint ---[R] ---The entity prototype of this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.prototype) ---@field prototype LuaEntityPrototype ---[R] ---The target entity for this item-request-proxy or `nil` --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.proxy_target) ---@field proxy_target LuaEntity ---[R] ---The rail target of this pump or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.pump_rail_target) --- ---_Can only be used if this is Pump_ ---@field pump_rail_target LuaEntity ---[RW] ---When locked; the recipe in this assembling machine can't be changed by the player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.recipe_locked) --- ---_Can only be used if this is AssemblingMachine_ ---@field recipe_locked boolean ---[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. --- ---**Note:** Writing does nothing if the vehicle doesn't have a turret. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.relative_turret_orientation) ---@field relative_turret_orientation RealOrientation ---[RW] ---If items not included in this infinity container filters should be removed from the container. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_unfiltered_items) --- ---_Can only be used if this is InfinityContainer_ ---@field remove_unfiltered_items boolean ---[RW] ---The player that this simple-entity-with-owner, simple-entity-with-force, flying-text or highlight-box is visible to or `nil`. Set to `nil` to clear. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.render_player) ---@field render_player LuaPlayer ---[RW] ---The forces that this simple-entity-with-owner, simple-entity-with-force or flying-text is visible to or `nil`. Set to `nil` to clear. --- ---**Note:** Reading will always give an array of [LuaForce](https://lua-api.factorio.com/latest/LuaForce.html) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.render_to_forces) ---@field render_to_forces ForceIdentification[] ---[RW] ---Whether this requester chest is set to also request from buffer chests. --- ---**Note:** Useable only on entities that have requester slots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.request_from_buffers) ---@field request_from_buffers boolean ---[R] ---The index of the configured request with the highest index for this entity. This means 0 if no requests are set and e.g. 20 if the 20th request slot is configured. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.request_slot_count) ---@field request_slot_count uint ---[RW] ---Number of rocket parts in the silo. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rocket_parts) --- ---_Can only be used if this is RocketSilo_ ---@field rocket_parts uint ---[RW] ---When entity is not to be rotatable (inserter, transport belt etc), it can't be rotated by player using the R key. --- ---**Note:** Entities that are not rotatable naturally (like chest or furnace) can't be set to be rotatable. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotatable) ---@field rotatable boolean ---[R] ---The secondary bounding box of this entity or `nil` if it doesn't have one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.secondary_bounding_box) ---@field secondary_bounding_box BoundingBox> ---[R] ---The secondary selection box of this entity or `nil` if it doesn't have one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.secondary_selection_box) ---@field secondary_selection_box BoundingBox> ---[RW] ---Index of the currently selected weapon slot of this character, car, or spidertron, or `nil` if the car/spidertron doesn't have guns. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.selected_gun_index) --- ---_Can only be used if this is Character or Car_ ---@field selected_gun_index uint ---[R] ---[LuaEntityPrototype::selection_box](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.selection_box) around entity's given position and respecting the current entity orientation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.selection_box) ---@field selection_box BoundingBox> ---[RW] ---The shooting target for this turret or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.shooting_target) ---@field shooting_target LuaEntity ---[R] ---The state of this rail signal. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.signal_state) --- ---_Can only be used if this is RailSignal_ ---@field signal_state defines.signal_state ---[R] ---The spawner associated with this unit entity or `nil` if the unit has no associated spawner. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.spawner) ---@field spawner LuaEntity ---[RW] ---The current speed of this car in tiles per tick, rolling stock, projectile or spider vehicle, or current max speed of the unit. Only the speed of units, cars, and projectiles are writable. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.speed) ---@field speed float ---[R] ---The speed bonus of this entity. --- ---**Note:** This includes force based bonuses as well as beacon/module bonuses. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.speed_bonus) ---@field speed_bonus double ---[RW] ---The filter for this splitter or `nil` if no filter is set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.splitter_filter) --- ---_Can only be used if this is Splitter_ ---@field splitter_filter LuaItemPrototype ---[RW] ---The input priority for this splitter : "left", "none", or "right". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.splitter_input_priority) --- ---_Can only be used if this is Splitter_ ---@field splitter_input_priority string ---[RW] ---The output priority for this splitter : "left", "none", or "right". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.splitter_output_priority) --- ---_Can only be used if this is Splitter_ ---@field splitter_output_priority string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.stack) --- ---_Can only be used if this is ItemEntity_ ---@field stack LuaItemStack ---[R] ---The status of this entity or `nil` if no status. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.status) ---@field status defines.entity_status ---[R] ---The entity this sticker is sticked to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.sticked_to) ---@field sticked_to LuaEntity ---[R] ---The sticker entities attached to this entity or `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.stickers) ---@field stickers LuaEntity[] ---[RW] ---The storage filter for this logistic storage container. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.storage_filter) ---@field storage_filter LuaItemPrototype ---[R] ---Whether the entity has direction. When it is false for this entity, it will always return north direction when asked for. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.supports_direction) ---@field supports_direction boolean ---[RW] ---The tags associated with this entity ghost or `nil` if not an entity ghost. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tags) ---@field tags Tags ---[RW] ---The temperature of this entities heat energy source if this entity uses a heat energy source or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.temperature) ---@field temperature double ---[RW] ---The text of this flying-text entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.text) --- ---_Can only be used if this is FlyingText_ ---@field text LocalisedString ---[RW] ---The last tick this character entity was attacked. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tick_of_last_attack) --- ---_Can only be used if this is Character_ ---@field tick_of_last_attack uint ---[RW] ---The last tick this character entity was damaged. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tick_of_last_damage) --- ---_Can only be used if this is Character_ ---@field tick_of_last_damage uint ---[RW] ---The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.time_to_live) ---@field time_to_live uint ---[RW] ---The ticks until the next trigger effect of this smoke-with-trigger. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.time_to_next_effect) --- ---_Can only be used if this is SmokeWithTrigger_ ---@field time_to_next_effect uint ---[RW] ---The timeout that's left on this landmine in ticks. It describes the time between the landmine being placed and it being armed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.timeout) --- ---_Can only be used if this is LandMine_ ---@field timeout uint ---[RW] ---Will this entity be picked up automatically when the player walks over it? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.to_be_looted) --- ---_Can only be used if this is ItemEntity_ ---@field to_be_looted boolean ---[RW] ---The torso orientation of this spider vehicle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.torso_orientation) --- ---_Can only be used if this is SpiderVehicle_ ---@field torso_orientation RealOrientation ---[R] ---The train this rolling stock belongs to or nil if not rolling stock. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.train) ---@field train LuaTrain ---[R] ---Amount of trains related to this particular train stop. Includes train stopped at this train stop (until it finds a path to next target) and trains having this train stop as goal or waypoint. Writing nil will disable the limit (will set a maximum possible value). --- ---**Note:** Train may be included multiple times when braking distance covers this train stop multiple times --- ---**Note:** Value may be read even when train stop has no control behavior --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_count) --- ---_Can only be used if this is TrainStop_ ---@field trains_count uint ---[R] ---The number of trains in this rail block for this rail entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_in_block) --- ---_Can only be used if this is Rail_ ---@field trains_in_block uint ---[RW] ---Amount of trains above which no new trains will be sent to this train stop. --- ---**Note:** When a train stop has a control behavior with wire connected and set_trains_limit enabled, this value will be overwritten by it --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_limit) --- ---_Can only be used if this is TrainStop_ ---@field trains_limit uint ---[RW] ---Index of the tree color. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_color_index) ---@field tree_color_index uint8 ---[R] ---Maximum index of the tree colors. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_color_index_max) ---@field tree_color_index_max uint8 ---[RW] ---Index of the tree gray stage --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_gray_stage_index) ---@field tree_gray_stage_index uint8 ---[R] ---Maximum index of the tree gray stages. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_gray_stage_index_max) ---@field tree_gray_stage_index_max uint8 ---[RW] ---Index of the tree stage. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_stage_index) ---@field tree_stage_index uint8 ---[R] ---Maximum index of the tree stages. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_stage_index_max) ---@field tree_stage_index_max uint8 ---[R] ---The entity prototype type of this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.type) ---@field type string ---[R] ---The unit group this unit is a member of, or `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_group) --- ---_Can only be used if this is Unit_ ---@field unit_group LuaUnitGroup ---[R] ---The unit number or nil if the entity doesn't have one. This is universally unique for every entity that has one, for the lifetime of a whole game. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number) ---@field unit_number uint ---[R] ---The units associated with this spawner entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.units) ---@field units LuaEntity[] ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.valid) ---@field valid boolean ---[RW] ---Read when this spidertron auto-targets enemies --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.vehicle_automatic_targeting_parameters) --- ---_Can only be used if this is SpiderVehicle_ ---@field vehicle_automatic_targeting_parameters VehicleAutomaticTargetingParameters local LuaEntity={ ---Adds the given position to this spidertron's autopilot's queue of destinations. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.add_autopilot_destination) --- ---_Can only be used if this is SpiderVehicle_ ---@param position Position@The position the spidertron should move to. add_autopilot_destination=function(position)end, ---Offer a thing on the market. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.add_market_item) --- ---### Example ---Adds market offer, 1 copper ore for 10 iron ore. ---``` ---market.add_market_item{price={{"iron-ore", 10}}, offer={type="give-item", item="copper-ore"}} ---``` --- ---### Example ---Adds market offer, 1 copper ore for 5 iron ore and 5 stone ore. ---``` ---market.add_market_item{price={{"iron-ore", 5}, {"stone", 5}}, offer={type="give-item", item="copper-ore"}} ---``` --- ---_Can only be used if this is Market_ ---@param offer Offer add_market_item=function(offer)end, ---Checks if the entity can be destroyed --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.can_be_destroyed) ---@return boolean@if the entity can be destroyed. can_be_destroyed=function()end, ---If this character can shoot the given entity or position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.can_shoot) ---@param target LuaEntity ---@param position Position ---@return boolean can_shoot=function(target,position)end, ---Can wires reach between these entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.can_wires_reach) ---@param entity LuaEntity ---@return boolean can_wires_reach=function(entity)end, ---Cancels deconstruction if it is scheduled, does nothing otherwise. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.cancel_deconstruction) ---@param force ForceIdentification@The force who did the deconstruction order. ---@param player?PlayerIdentification@The player to set the last_user to if any. cancel_deconstruction=function(force,player)end, ---Cancels upgrade if it is scheduled, does nothing otherwise. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.cancel_upgrade) ---@param force ForceIdentification@The force who did the upgrade order. ---@param player?PlayerIdentification@The player to set the last_user to if any. ---@return boolean@If the cancel was successful. cancel_upgrade=function(force,player)end, ---Remove all fluids from this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clear_fluid_inside) clear_fluid_inside=function()end, ---Removes all offers from a market. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clear_market_items) --- ---_Can only be used if this is Market_ clear_market_items=function()end, ---Clear a logistic requester slot. --- ---**Note:** Useable only on entities that have requester slots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clear_request_slot) ---@param slot uint@The slot index. clear_request_slot=function(slot)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone) ---@class LuaEntity.clone_param ---The destination position --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone) ---@field position Position ---The destination surface --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone) ---@field surface LuaSurface|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone) ---@field force ForceIdentification|nil ---If false, the building effect smoke will not be shown around the new entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone) ---@field create_build_effect_smoke boolean|nil ---Clones this entity. --- ---**Note:** [defines.events.on_entity_cloned](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_cloned) is raised. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone) ---@param param LuaEntity.clone_param ---@return LuaEntity@The cloned entity or `nil` if this entity can't be cloned/can't be cloned to the given location. clone=function(param)end, ---Connects current linked belt with another one. ---Neighbours have to be of different type. If given linked belt is connected to something else it will be disconnected first. If provided neighbour is connected to something else it will also be disconnected first. Automatically updates neighbour to be connected back to this one. --- ---**Note:** Can also be used on entity ghost if it contains linked-belt --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.connect_linked_belts) --- ---_Can only be used if this is LinkedBelt_ ---@param neighbour LuaEntity@Another linked belt or entity ghost containing linked belt to connect or nil to disconnect connect_linked_belts=function(neighbour)end, ---Connect two devices with a circuit wire or copper cable. Depending on which type of connection should be made, there are different procedures: --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.connect_neighbour) ---@param target LuaEntity|WireConnectionDefinition@The target with which to establish a connection. ---@return boolean@Whether the connection was successfully formed. connect_neighbour=function(target)end, ---Connects the rolling stock in the given direction. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.connect_rolling_stock) ---@param direction defines.rail_direction ---@return boolean@If any connection was made connect_rolling_stock=function(direction)end, ---Copies settings from the given entity onto this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.copy_settings) ---@param entity LuaEntity ---@param by_player?PlayerIdentification@If provided, the copying is done 'as' this player and [on_entity_settings_pasted](https://lua-api.factorio.com/latest/events.html#on_entity_settings_pasted) is triggered. ---@return table@Any items removed from this entity as a result of copying the settings. copy_settings=function(entity,by_player)end, ---Creates the same smoke that is created when you place a building by hand. You can play the building sound to go with it by using [LuaSurface::play_sound](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.play_sound), eg: entity.surface.play_sound{path="entity-build/"..entity.prototype.name, position=entity.position} --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.create_build_effect_smoke) create_build_effect_smoke=function()end, ---Damages the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.damage) --- ---_Can only be used if this is EntityWithHealth_ ---@param damage float@The amount of damage to be done ---@param force ForceIdentification@The force that will be doing the damage. ---@param type?string@The type of damage to be done, defaults to "impact". ---@param dealer?LuaEntity@The entity to consider as the damage dealer. ---@return float@the total damage actually applied after resistances. damage=function(damage,force,type,dealer)end, ---Depletes and destroys this resource entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.deplete) --- ---_Can only be used if this is ResourceEntity_ deplete=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy) ---@class LuaEntity.destroy_param ---Whether neighbouring cliffs should be corrected. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy) ---@field do_cliff_correction boolean|nil ---If `true`, [script_raised_destroy](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) will be called. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy) ---@field raise_destroy boolean|nil ---Destroys the entity. --- ---**Note:** Not all entities can be destroyed - things such as rails under trains cannot be destroyed until the train is moved or destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy) ---@param param?LuaEntity.destroy_param ---@return boolean@Returns `false` if the entity was valid and destruction failed, `true` in all other cases. destroy=function(param)end, ---Immediately kills the entity. Does nothing if the entity doesn't have health. ---Unlike [LuaEntity::destroy](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy), `die` will trigger the [on_entity_died](https://lua-api.factorio.com/latest/events.html#on_entity_died) event and the entity will produce a corpse and drop loot if it has any. --- ---**Note:** If `force` is not specified, `on_entity_died` will blame the `"neutral"` force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.die) --- ---### Example ---This function can be called with only the `cause` argument and no `force`: ---``` ---entity.die(nil, killer_entity) ---``` ---@param force?ForceIdentification@The force to attribute the kill to. ---@param cause?LuaEntity@The cause to attribute the kill to. ---@return boolean@Whether the entity was successfully killed. die=function(force,cause)end, ---Disconnects linked belt from its neighbour. --- ---**Note:** Can also be used on entity ghost if it contains linked-belt --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.disconnect_linked_belts) --- ---_Can only be used if this is LinkedBelt_ disconnect_linked_belts=function()end, ---Disconnect circuit wires or copper cables between devices. Depending on which type of connection should be cut, there are different procedures: --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.disconnect_neighbour) ---@param target?defines.wire_type|LuaEntity|WireConnectionDefinition@The target with which to cut a connection. disconnect_neighbour=function(target)end, ---Tries to disconnect this rolling stock in the given direction. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.disconnect_rolling_stock) ---@param direction defines.rail_direction ---@return boolean@If anything was disconnected disconnect_rolling_stock=function(direction)end, ---Get the source of this beam. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_beam_source) --- ---_Can only be used if this is Beam_ ---@return BeamTarget get_beam_source=function()end, ---Get the target of this beam. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_beam_target) --- ---_Can only be used if this is Beam_ ---@return BeamTarget get_beam_target=function()end, ---The burnt result inventory for this entity or `nil` if this entity doesn't have a burnt result inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_burnt_result_inventory) ---@return LuaInventory get_burnt_result_inventory=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_circuit_network) ---@param wire defines.wire_type@Wire color of the network connected to this entity. ---@param circuit_connector?defines.circuit_connector_id@The connector to get circuit network for. Must be specified for entities with more than one circuit network connector. ---@return LuaCircuitNetwork@The circuit network or nil. get_circuit_network=function(wire,circuit_connector)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rail) ---@class LuaEntity.get_connected_rail_param ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rail) ---@field rail_direction defines.rail_direction ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rail) ---@field rail_connection_direction defines.rail_connection_direction ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rail) --- ---_Can only be used if this is Rail_ ---@param param LuaEntity.get_connected_rail_param ---@return LuaEntity@Rail connected in the specified manner to this one. get_connected_rail=function(param)end, ---Get the rails that this signal is connected to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rails) --- ---_Can only be used if this is RailSignal_ ---@return LuaEntity[] get_connected_rails=function()end, ---Gets rolling stock connected to the given end of this stock --- ---**Note:** This will also return [defines.rail_direction](https://lua-api.factorio.com/latest/defines.html#defines.rail_direction) of other rolling stock that is connected back to this rolling stock --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rolling_stock) ---@param direction defines.rail_direction ---@return LuaEntity@One of connected rolling stocks get_connected_rolling_stock=function(direction)end, ---Gets the control behavior of the entity (if any). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_control_behavior) ---@return LuaControlBehavior@The control behavior or nil. get_control_behavior=function()end, ---Returns the amount of damage to be taken by this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_damage_to_be_taken) ---@return float get_damage_to_be_taken=function()end, ---Gets the driver of this vehicle if any. --- ---**Note:** May be `nil` if the vehicle contains no driver. To check if there's a passenger see [LuaEntity::get_passenger](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_passenger). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_driver) --- ---_Can only be used if this is Vehicle_ ---@return LuaEntity|LuaPlayer get_driver=function()end, ---Get the filter for a slot in an inserter, loader, or logistic storage container. --- ---**Note:** The entity must allow filters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_filter) ---@param slot_index uint@Index of the slot to get the filter for. ---@return string@Prototype name of the item being filtered. `nil` if the given slot has no filter. get_filter=function(slot_index)end, ---Get amounts of all fluids in this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_fluid_contents) ---@return table@The amounts, indexed by fluid names. get_fluid_contents=function()end, ---Get the amount of all or some fluid in this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_fluid_count) ---@param fluid?string@Prototype name of the fluid to count. If not specified, count all fluids. ---@return double get_fluid_count=function(fluid)end, ---The fuel inventory for this entity or `nil` if this entity doesn't have a fuel inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_fuel_inventory) ---@return LuaInventory get_fuel_inventory=function()end, ---The health ratio of this entity between 1 and 0 (for full health and no health respectively). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_health_ratio) ---@return float get_health_ratio=function()end, ---Gets the heat setting for this heat interface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_heat_setting) --- ---_Can only be used if this is HeatInterface_ ---@return HeatSetting get_heat_setting=function()end, ---Gets the filter for this infinity container at the given index or `nil` if the filter index doesn't exist or is empty. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_infinity_container_filter) --- ---_Can only be used if this is InfinityContainer_ ---@param index uint@The index to get. ---@return InfinityInventoryFilter get_infinity_container_filter=function(index)end, ---Gets the filter for this infinity pipe or `nil` if the filter is empty. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_infinity_pipe_filter) --- ---_Can only be used if this is InfinityPipe_ ---@return InfinityPipeFilter get_infinity_pipe_filter=function()end, ---Gets all the `LuaLogisticPoint`s that this entity owns. Optionally returns only the point specified by the index parameter. --- ---**Note:** When `index` is not given, this will be a single `LuaLogisticPoint` for most entities. For some (such as the player character), it can be zero or more. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_logistic_point) ---@param index?defines.logistic_member_index@If provided, only returns the `LuaLogisticPoint` specified by this index. ---@return LuaLogisticPoint|LuaLogisticPoint[] get_logistic_point=function(index)end, ---Get all offers in a market as an array. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_market_items) --- ---_Can only be used if this is Market_ ---@return Offer[] get_market_items=function()end, ---Get the maximum transport line index of a belt or belt connectable entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_max_transport_line_index) --- ---_Can only be used if this is TransportBeltConnectable_ ---@return uint get_max_transport_line_index=function()end, ---Read a single signal from the combined circuit networks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_merged_signal) ---@param signal SignalID@The signal to read. ---@param circuit_connector?defines.circuit_connector_id@The connector to get signals for. Must be specified for entities with more than one circuit network connector. ---@return int@The current value of the signal. get_merged_signal=function(signal,circuit_connector)end, ---The merged circuit network signals or `nil` if there are no signals. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_merged_signals) ---@param circuit_connector?defines.circuit_connector_id@The connector to get signals for. Must be specified for entities with more than one circuit network connector. ---@return Signal[]@The sum of signals on both the red and green networks, or nil if it doesn't have a circuit connector. get_merged_signals=function(circuit_connector)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_module_inventory) ---@return LuaInventory@Inventory for storing modules of this entity; `nil` if this entity has no module inventory. get_module_inventory=function()end, ---Gets (and or creates if needed) the control behavior of the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_or_create_control_behavior) ---@return LuaControlBehavior@The control behavior or nil. get_or_create_control_behavior=function()end, ---Gets the entities output inventory if it has one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_output_inventory) ---@return LuaInventory@a reference to the entities output inventory. get_output_inventory=function()end, ---Gets the passenger of this car or spidertron if any. --- ---**Note:** May be `nil` if the vehicle contains no passenger. To check if there's a driver see [LuaEntity::get_driver](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_driver). --- ---**Note:** This differs over [LuaEntity::get_driver](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_driver) in that the passenger can't drive the car. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_passenger) --- ---_Can only be used if this is Vehicle_ ---@return LuaEntity|LuaPlayer get_passenger=function()end, ---The radius of this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_radius) ---@return double get_radius=function()end, ---Get the rail at the end of the rail segment this rail is in. --- ---**Note:** A rail segment is a continuous section of rail with no branches, signals, nor train stops. --- ---**Note:** This function has a second return value. A [defines.rail_direction](https://lua-api.factorio.com/latest/defines.html#defines.rail_direction) that points out of the rail segment from the end rail. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_rail_segment_end) --- ---_Can only be used if this is Rail_ ---@param direction defines.rail_direction ---@return LuaEntity get_rail_segment_end=function(direction)end, ---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. --- ---**Note:** A rail segment is a continuous section of rail with no branches, signals, nor train stops. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_rail_segment_entity) --- ---_Can only be used if this is Rail_ ---@param direction defines.rail_direction@The direction of travel relative to this rail. ---@param in_else_out boolean@If true, gets the entity at the entrance of the rail segment, otherwise gets the entity at the exit of the rail segment. ---@return LuaEntity get_rail_segment_entity=function(direction,in_else_out)end, ---Get the length of the rail segment this rail is in. --- ---**Note:** A rail segment is a continuous section of rail with no branches, signals, nor train stops. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_rail_segment_length) --- ---_Can only be used if this is Rail_ ---@return double get_rail_segment_length=function()end, ---Get a rail from each rail segment that overlaps with this rail's rail segment. --- ---**Note:** A rail segment is a continuous section of rail with no branches, signals, nor train stops. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_rail_segment_overlaps) --- ---_Can only be used if this is Rail_ ---@return LuaEntity[] get_rail_segment_overlaps=function()end, ---Current recipe being assembled by this machine or `nil` if no recipe is set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_recipe) --- ---_Can only be used if this is CraftingMachine_ ---@return LuaRecipe get_recipe=function()end, ---Get a logistic requester slot. --- ---**Note:** Useable only on entities that have requester slots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_request_slot) ---@param slot uint@The slot index. ---@return SimpleItemStack@Contents of the specified slot; `nil` if the given slot contains no request. get_request_slot=function(slot)end, ---The train currently stopped at this train stop or `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_stopped_train) --- ---_Can only be used if this is TrainStop_ ---@return LuaTrain get_stopped_train=function()end, ---The trains scheduled to stop at this train stop. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_train_stop_trains) --- ---_Can only be used if this is TrainStop_ ---@return LuaTrain[] get_train_stop_trains=function()end, ---Get a transport line of a belt or belt connectable entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_transport_line) --- ---_Can only be used if this is TransportBeltConnectable_ ---@param index uint@Index of the requested transport line. ---@return LuaTransportLine get_transport_line=function(index)end, ---Returns the new entity direction after upgrading. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_upgrade_direction) ---@return defines.direction@nil if this entity is not marked for upgrade. get_upgrade_direction=function()end, ---Returns the new entity prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_upgrade_target) ---@return LuaEntityPrototype@nil if this entity is not marked for upgrade. get_upgrade_target=function()end, ---Same as [LuaEntity::has_flag](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.has_flag) but targets the inner entity on a entity ghost. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_has_flag) --- ---_Can only be used if this is EntityGhost_ ---@param flag string@The flag to test ---@return boolean@`true` if the entity has the given flag set. ghost_has_flag=function(flag)end, ---Has this unit been assigned a command? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.has_command) --- ---_Can only be used if this is Unit_ ---@return boolean has_command=function()end, ---Test whether this entity's prototype has a flag set. --- ---**Note:** `entity.has_flag(f)` is a shortcut for `entity.prototype.has_flag(f)`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.has_flag) ---@param flag string@The flag to test ---@return boolean@`true` if the entity has the given flag set. has_flag=function(flag)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.help) ---@return string help=function()end, ---Insert fluid into this entity. Fluidbox is chosen automatically. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.insert_fluid) ---@param fluid Fluid@Fluid to insert. ---@return double@Amount of fluid actually inserted. insert_fluid=function(fluid)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_closed) --- ---_Can only be used if this is Gate_ ---@return boolean@`true` if this gate is currently closed. is_closed=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_closing) --- ---_Can only be used if this is Gate_ ---@return boolean@`true` if this gate is currently closing is_closing=function()end, ---Returns true if this entity is connected to an electric network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_connected_to_electric_network) ---@return boolean is_connected_to_electric_network=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_crafting) --- ---_Can only be used if this is CraftingMachine_ ---@return boolean@`true` if this machine is currently crafting. is_crafting=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_opened) --- ---_Can only be used if this is Gate_ ---@return boolean@`true` if this gate is currently opened. is_opened=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_opening) --- ---_Can only be used if this is Gate_ ---@return boolean@`true` if this gate is currently opening. is_opening=function()end, ---Is this entity or tile ghost or item request proxy registered for construction? If false, it means a construction robot has been dispatched to build the entity, or it is not an entity that can be constructed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_construction) ---@return boolean is_registered_for_construction=function()end, ---Is this entity registered for deconstruction with this force? If false, it means a construction robot has been dispatched to deconstruct it, or it is not marked for deconstruction. This is worst-case O(N) complexity where N is the current number of things in the deconstruct queue. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_deconstruction) ---@param force ForceIdentification@The force construction manager to check. ---@return boolean is_registered_for_deconstruction=function(force)end, ---Is this entity registered for repair? If false, it means a construction robot has been dispatched to upgrade it, or it is not damaged. This is worst-case O(N) complexity where N is the current number of things in the repair queue. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_repair) ---@return boolean is_registered_for_repair=function()end, ---Is this entity registered for upgrade? If false, it means a construction robot has been dispatched to upgrade it, or it is not marked for upgrade. This is worst-case O(N) complexity where N is the current number of things in the upgrade queue. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_upgrade) ---@return boolean is_registered_for_upgrade=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.launch_rocket) --- ---_Can only be used if this is RocketSilo_ ---@return boolean@`true` if the rocket was successfully launched. Return value of `false` means the silo is not ready for launch. launch_rocket=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine) ---@class LuaEntity.mine_param ---If provided the item(s) will be transferred into this inventory. If provided, this must be an inventory created with [LuaGameScript::create_inventory](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_inventory) or be a basic inventory owned by some entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine) ---@field inventory LuaInventory|nil ---If true, when the item(s) don't fit into the given inventory the entity is force mined. If false, the mining operation fails when there isn't enough room to transfer all of the items into the inventory. Defaults to false. This is ignored and acts as 'true' if no inventory is provided. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine) ---@field force boolean|nil ---If true, [script_raised_destroy](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) will be raised. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine) ---@field raise_destroyed boolean|nil ---If true, the minable state of the entity is ignored. Defaults to false. If false, an entity that isn't minable (set as not-minable in the prototype or isn't minable for other reasons) will fail to be mined. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine) ---@field ignore_minable boolean|nil ---Mines this entity. --- ---**Note:** 'standard' operation is to keep calling mine() with an inventory until all items are transferred and the items dealt with. --- ---**Note:** The result of mining the entity (the item(s) it produces when mined) will be dropped on the ground if they don't fit into the provided inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine) ---@param param?LuaEntity.mine_param ---@return boolean@Whether mining succeeded. mine=function(param)end, ---Sets the entity to be deconstructed by construction robots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_deconstruction) ---@param force ForceIdentification@The force whose robots are supposed to do the deconstruction. ---@param player?PlayerIdentification@The player to set the last_user to if any. ---@return boolean@if the entity was marked for deconstruction. order_deconstruction=function(force,player)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade) ---@class LuaEntity.order_upgrade_param ---The force whose robots are supposed to do the upgrade. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade) ---@field force ForceIdentification ---The prototype of the entity to upgrade to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade) ---@field target EntityPrototypeIdentification ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade) ---@field player PlayerIdentification|nil ---The new direction if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade) ---@field direction defines.direction|nil ---Sets the entity to be upgraded by construction robots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade) ---@param param LuaEntity.order_upgrade_param ---@return boolean@if the entity was marked for upgrade. order_upgrade=function(param)end, ---Plays a note with the given instrument and note. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.play_note) --- ---_Can only be used if this is ProgrammableSpeaker_ ---@param instrument uint ---@param note uint ---@return boolean@If the request is valid. The sound may or may not be played depending on polyphony settings. play_note=function(instrument,note)end, ---Release the unit from the spawner which spawned it. This allows the spawner to continue spawning additional units. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.release_from_spawner) --- ---_Can only be used if this is Unit_ release_from_spawner=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid) ---@class LuaEntity.remove_fluid_param ---Fluid prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid) ---@field name string ---Amount to remove --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid) ---@field amount double ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid) ---@field minimum_temperature double|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid) ---@field maximum_temperature double|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid) ---@field temperature double|nil ---Remove fluid from this entity. --- ---**Note:** If temperature is given only fluid matching that exact temperature is removed. If minimum and maximum is given fluid within that range is removed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid) ---@param param LuaEntity.remove_fluid_param ---@return double@Amount of fluid actually removed. remove_fluid=function(param)end, ---Remove an offer from a market. --- ---**Note:** The other offers are moved down to fill the gap created by removing the offer, which decrements the overall size of the offer array. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_market_item) --- ---_Can only be used if this is Market_ ---@param offer uint@Index of offer to remove. ---@return boolean@`true` if the offer was successfully removed; `false` when the given index was not valid. remove_market_item=function(offer)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.request_to_close) --- ---_Can only be used if this is Gate_ ---@param force ForceIdentification@The force that requests the gate to be closed. request_to_close=function(force)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.request_to_open) --- ---_Can only be used if this is Gate_ ---@param force ForceIdentification@The force that requests the gate to be open. ---@param extra_time?uint@Extra ticks to stay open. request_to_open=function(force,extra_time)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.revive) ---@class LuaEntity.revive_param ---If `true` the function will return item request proxy as the third parameter. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.revive) ---@field return_item_request_proxy boolean|nil ---If true, and an entity ghost; [script_raised_revive](https://lua-api.factorio.com/latest/events.html#script_raised_revive) will be called. Else if true, and a tile ghost; [script_raised_set_tiles](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) will be called. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.revive) ---@field raise_revive boolean|nil ---Revive a ghost. I.e. turn it from a ghost to a real entity or tile. --- ---**Note:** If this is an entity ghost and it is successfully revived this will also return the revived entity or `nil` as a second return value and possibly item request proxy as the third parameter depending on value of return_item_request_proxy. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.revive) ---@param param?LuaEntity.revive_param ---@return table@Any items the new real entity collided with or `nil` if the ghost could not be revived. revive=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate) ---@class LuaEntity.rotate_param ---If `true`, rotate the entity in the counter-clockwise direction. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate) ---@field reverse boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate) ---@field by_player PlayerIdentification|nil ---If the player is not given should extra items be spilled or returned as a second return value from this. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate) ---@field spill_items boolean|nil ---When true, each spilled item will be flagged with the [LuaEntity::to_be_looted](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.to_be_looted) flag. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate) ---@field enable_looted boolean|nil ---When provided the spilled items will be marked for deconstruction by this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate) ---@field force LuaForce|string|nil ---Rotates this entity as if the player rotated it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate) ---@param param?LuaEntity.rotate_param ---@return boolean@Whether the rotation was successful. rotate=function(param)end, ---Set the source of this beam. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_beam_source) --- ---_Can only be used if this is Beam_ ---@param source LuaEntity|Position set_beam_source=function(source)end, ---Set the target of this beam. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_beam_target) --- ---_Can only be used if this is Beam_ ---@param target LuaEntity|Position set_beam_target=function(target)end, ---Give the entity a command. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_command) --- ---_Can only be used if this is Unit_ ---@param command Command set_command=function(command)end, ---Sets the driver of this vehicle. --- ---**Note:** This differs over [LuaEntity::set_passenger](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_passenger) in that the passenger can't drive the vehicle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_driver) --- ---_Can only be used if this is Vehicle_ ---@param driver LuaEntity|PlayerIdentification@The new driver or `nil` to eject the current driver if any. set_driver=function(driver)end, ---Set the filter for a slot in an inserter, loader, or logistic storage container. --- ---**Note:** The entity must allow filters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_filter) ---@param slot_index uint@Index of the slot to set the filter for. ---@param item string@Prototype name of the item to filter. set_filter=function(slot_index,item)end, ---Sets the heat setting for this heat interface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_heat_setting) --- ---_Can only be used if this is HeatInterface_ ---@param filter HeatSetting@The new setting. set_heat_setting=function(filter)end, ---Sets the filter for this infinity container at the given index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_infinity_container_filter) --- ---_Can only be used if this is InfinityContainer_ ---@param index uint@The index to set. ---@param filter InfinityInventoryFilter@The new filter or `nil` to clear the filter. set_infinity_container_filter=function(index,filter)end, ---Sets the filter for this infinity pipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_infinity_pipe_filter) --- ---_Can only be used if this is InfinityPipe_ ---@param filter InfinityPipeFilter@The new filter or `nil` to clear the filter. set_infinity_pipe_filter=function(filter)end, ---Sets the passenger of this car or spidertron. --- ---**Note:** This differs over [LuaEntity::get_driver](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_driver) in that the passenger can't drive the car. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_passenger) --- ---_Can only be used if this is Vehicle_ ---@param passenger LuaEntity|PlayerIdentification set_passenger=function(passenger)end, ---Sets the current recipe in this assembly machine. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_recipe) --- ---_Can only be used if this is CraftingMachine_ ---@param recipe string|LuaRecipe@The new recipe or `nil` to clear the recipe. ---@return table@Any items removed from this entity as a result of setting the recipe. set_recipe=function(recipe)end, ---Set a logistic requester slot. --- ---**Note:** Useable only on entities that have requester slots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_request_slot) ---@param request ItemStackIdentification@What to request. ---@param slot uint@The slot index. ---@return boolean@If the slot was set. set_request_slot=function(request,slot)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.silent_revive) ---@class LuaEntity.silent_revive_param ---If `true` the function will return item request proxy as the third parameter. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.silent_revive) ---@field return_item_request_proxy boolean|nil ---If true, and an entity ghost; [script_raised_revive](https://lua-api.factorio.com/latest/events.html#script_raised_revive) will be called. Else if true, and a tile ghost; [script_raised_set_tiles](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) will be called. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.silent_revive) ---@field raise_revive boolean|nil ---Revives a ghost silently. --- ---**Note:** If this is an entity ghost and it is successfully revived this will also return the revived entity or `nil` as a second return value and possibly item request proxy as the third parameter depending on value of return_item_request_proxy. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.silent_revive) ---@param param?LuaEntity.silent_revive_param ---@return table@Any items the new real entity collided with or `nil` if the ghost could not be revived. silent_revive=function(param)end, ---Triggers spawn_decoration actions defined in the entity prototype or does nothing if entity is not "turret" or "unit-spawner". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.spawn_decorations) spawn_decorations=function()end, ---Only works if the entity is a speech-bubble, with an "effect" defined in its wrapper_flow_style. Starts animating the opacity of the speech bubble towards zero, and destroys the entity when it hits zero. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.start_fading_out) start_fading_out=function()end, ---Whether this entity supports a backer name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.supports_backer_name) ---@return boolean supports_backer_name=function()end, ---Is this entity marked for deconstruction? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.to_be_deconstructed) ---@return boolean to_be_deconstructed=function()end, ---Is this entity marked for upgrade? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.to_be_upgraded) ---@return boolean to_be_upgraded=function()end, ---Toggle this entity's equipment movement bonus. Does nothing if the entity does not have an equipment grid. --- ---**Note:** This property can also be read and written on the equipment grid of this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.toggle_equipment_movement_bonus) toggle_equipment_movement_bonus=function()end, ---Reconnect loader, beacon, cliff and mining drill connections to entities that might have been teleported out or in by the script. The game doesn't do this automatically as we don't want to loose performance by checking this in normal games. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.update_connections) update_connections=function()end, } ---Prototype of an entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html) ---@class LuaEntityPrototype ---[R] ---Entities this entity can be pasted onto in addition to the normal allowed ones. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.additional_pastable_entities) ---@field additional_pastable_entities LuaEntityPrototype[] ---[R] ---The bounding box that specifies which tiles adjacent to the offshore pump should be checked. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.adjacent_tile_collision_box) --- ---_Can only be used if this is OffshorePump_ ---@field adjacent_tile_collision_box BoundingBox> ---[R] ---Tiles adjacent to the offshore pump must not collide with this collision mask. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.adjacent_tile_collision_mask) --- ---_Can only be used if this is OffshorePump_ ---@field adjacent_tile_collision_mask CollisionMask ---[R] ---If this mask is not empty, tiles adjacent to the offshore pump must not collide with this collision mask. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.adjacent_tile_collision_test) --- ---_Can only be used if this is OffshorePump_ ---@field adjacent_tile_collision_test CollisionMask ---[R] ---Whether this unit prototype is affected by tile walking speed modifiers or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.affected_by_tiles) ---@field affected_by_tiles boolean ---[R] ---The air resistance of this rolling stock prototype or `nil` if not a rolling stock prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.air_resistance) ---@field air_resistance double ---[R] ---The alert icon shift of this entity prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.alert_icon_shift) ---@field alert_icon_shift Vector ---[R] ---Does this turret prototype alert when attacking? or `nil` if not turret prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.alert_when_attacking) ---@field alert_when_attacking boolean ---[R] ---Does this entity with health prototype alert when damaged? or `nil` if not entity with health prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.alert_when_damaged) ---@field alert_when_damaged boolean ---[R] ---If this market allows access to all forces or just friendly ones. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.allow_access_to_all_forces) ---@field allow_access_to_all_forces boolean ---[R] ---If this inserter allows burner leeching. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.allow_burner_leech) ---@field allow_burner_leech boolean ---[R] ---When false copy-paste is not allowed for this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.allow_copy_paste) ---@field allow_copy_paste boolean ---[R] ---If this inserter allows custom pickup and drop vectors. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.allow_custom_vectors) ---@field allow_custom_vectors boolean ---[R] ---If this vehicle allows passengers. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.allow_passengers) ---@field allow_passengers boolean ---[R] ---The allowed module effects for this entity or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.allowed_effects) ---@field allowed_effects table ---[R] ---Whether the lamp is always on (except when out of power or turned off by the circuit network) or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.always_on) ---@field always_on boolean ---[R] ---The attack parameters for this entity or `nil` if the entity doesn't use attack parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.attack_parameters) ---@field attack_parameters AttackParameters ---[R] ---The attack result of this entity if the entity has one, else `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.attack_result) ---@field attack_result TriggerItem[] ---[R] ---The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.automated_ammo_count) ---@field automated_ammo_count uint ---[R] ---Autoplace specification for this entity prototype. `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.autoplace_specification) ---@field autoplace_specification AutoplaceSpecification ---[R] ---The base productivity of this crafting machine, lab, or mining drill, or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.base_productivity) ---@field base_productivity double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.belt_distance) --- ---_Can only be used if this is Loader_ ---@field belt_distance double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.belt_length) --- ---_Can only be used if this is Loader_ ---@field belt_length double ---[R] ---The speed of this transport belt or `nil` if this isn't a transport belt related prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.belt_speed) ---@field belt_speed double ---[R] ---The braking force of this vehicle prototype or `nil` if not a vehicle prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.braking_force) ---@field braking_force double ---[R] ---The evolution requirement to build this entity as a base when expanding enemy bases. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.build_base_evolution_requirement) ---@field build_base_evolution_requirement double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.build_distance) --- ---_Can only be used if this is Character_ ---@field build_distance uint ---[R] ---The log2 of grid size of the building --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.building_grid_bit_shift) ---@field building_grid_bit_shift uint ---[R] ---The burner energy source prototype this entity uses or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.burner_prototype) ---@field burner_prototype LuaBurnerPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.call_for_help_radius) ---@field call_for_help_radius double ---[R] ---Whether this unit prototype can open gates or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.can_open_gates) ---@field can_open_gates boolean ---[R] ---The collision mask used only for collision test with tile directly at offshore pump position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.center_collision_mask) --- ---_Can only be used if this is OffshorePump_ ---@field center_collision_mask CollisionMask ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.character_corpse) --- ---_Can only be used if this is Character_ ---@field character_corpse LuaEntityPrototype ---[R] ---The item prototype name used to destroy this cliff or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.cliff_explosive_prototype) ---@field cliff_explosive_prototype string ---[R] ---The bounding box used for collision checking. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_box) ---@field collision_box BoundingBox> ---[R] ---The collision masks this entity uses --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_mask) ---@field collision_mask CollisionMask ---[R] ---Does this prototype collision mask collide with itself? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_mask_collides_with_self) ---@field collision_mask_collides_with_self boolean ---[R] ---Does this prototype collision mask collide with tiles only? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_mask_collides_with_tiles_only) ---@field collision_mask_collides_with_tiles_only boolean ---[R] ---Does this prototype collision mask consider tile transitions? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_mask_considers_tile_transitions) ---@field collision_mask_considers_tile_transitions boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_mask_with_flags) ---@field collision_mask_with_flags CollisionMaskWithFlags ---[R] ---The color of the prototype, or `nil` if the prototype doesn't have color. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.color) ---@field color Color ---[R] ---The construction radius for this roboport prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.construction_radius) ---@field construction_radius double ---[R] ---The energy consumption of this car prototype or `nil` if not a car prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.consumption) ---@field consumption double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.container_distance) --- ---_Can only be used if this is Loader_ ---@field container_distance double ---[R] ---Corpses used when this entity is destroyed. It is a dictionary indexed by the corpse's prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.corpses) ---@field corpses table ---[R] ---If this simple-entity is counted as a rock for the deconstruction planner "trees and rocks only" filter. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.count_as_rock_for_filtered_deconstruction) ---@field count_as_rock_for_filtered_deconstruction boolean ---[R] ---The crafting categories this entity supports. Only meaningful when this is a crafting-machine or player entity type. --- ---**Note:** The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.crafting_categories) ---@field crafting_categories table ---[R] ---The crafting speed of this crafting-machine or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.crafting_speed) ---@field crafting_speed double ---[R] ---If this prototype will attempt to create a ghost of itself on death. --- ---**Note:** If this is false then a ghost will never be made, if it's true a ghost may be made. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.create_ghost_on_death) ---@field create_ghost_on_death boolean ---[R] ---The trigger run when this entity is created or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_effect) ---@field created_effect TriggerItem[] ---[R] ---The smoke trigger run when this entity is built or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field created_smoke LuaEntityPrototype.created_smoke ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.damage_hit_tint) --- ---_Can only be used if this is Character_ ---@field damage_hit_tint Color ---[R] ---Value between 0 and 1 darkness where all lamps of this lamp prototype are off or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.darkness_for_all_lamps_off) ---@field darkness_for_all_lamps_off float ---[R] ---Value between 0 and 1 darkness where all lamps of this lamp prototype are on or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.darkness_for_all_lamps_on) ---@field darkness_for_all_lamps_on float ---[R] ---The hardcoded default collision mask (with flags) for this entity prototype type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.default_collision_mask_with_flags) ---@field default_collision_mask_with_flags CollisionMaskWithFlags ---[R] ---The distraction cooldown of this unit prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.distraction_cooldown) ---@field distraction_cooldown uint ---[R] ---The distribution effectivity for this beacon prototype or `nil` if not a beacon prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.distribution_effectivity) ---@field distribution_effectivity double ---[R] ---The door opening speed for this rocket silo prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.door_opening_speed) ---@field door_opening_speed double ---[R] ---Whether this logistics or construction robot renders its cargo when flying or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.draw_cargo) ---@field draw_cargo boolean ---[R] ---The bounding box used for drawing the entity icon. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.drawing_box) ---@field drawing_box BoundingBox> ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.drop_item_distance) --- ---_Can only be used if this is Character_ ---@field drop_item_distance uint ---[R] ---The effectivity of this car prototype, generator prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.effectivity) ---@field effectivity double ---[R] ---The electric energy source prototype this entity uses or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.electric_energy_source_prototype) ---@field electric_energy_source_prototype LuaElectricEnergySourcePrototype ---[R] ---Amount of pollution emissions per second this entity will create. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.emissions_per_second) ---@field emissions_per_second double ---[R] ---The enemy map color used when charting this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.enemy_map_color) ---@field enemy_map_color Color ---[R] ---The energy used per hitpoint taken for this vehicle during collisions or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.energy_per_hit_point) ---@field energy_per_hit_point double ---[R] ---The energy consumed per tile moved for this flying robot or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.energy_per_move) ---@field energy_per_move double ---[R] ---The energy consumed per tick for this flying robot or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.energy_per_tick) ---@field energy_per_tick double ---[R] ---The direct energy usage of this entity or `nil` if this entity doesn't have a direct energy usage. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.energy_usage) ---@field energy_usage double ---[R] ---The engine starting speed for this rocket silo rocket prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.engine_starting_speed) ---@field engine_starting_speed double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.enter_vehicle_distance) --- ---_Can only be used if this is Character_ ---@field enter_vehicle_distance double ---[R] ---Does this explosion have a beam or `nil` if not an explosion prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.explosion_beam) ---@field explosion_beam double ---[R] ---Does this explosion rotate or `nil` if not an explosion prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.explosion_rotate) ---@field explosion_rotate double ---[R] ---The group of mutually fast-replaceable entities. Possibly `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.fast_replaceable_group) ---@field fast_replaceable_group string ---[R] ---The filter count of this inserter, loader, or logistic chest or `nil`. For logistic containers, `nil` means no limit. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.filter_count) ---@field filter_count uint ---[R] ---The final attack result for projectiles `nil` if not a projectile --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.final_attack_result) ---@field final_attack_result TriggerItem[] ---[R] ---The fixed recipe name for this assembling machine prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.fixed_recipe) ---@field fixed_recipe string ---[R] ---The entity prototype flags for this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.flags) ---@field flags EntityPrototypeFlags ---[R] ---The fluid this offshore pump produces or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.fluid) ---@field fluid LuaFluidPrototype ---[R] ---The fluid capacity of this entity or 0 if this entity doesn't support fluids. --- ---**Note:** Crafting machines will report 0 due to their fluid capacity being what ever a given recipe needs. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.fluid_capacity) ---@field fluid_capacity double ---[R] ---The fluid energy source prototype this entity uses or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.fluid_energy_source_prototype) ---@field fluid_energy_source_prototype LuaFluidEnergySourcePrototype ---[R] ---The fluid usage of this generator prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.fluid_usage_per_tick) ---@field fluid_usage_per_tick double ---[R] ---The fluidbox prototypes for this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.fluidbox_prototypes) ---@field fluidbox_prototypes LuaFluidBoxPrototype[] ---[R] ---The flying acceleration for this rocket silo rocket prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.flying_acceleration) ---@field flying_acceleration double ---[R] ---The flying speed for this rocket silo rocket prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.flying_speed) ---@field flying_speed double ---[R] ---The friction of this vehicle prototype or `nil` if not a vehicle prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.friction_force) ---@field friction_force double ---[R] ---The friendly map color used when charting this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.friendly_map_color) ---@field friendly_map_color Color ---[R] ---The equipment grid prototype for this entity or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.grid_prototype) ---@field grid_prototype LuaEquipmentGridPrototype ---[R] ---Group of this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.group) ---@field group LuaGroup ---[R] ---The guns this prototype uses or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.guns) ---@field guns table ---[R] ---Whether this unit, car, or character prototype has belt immunity, `nil` if not car, unit, or character prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.has_belt_immunity) ---@field has_belt_immunity boolean ---[R] ---Amount this entity can heal per tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.healing_per_tick) ---@field healing_per_tick float ---[R] ---The heat energy source prototype this entity uses or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.heat_energy_source_prototype) ---@field heat_energy_source_prototype LuaHeatEnergySourcePrototype ---[R] ---Every time this infinite resource 'ticks' down it is reduced by this amount. `nil` when not a resource. Meaningless if this isn't an infinite type resource. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.infinite_depletion_resource_amount) ---@field infinite_depletion_resource_amount uint ---[R] ---Is this resource infinite? Will be `nil` when used on a non-resource. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.infinite_resource) ---@field infinite_resource boolean ---[R] ---The max number of ingredients this crafting-machine prototype supports or `nil` if this isn't a crafting-machine prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.ingredient_count) ---@field ingredient_count uint ---[R] ---True if this inserter chases items on belts for pickup or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.inserter_chases_belt_items) ---@field inserter_chases_belt_items boolean ---[R] ---The drop position for this inserter or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.inserter_drop_position) ---@field inserter_drop_position Vector ---[R] ---The extension speed of this inserter or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.inserter_extension_speed) ---@field inserter_extension_speed double ---[R] ---The pickup position for this inserter or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.inserter_pickup_position) ---@field inserter_pickup_position Vector ---[R] ---The rotation speed of this inserter or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.inserter_rotation_speed) ---@field inserter_rotation_speed double ---[R] ---The instruments for this programmable speaker or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.instruments) ---@field instruments ProgrammableSpeakerInstrument[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.is_building) ---@field is_building boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.item_pickup_distance) --- ---_Can only be used if this is Character_ ---@field item_pickup_distance double ---[R] ---The item slot count of this constant combinator prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.item_slot_count) ---@field item_slot_count uint ---[R] ---Items that, when placed, will produce this entity. It is an array of items, or `nil` if no items place this entity. Construction bots will always choose the first item in this list to build this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.items_to_place_this) ---@field items_to_place_this SimpleItemStack[] ---[R] ---The item prototype names that are the inputs of this lab prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.lab_inputs) ---@field lab_inputs string[] ---[R] ---The rocket launch delay for this rocket silo prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.launch_wait_time) ---@field launch_wait_time uint8 ---[R] ---The light blinking speed for this rocket silo prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.light_blinking_speed) ---@field light_blinking_speed double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---The logistic mode of this logistic container or `nil` if this isn't a logistic container prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.logistic_mode) ---@field logistic_mode string ---[R] ---The logistic radius for this roboport prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.logistic_radius) ---@field logistic_radius double ---[R] ---Loot that will be dropped when this entity is killed. `nil` if there is no loot. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.loot) ---@field loot Loot[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.loot_pickup_distance) --- ---_Can only be used if this is Character_ ---@field loot_pickup_distance double ---[R] ---The map color used when charting this entity if a friendly or enemy color isn't defined or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.map_color) ---@field map_color Color ---[R] ---The bounding box used for map generator collision checking. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.map_generator_bounding_box) ---@field map_generator_bounding_box BoundingBox> ---[R] ---The maximum circuit wire distance for this entity. 0 when the entity doesn't support circuit wires. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_circuit_wire_distance) ---@field max_circuit_wire_distance double ---[R] ---Count of enemies this spawner can sustain. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_count_of_owned_units) ---@field max_count_of_owned_units double ---[R] ---The maximum darkness at which this unit spawner can spawn entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_darkness_to_spawn) ---@field max_darkness_to_spawn float ---[R] ---The radius of the area constantly revealed by this radar, in chunks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_distance_of_nearby_sector_revealed) ---@field max_distance_of_nearby_sector_revealed uint ---[R] ---The radius of the area this radar can chart, in chunks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_distance_of_sector_revealed) ---@field max_distance_of_sector_revealed uint ---[R] ---The max energy for this flying robot or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_energy) ---@field max_energy double ---[R] ---The theoretical maximum energy production for this this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_energy_production) ---@field max_energy_production double ---[R] ---The theoretical maximum energy usage for this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_energy_usage) ---@field max_energy_usage double ---[R] ---How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_friends_around_to_spawn) ---@field max_friends_around_to_spawn double ---[R] ---Max health of this entity. Will be `0` if this is not an entity with health. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_health) ---@field max_health float ---[R] ---The max payload size of this logistics or construction robot or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_payload_size) ---@field max_payload_size uint ---[R] ---The maximum polyphony for this programmable speaker or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_polyphony) ---@field max_polyphony uint ---[R] ---The maximum pursue distance of this unit prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_pursue_distance) ---@field max_pursue_distance double ---[R] ---The max speed of this projectile prototype or flying robot prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_speed) ---@field max_speed double ---[R] ---The maximum energy for this flying robot above which it won't try to recharge when stationing or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_to_charge) ---@field max_to_charge float ---[R] ---The max underground distance for underground belts and underground pipes or `nil` if this isn't one of those prototypes. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_underground_distance) ---@field max_underground_distance uint8 ---[R] ---The maximum wire distance for this entity. 0 when the entity doesn't support wires. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_wire_distance) ---@field max_wire_distance double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.maximum_corner_sliding_distance) --- ---_Can only be used if this is Character_ ---@field maximum_corner_sliding_distance double ---[R] ---The maximum fluid temperature of this generator prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.maximum_temperature) ---@field maximum_temperature double ---[R] ---The minimum darkness at which this unit spawner can spawn entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.min_darkness_to_spawn) ---@field min_darkness_to_spawn float ---[R] ---The minimum pursue time of this unit prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.min_pursue_time) ---@field min_pursue_time uint ---[R] ---The minimum energy for this flying robot before it tries to recharge or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.min_to_charge) ---@field min_to_charge float ---[R] ---Whether this entity is minable and what can be obtained by mining it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties) ---@field mineable_properties LuaEntityPrototype.mineable_properties ---[R] ---Minimum amount of this resource. Will be `nil` when used on a non-resource. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.minimum_resource_amount) ---@field minimum_resource_amount uint ---[R] ---The mining radius of this mining drill prototype or `nil` if this isn't a mining drill prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mining_drill_radius) ---@field mining_drill_radius double ---[R] ---The mining speed of this mining drill/character prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mining_speed) ---@field mining_speed double ---[R] ---The module inventory size or `nil` if this entity doesn't support modules. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.module_inventory_size) ---@field module_inventory_size uint ---[R] ---Whether this unit prototype can move while shooting or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.move_while_shooting) ---@field move_while_shooting boolean ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.name) ---@field name string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.neighbour_bonus) --- ---_Can only be used if this is Reactor_ ---@field neighbour_bonus double ---[R] ---Controls how much a reactor extends when connected to other reactors. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.neighbour_collision_increase) --- ---_Can only be used if this is Reactor_ ---@field neighbour_collision_increase double ---[R] ---The next upgrade for this entity or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.next_upgrade) ---@field next_upgrade LuaEntityPrototype ---[R] ---The normal amount for this resource. `nil` when not a resource. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.normal_resource_amount) ---@field normal_resource_amount uint ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.order) ---@field order string ---[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. `nil` when prototype is not a unit prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.pollution_to_join_attack) ---@field pollution_to_join_attack float ---[R] ---The pumping speed of this offshore pump, normal pump, or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.pumping_speed) ---@field pumping_speed double ---[R] ---The radar range of this unit prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.radar_range) ---@field radar_range uint ---[R] ---The radius of this entity prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.radius) ---@field radius double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.reach_distance) --- ---_Can only be used if this is Character_ ---@field reach_distance uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.reach_resource_distance) --- ---_Can only be used if this is Character_ ---@field reach_resource_distance double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.related_underground_belt) --- ---_Can only be used if this is TransportBelt_ ---@field related_underground_belt LuaEntityPrototype ---[R] ---The remains left behind when this entity is mined. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.remains_when_mined) ---@field remains_when_mined LuaEntityPrototype[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.remove_decoratives) ---@field remove_decoratives string ---[R] ---Repair-speed modifier for this entity. Actual repair speed will be `tool_repair_speed * entity_repair_speed_modifier`. May be `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.repair_speed_modifier) ---@field repair_speed_modifier uint ---[R] ---The base researching speed of this lab prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.researching_speed) ---@field researching_speed double ---[R] ---List of resistances towards each damage type. It is a dictionary indexed by damage type names (see `data/base/prototypes/damage-type.lua`). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.resistances) ---@field resistances table ---[R] ---The resource categories this mining drill supports or `nil` if not a mining dill. --- ---**Note:** The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.resource_categories) ---@field resource_categories table ---[R] ---Name of the category of this resource or `nil` when not a resource. --- ---**Note:** During data stage this property is named "category". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.resource_category) ---@field resource_category string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.respawn_time) --- ---_Can only be used if this is Character_ ---@field respawn_time uint ---[R] ---The result units and spawn points with weight and evolution factor for a biter spawner entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.result_units) ---@field result_units UnitSpawnDefinition[] ---[R] ---The rising speed for this rocket silo rocket prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.rising_speed) ---@field rising_speed double ---[R] ---The rocket entity prototype associated with this rocket silo prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.rocket_entity_prototype) ---@field rocket_entity_prototype LuaEntityPrototype ---[R] ---The rocket parts required for this rocket silo prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.rocket_parts_required) ---@field rocket_parts_required uint ---[R] ---The rocket rising delay for this rocket silo prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.rocket_rising_delay) ---@field rocket_rising_delay uint8 ---[R] ---The rotation speed of this car prototype or `nil` if not a car prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.rotation_speed) ---@field rotation_speed double ---[R] ---Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.running_speed) --- ---_Can only be used if this is Character_ ---@field running_speed double ---[R] ---The secondary bounding box used for collision checking, or `nil` if it doesn't have one. This is only used in rails and rail remnants. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.secondary_collision_box) ---@field secondary_collision_box BoundingBox> ---[R] ---Is this entity selectable? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.selectable_in_game) ---@field selectable_in_game boolean ---[R] ---The bounding box used for drawing selection. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.selection_box) ---@field selection_box BoundingBox> ---[R] ---The selection priority of this entity - a value between 0 and 255 --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.selection_priority) ---@field selection_priority uint ---[R] ---The cursor size used when shooting at this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.shooting_cursor_size) ---@field shooting_cursor_size double ---[R] ---The spawning cooldown for this enemy spawner prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.spawn_cooldown) ---@field spawn_cooldown LuaEntityPrototype.spawn_cooldown ---[R] ---How far from the spawner can the units be spawned. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.spawning_radius) ---@field spawning_radius double ---[R] ---What spaces should be between the spawned units. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.spawning_spacing) ---@field spawning_spacing double ---[R] ---The spawning time modifier of this unit prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.spawning_time_modifier) ---@field spawning_time_modifier double ---[R] ---The default speed of this flying robot, rolling stock or unit, `nil` if not one of these. --- ---**Note:** For rolling stocks, this is their `max_speed`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.speed) ---@field speed double ---[R] ---The speed multiplier when this flying robot is out of energy or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.speed_multiplier_when_out_of_energy) ---@field speed_multiplier_when_out_of_energy float ---[R] ---If this inserter is a stack-type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.stack) ---@field stack boolean ---[R] ---The bounding box used to attach sticker type entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.sticker_box) ---@field sticker_box BoundingBox> ---[R] ---Subgroup of this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.subgroup) ---@field subgroup LuaGroup ---[R] ---The supply area of this electric pole, beacon, or `nil` if this is neither. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.supply_area_distance) ---@field supply_area_distance double ---[R] ---If this entity prototype could possibly ever be rotated. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.supports_direction) ---@field supports_direction boolean ---[R] ---If this car prototype uses tank controls to drive or `nil` if this is not a car prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.tank_driving) ---@field tank_driving boolean ---[R] ---The target temperature of this boiler prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.target_temperature) ---@field target_temperature double ---[R] ---The terrain friction modifier for this vehicle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.terrain_friction_modifier) ---@field terrain_friction_modifier float ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.ticks_to_keep_aiming_direction) --- ---_Can only be used if this is Character_ ---@field ticks_to_keep_aiming_direction uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.ticks_to_keep_gun) --- ---_Can only be used if this is Character_ ---@field ticks_to_keep_gun uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.ticks_to_stay_in_combat) --- ---_Can only be used if this is Character_ ---@field ticks_to_stay_in_combat uint ---[R] ---The time to live for this prototype or `0` if prototype doesn't have time_to_live or time_before_removed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.time_to_live) ---@field time_to_live uint ---[R] ---The time it takes this land mine to arm. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.timeout) ---@field timeout uint ---[R] ---If it is a tree, return the number of colors it supports. `nil` otherwise. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.tree_color_count) ---@field tree_color_count uint8 ---[R] ---The range of this turret or `nil` if this isn't a turret related prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.turret_range) ---@field turret_range uint ---[R] ---The turret rotation speed of this car prototype or `nil` if not a car prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.turret_rotation_speed) ---@field turret_rotation_speed double ---[R] ---Type of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.type) ---@field type string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.valid) ---@field valid boolean ---[R] ---The vision distance of this unit prototype or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.vision_distance) ---@field vision_distance double ---[R] ---The void energy source prototype this entity uses or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.void_energy_source_prototype) ---@field void_energy_source_prototype LuaVoidEnergySourcePrototype ---[R] ---The weight of this vehicle prototype or `nil` if not a vehicle prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.weight) ---@field weight double local LuaEntityPrototype={ ---Gets the base size of the given inventory on this entity or `nil` if the given inventory doesn't exist. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.get_inventory_size) ---@param index defines.inventory ---@return uint get_inventory_size=function(index)end, ---Does this prototype have a flag enabled? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.has_flag) ---@param flag string@The flag to check. Must be one of ---@return boolean has_flag=function(flag)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.help) ---@return string help=function()end, } ---An item in a [LuaEquipmentGrid](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html), for example one's power armor. --- ---**Note:** An equipment reference becomes invalid once the equipment is removed or the equipment grid it resides in is destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html) ---@class LuaEquipment ---[R] ---The burner energy source for this equipment or `nil` if there isn't one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.burner) ---@field burner LuaBurner ---[RW] ---Current available energy. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.energy) ---@field energy double ---[R] ---Energy generated per tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.generator_power) ---@field generator_power double ---[R] ---Maximum amount of energy that can be stored in this equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.max_energy) ---@field max_energy double ---[R] ---Maximum shield value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.max_shield) ---@field max_shield double ---[R] ---Maximum solar power generated. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.max_solar_power) ---@field max_solar_power double ---[R] ---Movement speed bonus. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.movement_bonus) ---@field movement_bonus double ---[R] ---Name of this equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.object_name) ---@field object_name string ---[R] ---Position of this equipment in the equipment grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.position) ---@field position Position ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.prototype) ---@field prototype LuaEquipmentPrototype ---[R] ---Shape of this equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.shape) ---@field shape LuaEquipment.shape ---[RW] ---Current shield value of the equipment. --- ---**Note:** Can't be set higher than [LuaEquipment::max_shield](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.max_shield). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.shield) ---@field shield double ---[R] ---Type of this equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.type) ---@field type string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.valid) ---@field valid boolean local LuaEquipment={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.help) ---@return string help=function()end, } ---Prototype of a equipment category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentCategoryPrototype.html) ---@class LuaEquipmentCategoryPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentCategoryPrototype.html#LuaEquipmentCategoryPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentCategoryPrototype.html#LuaEquipmentCategoryPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentCategoryPrototype.html#LuaEquipmentCategoryPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentCategoryPrototype.html#LuaEquipmentCategoryPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentCategoryPrototype.html#LuaEquipmentCategoryPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentCategoryPrototype.html#LuaEquipmentCategoryPrototype.valid) ---@field valid boolean local LuaEquipmentCategoryPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentCategoryPrototype.html#LuaEquipmentCategoryPrototype.help) ---@return string help=function()end, } ---An equipment grid is for example the inside of a power armor. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html) ---@class LuaEquipmentGrid ---[R] ---The total energy stored in all batteries in the equipment grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.available_in_batteries) ---@field available_in_batteries double ---[R] ---Total energy storage capacity of all batteries in the equipment grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.battery_capacity) ---@field battery_capacity double ---[R] ---All the equipment in this grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.equipment) ---@field equipment LuaEquipment[] ---[R] ---Total energy per tick generated by the equipment inside this grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.generator_energy) ---@field generator_energy double ---[R] ---Height of the equipment grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.height) ---@field height uint ---[RW] ---True if this movement bonus equipment is turned off, otherwise false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.inhibit_movement_bonus) ---@field inhibit_movement_bonus boolean ---[R] ---The maximum amount of shields this equipment grid has. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.max_shield) ---@field max_shield float ---[R] ---Maximum energy per tick that can be created by any solar panels in the equipment grid. Actual generated energy varies depending on the daylight levels. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.max_solar_energy) ---@field max_solar_energy double ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.object_name) ---@field object_name string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.prototype) ---@field prototype LuaEquipmentGridPrototype ---[R] ---The amount of shields this equipment grid has. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.shield) ---@field shield float ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.valid) ---@field valid boolean ---[R] ---Width of the equipment grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.width) ---@field width uint local LuaEquipmentGrid={ ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.can_move) ---@class LuaEquipmentGrid.can_move_param ---The equipment to move --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.can_move) ---@field equipment LuaEquipment ---Where to put it --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.can_move) ---@field position Position ---Check whether moving an equipment would succeed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.can_move) ---@param param LuaEquipmentGrid.can_move_param ---@return boolean can_move=function(param)end, ---Clear all equipment from the grid, removing it without actually returning it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.clear) ---@param by_player?PlayerIdentification@If provided, the action is done 'as' this player and [on_player_removed_equipment](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) is triggered. clear=function(by_player)end, ---Find equipment in the Equipment Grid based off a position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.get) ---@param position Position@The position ---@return LuaEquipment@The found equipment, or `nil` if equipment could not be found at the given position. get=function(position)end, ---Get counts of all equipment in this grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.get_contents) ---@return table@The counts, indexed by equipment names. get_contents=function()end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.help) ---@return string help=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.move) ---@class LuaEquipmentGrid.move_param ---The equipment to move --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.move) ---@field equipment LuaEquipment ---Where to put it --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.move) ---@field position Position ---Move an equipment within this grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.move) ---@param param LuaEquipmentGrid.move_param ---@return boolean@`true` if the equipment was successfully moved. move=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.put) ---@class LuaEquipmentGrid.put_param ---Equipment prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.put) ---@field name string ---Grid position to put the equipment in. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.put) ---@field position Position|nil ---If provided the action is done 'as' this player and [on_player_placed_equipment](https://lua-api.factorio.com/latest/events.html#on_player_placed_equipment) is triggered. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.put) ---@field by_player PlayerIdentification|nil ---Insert an equipment into the grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.put) ---@param param LuaEquipmentGrid.put_param ---@return LuaEquipment@The newly-added equipment, or `nil` if the equipment could not be added. put=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.take) ---@class LuaEquipmentGrid.take_param ---Take the equipment that contains this position in the grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.take) ---@field position Position|nil ---Take this exact equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.take) ---@field equipment LuaEquipment|nil ---If provided the action is done 'as' this player and [on_player_removed_equipment](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) is triggered. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.take) ---@field by_player PlayerIdentification|nil ---Remove an equipment from the grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.take) ---@param param LuaEquipmentGrid.take_param ---@return SimpleItemStack@The removed equipment, or `nil` if no equipment was removed. take=function(param)end, ---Remove all equipment from the grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.take_all) ---@param by_player?PlayerIdentification@If provided, the action is done 'as' this player and [on_player_removed_equipment](https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment) is triggered. ---@return table@Count of each removed equipment, indexed by their prototype names. take_all=function(by_player)end, } ---Prototype of an equipment grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html) ---@class LuaEquipmentGridPrototype ---[R] ---Equipment category names for the categories that may be inserted into this equipment grid. The grid will accept any equipment that has at least one category in this list. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.equipment_categories) --- ---### See also ---- [LuaEquipmentPrototype::equipment_categories](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.equipment_categories) ---@field equipment_categories string[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.height) ---@field height uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---If the player can move equipment into or out of this grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.locked) ---@field locked boolean ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.valid) ---@field valid boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.width) ---@field width uint local LuaEquipmentGridPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.help) ---@return string help=function()end, } ---Prototype of a modular equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html) ---@class LuaEquipmentPrototype ---[R] ---The equipment attack parameters or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.attack_parameters) ---@field attack_parameters AttackParameters ---[R] ---Is this active defense equipment automatic. Returns false if not active defense equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.automatic) ---@field automatic boolean ---[R] ---The background color of this equipment prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.background_color) ---@field background_color Color ---[R] ---The burner energy source prototype this equipment uses or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.burner_prototype) ---@field burner_prototype LuaBurnerPrototype ---[R] ---The electric energy source prototype this equipment uses or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.electric_energy_source_prototype) ---@field electric_energy_source_prototype LuaElectricEnergySourcePrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.energy_consumption) ---@field energy_consumption double ---[R] ---The energy per shield point restored. 0 for non-shield equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.energy_per_shield) ---@field energy_per_shield double ---[R] ---The max power generated by this equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.energy_production) ---@field energy_production double ---[R] ---The energy source prototype for the equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.energy_source) ---@field energy_source LuaElectricEnergySourcePrototype ---[R] ---Category names for this equipment. These categories will be used to determine whether this equipment is allowed in a particular equipment grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.equipment_categories) --- ---### See also ---- [LuaEquipmentGridPrototype::equipment_categories](https://lua-api.factorio.com/latest/LuaEquipmentGridPrototype.html#LuaEquipmentGridPrototype.equipment_categories) ---@field equipment_categories string[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---The logistic parameters for this roboport equipment. --- ---**Note:** Both the `charging_station_shift` and `stationing_offset` vectors are tables with `x` and `y` keys instead of an array. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field logistic_parameters LuaEquipmentPrototype.logistic_parameters ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.movement_bonus) --- ---_Can only be used if this is MovementBonusEquipmentPrototype_ ---@field movement_bonus float ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.order) ---@field order string ---[R] ---Shape of this equipment prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.shape) ---@field shape LuaEquipmentPrototype.shape ---[R] ---The shield value of this equipment. 0 for non-shield equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.shield) ---@field shield float ---[R] ---The result item when taking this equipment out of an equipment grid. `nil` if there is no result item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.take_result) ---@field take_result LuaItemPrototype ---[R] ---Type of this equipment prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.type) ---@field type string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.valid) ---@field valid boolean local LuaEquipmentPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.help) ---@return string help=function()end, } ---Encapsulates statistic data for different parts of the game. In the context of flow statistics, `input` and `output` describe on which side of the associated GUI the values are shown. Input values are shown on the left side, output values on the right side. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html) ---@class LuaFlowStatistics ---[R] ---The force these statistics belong to or `nil` for pollution statistics. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.force) ---@field force LuaForce ---[R] ---List of input counts indexed by prototype name. Represents the data that is shown on the left side of the GUI for the given statistics. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.input_counts) ---@field input_counts table ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.object_name) ---@field object_name string ---[R] ---List of output counts indexed by prototype name. Represents the data that is shown on the right side of the GUI for the given statistics. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.output_counts) ---@field output_counts table ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.valid) ---@field valid boolean local LuaFlowStatistics={ ---Reset all the statistics data to 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.clear) clear=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.get_flow_count) ---@class LuaFlowStatistics.get_flow_count_param ---The prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.get_flow_count) ---@field name string ---Read the input values or the output values --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.get_flow_count) ---@field input boolean ---The precision to read. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.get_flow_count) ---@field precision_index defines.flow_precision_index ---If true, the count is returned instead of the per-time-frame value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.get_flow_count) ---@field count boolean|nil ---Gets the flow count value for the given time frame. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.get_flow_count) ---@param param LuaFlowStatistics.get_flow_count_param ---@return double get_flow_count=function(param)end, ---Gets the total input count for a given prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.get_input_count) ---@param name string@The prototype name. ---@return uint64|double get_input_count=function(name)end, ---Gets the total output count for a given prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.get_output_count) ---@param name string@The prototype name. ---@return uint64|double get_output_count=function(name)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.help) ---@return string help=function()end, ---Adds a value to this flow statistics. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.on_flow) ---@param name string@The prototype name. ---@param count float@The count: positive or negative determines if the value goes in the input or output statistics. on_flow=function(name,count)end, ---Sets the total input count for a given prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.set_input_count) ---@param name string@The prototype name. ---@param count uint64|double@The new count. The type depends on the instance of the statistics. set_input_count=function(name,count)end, ---Sets the total output count for a given prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.set_output_count) ---@param name string@The prototype name. ---@param count uint64|double@The new count. The type depends on the instance of the statistics. set_output_count=function(name,count)end, } ---An array of fluid boxes of an entity. Entities may contain more than one fluid box, and some can change the number of fluid boxes -- for instance, an assembling machine will change its number of fluid boxes depending on its active recipe. ---See [Fluid](https://lua-api.factorio.com/latest/Concepts.html#Fluid) ---Do note that reading from a [LuaFluidBox](https://lua-api.factorio.com/latest/LuaFluidBox.html) creates a new table and writing will copy the given fields from the table into the engine's own fluid box structure. Therefore, the correct way to update a fluidbox of an entity is to read it first, modify the table, then write the modified table back. Directly accessing the returned table's attributes won't have the desired effect. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html) --- ---### Example ---Double the temperature of the fluid in `entity`'s first fluid box. ---``` ---fluid = entity.fluidbox[1] ---fluid.temperature = fluid.temperature * 2 ---entity.fluidbox[1] = fluid ---``` ---@class LuaFluidBox ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.object_name) ---@field object_name string ---[R] ---The entity that owns this fluidbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.owner) ---@field owner LuaEntity ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.valid) ---@field valid boolean ---[R] ---Access, set or clear a fluid box. The index must always be in bounds (see [LuaFluidBox::operator #](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.operator #)). New fluidboxes may not be added or removed using this operator. If the given fluid box doesn't contain any fluid, `nil` is returned. Similarly, `nil` can be written to a fluid box to remove all fluid from it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.operator%20[]) ---@field __index Fluid ---[R] ---Number of fluid boxes. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.operator%20#) ---@field __len uint local LuaFluidBox={ ---Flushes all fluid from this fluidbox and its fluid system. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.flush) ---@param index uint ---@param fluid?FluidIdentification@If provided, only this fluid is flushed. ---@return table@The fluid removed. flush=function(index,fluid)end, ---The capacity of the given fluidbox index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_capacity) ---@param index uint ---@return double get_capacity=function(index)end, ---The fluidbox connections for the given fluidbox index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_connections) ---@param index uint ---@return LuaFluidBox[] get_connections=function(index)end, ---Get a fluid box filter --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_filter) ---@param index uint@The index of the filter to get. ---@return FluidBoxFilter@The filter at the requested index. `nil` if there isn't one. get_filter=function(index)end, ---Flow through the fluidbox in the last tick. It is the larger of in-flow and out-flow. --- ---**Note:** Fluid wagons do not track it and will return 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_flow) ---@param index uint ---@return double get_flow=function(index)end, ---Returns the fluid the fluidbox is locked onto Returns 'nil' for no lock --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_locked_fluid) ---@param index uint ---@return string get_locked_fluid=function(index)end, ---The prototype of this fluidbox index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_prototype) ---@param index uint ---@return LuaFluidBoxPrototype get_prototype=function(index)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.help) ---@return string help=function()end, ---Set a fluid box filter. --- ---**Note:** Some entities cannot have their fluidbox filter set, notably fluid wagons and crafting machines. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.set_filter) ---@param index uint@The index of the filter to set. ---@param filter?FluidBoxFilterSpec@The filter to set. Setting `nil` clears the filter. ---@return boolean@Whether the filter was set successfully. set_filter=function(index,filter)end, } ---A prototype of a fluidbox owned by some [LuaEntityPrototype](https://lua-api.factorio.com/latest/LuaEntityPrototype.html). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html) ---@class LuaFluidBoxPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.base_area) ---@field base_area double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.base_level) ---@field base_level double ---[R] ---The entity that this belongs to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.entity) ---@field entity LuaEntityPrototype ---[R] ---The filter or `nil` if no filter is set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.filter) ---@field filter LuaFluidPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.height) ---@field height double ---[R] ---The index of this fluidbox prototype in the owning entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.index) ---@field index uint ---[R] ---The maximum temperature or `nil` if none is set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.maximum_temperature) ---@field maximum_temperature double ---[R] ---The minimum temperature or `nil` if none is set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.minimum_temperature) ---@field minimum_temperature double ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.object_name) ---@field object_name string ---[R] ---The pipe connection points. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.pipe_connections) ---@field pipe_connections FluidBoxConnection[] ---[R] ---The production type. "input", "output", "input-output", or "none". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.production_type) ---@field production_type string ---[R] ---The render layer. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.render_layer) ---@field render_layer string ---[R] ---The secondary draw orders for the 4 possible connection directions. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.secondary_draw_orders) ---@field secondary_draw_orders int[] ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.valid) ---@field valid boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.volume) ---@field volume double local LuaFluidBoxPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidBoxPrototype.html#LuaFluidBoxPrototype.help) ---@return string help=function()end, } ---Prototype of a fluid energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html) ---@class LuaFluidEnergySourcePrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.burns_fluid) ---@field burns_fluid boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.effectivity) ---@field effectivity double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.emissions) ---@field emissions double ---[R] ---The fluid box for this energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.fluid_box) ---@field fluid_box LuaFluidBoxPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.fluid_usage_per_tick) ---@field fluid_usage_per_tick double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.maximum_temperature) ---@field maximum_temperature double ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.object_name) ---@field object_name string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.render_no_network_icon) ---@field render_no_network_icon boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.render_no_power_icon) ---@field render_no_power_icon boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.scale_fluid_usage) ---@field scale_fluid_usage boolean ---[R] ---The smoke sources for this prototype if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.smoke) ---@field smoke SmokeSource[] ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.valid) ---@field valid boolean local LuaFluidEnergySourcePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidEnergySourcePrototype.html#LuaFluidEnergySourcePrototype.help) ---@return string help=function()end, } ---Prototype of a fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html) ---@class LuaFluidPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.base_color) ---@field base_color Color ---[R] ---Default temperature of the fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.default_temperature) ---@field default_temperature double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.emissions_multiplier) ---@field emissions_multiplier double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.flow_color) ---@field flow_color Color ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.fuel_value) ---@field fuel_value double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.gas_temperature) ---@field gas_temperature double ---[R] ---Group of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.group) ---@field group LuaGroup ---[R] ---How much energy the fluid will generate at max temperature assuming 100% efficiency steam engine. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.heat_capacity) ---@field heat_capacity double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.hidden) ---@field hidden boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Maximum temperature the fluid can reach. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.max_temperature) ---@field max_temperature double ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.object_name) ---@field object_name string ---[R] ---Order string for this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.order) ---@field order string ---[R] ---Subgroup of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.subgroup) ---@field subgroup LuaGroup ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.valid) ---@field valid boolean local LuaFluidPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFluidPrototype.html#LuaFluidPrototype.help) ---@return string help=function()end, } ---Prototype of a font. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html) ---@class LuaFontPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.border) ---@field border boolean ---[R] ---The border color or `nil` if not set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.border_color) ---@field border_color Color ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.filtered) ---@field filtered boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.from) ---@field from string ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.object_name) ---@field object_name string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.size) ---@field size int ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.spacing) ---@field spacing float ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.valid) ---@field valid boolean local LuaFontPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFontPrototype.html#LuaFontPrototype.help) ---@return string help=function()end, } ---`LuaForce` encapsulates data local to each "force" or "faction" of the game. Default forces are player, enemy and neutral. Players and mods can create additional forces (up to 64 total). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html) ---@class LuaForce ---[RW] ---Enables some higher-level AI behaviour for this force. When set to `true`, biters belonging to this force will automatically expand into new territories, build new spawners, and form unit groups. By default, this value is `true` for the enemy force and `false` for all others. --- ---**Note:** Setting this to `false` does not turn off biters' AI. They will still move around and attack players who come close. --- ---**Note:** It is necessary for a force to be AI controllable in order to be able to create unit groups or build bases from scripts. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.ai_controllable) ---@field ai_controllable boolean ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.artillery_range_modifier) ---@field artillery_range_modifier double ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_build_distance_bonus) ---@field character_build_distance_bonus uint ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_health_bonus) ---@field character_health_bonus double ---[RW] ---the number of additional inventory slots the character main inventory has. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_inventory_slots_bonus) ---@field character_inventory_slots_bonus uint ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_item_drop_distance_bonus) ---@field character_item_drop_distance_bonus uint ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_item_pickup_distance_bonus) ---@field character_item_pickup_distance_bonus double ---[RW] ---`true` if character requester logistics is enabled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_logistic_requests) ---@field character_logistic_requests boolean ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_loot_pickup_distance_bonus) ---@field character_loot_pickup_distance_bonus double ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_reach_distance_bonus) ---@field character_reach_distance_bonus uint ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_resource_reach_distance_bonus) ---@field character_resource_reach_distance_bonus double ---[RW] ---Modifies the running speed of all characters in this force by the given value as a percentage. Setting the running modifier to `0.5` makes the character run 50% faster. The minimum value of `-1` reduces the movement speed by 100%, resulting in a speed of `0`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_running_speed_modifier) ---@field character_running_speed_modifier double ---[RW] ---Number of character trash slots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.character_trash_slot_count) ---@field character_trash_slot_count double ---[R] ---The connected players belonging to this force. ---This is primarily useful when you want to do some action against all online players of this force. --- ---**Note:** This does *not* index using player index. See [LuaPlayer::index](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.index) on each player instance for the player index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.connected_players) ---@field connected_players LuaPlayer[] ---[R] ---The current technology in research, or `nil` if no research is currently ongoing. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.current_research) ---@field current_research LuaTechnology ---[RW] ---The time, in ticks, before a deconstruction order is removed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.deconstruction_time_to_live) ---@field deconstruction_time_to_live uint ---[R] ---The entity build statistics for this force (built and mined) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.entity_build_count_statistics) ---@field entity_build_count_statistics LuaFlowStatistics ---[RW] ---Evolution factor of this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.evolution_factor) ---@field evolution_factor double ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.evolution_factor_by_killing_spawners) ---@field evolution_factor_by_killing_spawners double ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.evolution_factor_by_pollution) ---@field evolution_factor_by_pollution double ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.evolution_factor_by_time) ---@field evolution_factor_by_time double ---[R] ---The fluid production statistics for this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.fluid_production_statistics) ---@field fluid_production_statistics LuaFlowStatistics ---[RW] ---Additional lifetime for following robots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.following_robots_lifetime_modifier) ---@field following_robots_lifetime_modifier double ---[RW] ---If friendly fire is enabled for this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.friendly_fire) ---@field friendly_fire boolean ---[RW] ---The time, in ticks, before a placed ghost disappears. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.ghost_time_to_live) ---@field ghost_time_to_live uint ---[R] ---Unique ID associated with this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.index) ---@field index uint ---[RW] ---The inserter stack size bonus for non stack inserters --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.inserter_stack_size_bonus) ---@field inserter_stack_size_bonus double ---[R] ---The item production statistics for this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.item_production_statistics) ---@field item_production_statistics LuaFlowStatistics ---[R] ---All of the items that have been launched in rockets. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.items_launched) ---@field items_launched table ---[R] ---The kill counter statistics for this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.kill_count_statistics) ---@field kill_count_statistics LuaFlowStatistics ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.laboratory_productivity_bonus) ---@field laboratory_productivity_bonus double ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.laboratory_speed_modifier) ---@field laboratory_speed_modifier double ---[R] ---List of logistic networks, grouped by surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.logistic_networks) ---@field logistic_networks table ---[RW] ---Multiplier of the manual crafting speed. Default value is `0`. The actual crafting speed will be multiplied by `1 + manual_crafting_speed_modifier`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.manual_crafting_speed_modifier) --- ---### Example ---Double the player's crafting speed ---``` ---game.player.force.manual_crafting_speed_modifier = 1 ---``` ---@field manual_crafting_speed_modifier double ---[RW] ---Multiplier of the manual mining speed. Default value is `0`. The actual mining speed will be multiplied by `1 + manual_mining_speed_modifier`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.manual_mining_speed_modifier) --- ---### Example ---Double the player's mining speed ---``` ---game.player.force.manual_mining_speed_modifier = 1 ---``` ---@field manual_mining_speed_modifier double ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.max_failed_attempts_per_tick_per_construction_queue) ---@field max_failed_attempts_per_tick_per_construction_queue uint ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.max_successful_attempts_per_tick_per_construction_queue) ---@field max_successful_attempts_per_tick_per_construction_queue uint ---[RW] ---Maximum number of follower robots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.maximum_following_robot_count) ---@field maximum_following_robot_count uint ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.mining_drill_productivity_bonus) ---@field mining_drill_productivity_bonus double ---[R] ---Name of the force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.name) --- ---### Example ---Prints "`player`" ---``` ---game.player.print(game.player.force.name) ---``` ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.object_name) ---@field object_name string ---[R] ---Players belonging to this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.players) ---@field players LuaPlayer[] ---[RW] ---The previous research if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.previous_research) ---@field previous_research LuaTechnology ---[R] ---Recipes available to this force, indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.recipes) --- ---### Example ---Prints the category of the given recipe ---``` ---game.player.print(game.player.force.recipes["transport-belt"].category) ---``` ---@field recipes LuaCustomTable ---[R] ---Whether research is enabled for this force, see [LuaForce::enable_research](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.enable_research) and [LuaForce::disable_research](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.disable_research) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.research_enabled) ---@field research_enabled boolean ---[RW] ---Progress of current research, as a number in range [0, 1]. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.research_progress) ---@field research_progress double ---[RW] ---The research queue of this force. The first technology in the array is the currently active one. Reading this attribute gives an array of [LuaTechnology](https://lua-api.factorio.com/latest/LuaTechnology.html). ---To write to this, the entire table must be written. Providing an empty table or `nil` will empty the research queue and cancel the current research. Writing to this when the research queue is disabled will simply set the last research in the table as the current research. --- ---**Note:** This only allows mods to queue research that this force is able to research in the first place. As an example, an already researched technology or one whose prerequisites are not fulfilled will not be queued, but dropped silently instead. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.research_queue) ---@field research_queue TechnologyIdentification[] ---[RW] ---Whether the research queue is available for this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.research_queue_enabled) ---@field research_queue_enabled boolean ---[RW] ---The number of rockets launched. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.rockets_launched) ---@field rockets_launched uint ---[RW] ---If sharing chart data is enabled for this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.share_chart) ---@field share_chart boolean ---[RW] ---Number of items that can be transferred by stack inserters. When writing to this value, it must be >= 0 and <= 254. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.stack_inserter_capacity_bonus) ---@field stack_inserter_capacity_bonus uint ---[R] ---Technologies owned by this force, indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.technologies) --- ---### Example ---Researches the technology for the player's force ---``` ---game.player.force.technologies["steel-processing"].researched = true ---``` ---@field technologies LuaCustomTable ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.train_braking_force_bonus) ---@field train_braking_force_bonus double ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.valid) ---@field valid boolean ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.worker_robots_battery_modifier) ---@field worker_robots_battery_modifier double ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.worker_robots_speed_modifier) ---@field worker_robots_speed_modifier double ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.worker_robots_storage_bonus) ---@field worker_robots_storage_bonus double ---[RW] ---Ability to create new blueprints using empty blueprint item when using zoom-to-world. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.zoom_to_world_blueprint_enabled) ---@field zoom_to_world_blueprint_enabled boolean ---[RW] ---Ability to use deconstruction planner when using zoom-to-world. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.zoom_to_world_deconstruction_planner_enabled) ---@field zoom_to_world_deconstruction_planner_enabled boolean ---[RW] ---Ability to use zoom-to-world on map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.zoom_to_world_enabled) ---@field zoom_to_world_enabled boolean ---[RW] ---Ability to build ghosts through blueprint or direct ghost placement, or "mine" ghosts when using zoom-to-world. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.zoom_to_world_ghost_building_enabled) ---@field zoom_to_world_ghost_building_enabled boolean ---[RW] ---Ability to use custom selection tools when using zoom-to-world. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.zoom_to_world_selection_tool_enabled) ---@field zoom_to_world_selection_tool_enabled boolean local LuaForce={ ---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. --- ---**Note:** The chunk must be charted for a tag to be valid at that location. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.add_chart_tag) ---@param surface SurfaceIdentification@Which surface to add the tag to. ---@param tag ChartTagSpec@The tag to add. ---@return LuaCustomChartTag add_chart_tag=function(surface,tag)end, ---Add this technology to the back of the research queue if the queue is enabled. Otherwise, set this technology to be researched now. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.add_research) ---@param technology TechnologyIdentification ---@return boolean@If the technology was added. add_research=function(technology)end, ---Cancels pending chart requests for the given surface or all surfaces. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.cancel_charting) ---@param surface?SurfaceIdentification cancel_charting=function(surface)end, ---Stop the research currently in progress. This will remove any dependent technologies from the research queue. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.cancel_current_research) cancel_current_research=function()end, ---Chart a portion of the map. The chart for the given area is refreshed; it creates chart for any parts of the given area that haven't been charted yet. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.chart) --- ---### Example ---Charts a 2048x2048 rectangle centered around the origin. ---``` ---game.player.force.chart(game.player.surface, --- {{x = -1024, y = -1024}, {x = 1024, y = 1024}}) ---``` ---@param surface SurfaceIdentification ---@param area BoundingBox>@The area on the given surface to chart. chart=function(surface,area)end, ---Chart all generated chunks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.chart_all) ---@param surface?SurfaceIdentification@Which surface to chart or all if not given. chart_all=function(surface)end, ---Erases chart data for this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.clear_chart) ---@param surface?SurfaceIdentification@Which surface to erase chart data for or if not provided all surfaces charts are erased. clear_chart=function(surface)end, ---Disable all recipes and technologies. Only recipes and technologies enabled explicitly will be useable from this point. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.disable_all_prototypes) disable_all_prototypes=function()end, ---Disable research for this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.disable_research) disable_research=function()end, ---Enables all recipes and technologies. The opposite of [LuaForce::disable_all_prototypes](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.disable_all_prototypes) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.enable_all_prototypes) enable_all_prototypes=function()end, ---Unlock all recipes. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.enable_all_recipes) enable_all_recipes=function()end, ---Unlock all technologies. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.enable_all_technologies) enable_all_technologies=function()end, ---Enable research for this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.enable_research) enable_research=function()end, ---Finds all custom chart tags within the given bounding box on the given surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.find_chart_tags) ---@param surface SurfaceIdentification ---@param area?BoundingBox> ---@return LuaCustomChartTag[] find_chart_tags=function(surface,area)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.find_logistic_network_by_position) ---@param position Position@Position to find a network for ---@param surface SurfaceIdentification@Surface to search on ---@return LuaLogisticNetwork@The found network or `nil`. find_logistic_network_by_position=function(position,surface)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_ammo_damage_modifier) ---@param ammo string@Ammo category ---@return double get_ammo_damage_modifier=function(ammo)end, ---Will this force attack members of another force? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_cease_fire) ---@param other ForceIdentification ---@return boolean get_cease_fire=function(other)end, ---Count entities of given type. --- ---**Note:** This function has O(1) time complexity as entity counts are kept and maintained in the game engine. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_entity_count) ---@param name string@Prototype name of the entity. ---@return uint@Number of entities of given prototype belonging to this force. get_entity_count=function(name)end, ---Is this force a friend? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_friend) ---@param other ForceIdentification ---@return boolean get_friend=function(other)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_gun_speed_modifier) ---@param ammo string@Ammo category ---@return double get_gun_speed_modifier=function(ammo)end, ---Gets if the given recipe is explicitly disabled from being hand crafted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_hand_crafting_disabled_for_recipe) ---@param recipe string|LuaRecipe ---@return boolean get_hand_crafting_disabled_for_recipe=function(recipe)end, ---Gets the count of a given item launched in rockets. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_item_launched) ---@param item string@The item to get ---@return uint@The count of the item that has been launched. get_item_launched=function(item)end, ---Gets the linked inventory for the given prototype and link ID if it exists or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_linked_inventory) ---@param prototype EntityPrototypeIdentification ---@param link_id uint ---@return LuaInventory get_linked_inventory=function(prototype,link_id)end, ---Gets the saved progress for the given technology or `nil` if there is no saved progress. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_saved_technology_progress) ---@param technology TechnologyIdentification@The technology ---@return double@The progress as a percent. get_saved_technology_progress=function(technology)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_spawn_position) ---@param surface SurfaceIdentification ---@return Position get_spawn_position=function(surface)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_train_stops) ---@class LuaForce.get_train_stops_param ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_train_stops) ---@field name string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_train_stops) ---@field surface SurfaceIdentification|nil ---Gets train stops matching the given filters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_train_stops) ---@param param?LuaForce.get_train_stops_param ---@return LuaEntity[] get_train_stops=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_trains) ---@param surface?SurfaceIdentification@If given only trains on the surface are returned. ---@return LuaTrain[] get_trains=function(surface)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.get_turret_attack_modifier) ---@param turret string@Turret prototype name ---@return double get_turret_attack_modifier=function(turret)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.help) ---@return string help=function()end, ---Has a chunk been charted? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.is_chunk_charted) ---@param surface SurfaceIdentification ---@param position ChunkPosition@Position of the chunk. ---@return boolean is_chunk_charted=function(surface,position)end, ---Is the given chunk currently charted and visible (not covered by fog of war) on the map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.is_chunk_visible) ---@param surface SurfaceIdentification ---@param position ChunkPosition ---@return boolean is_chunk_visible=function(surface,position)end, ---Is pathfinder busy? When the pathfinder is busy, it won't accept any more pathfinding requests. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.is_pathfinder_busy) ---@return boolean is_pathfinder_busy=function()end, ---Kill all units and flush the pathfinder. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.kill_all_units) kill_all_units=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.play_sound) ---@class LuaForce.play_sound_param ---The sound to play. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.play_sound) ---@field path SoundPath ---Where the sound should be played. If not given, it's played at the current position of each player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.play_sound) ---@field position Position|nil ---The volume of the sound to play. Must be between 0 and 1 inclusive. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.play_sound) ---@field volume_modifier double|nil ---The volume mixer to play the sound through. Defaults to the default mixer for the given sound type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.play_sound) ---@field override_sound_type SoundType|nil ---Play a sound for every player in this force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.play_sound) ---@param param LuaForce.play_sound_param play_sound=function(param)end, ---Print text to the chat console of all players on this force. --- ---**Note:** Messages that are identical to a message sent in the last 60 ticks are not printed again. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.print) ---@param message LocalisedString ---@param color?Color print=function(message,color)end, ---Force a rechart of the whole chart. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.rechart) rechart=function()end, ---Research all technologies. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.research_all_technologies) ---@param include_disabled_prototypes?boolean@Whether technologies that are explicitly disabled in the prototype should also be researched. Defaults to `false`. research_all_technologies=function(include_disabled_prototypes)end, ---Reset everything. All technologies are set to not researched, all modifiers are set to default values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.reset) reset=function()end, ---Resets evolution for this force to zero. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.reset_evolution) reset_evolution=function()end, ---Load the original version of all recipes from the prototypes. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.reset_recipes) reset_recipes=function()end, ---Load the original versions of technologies from prototypes. Preserves research state of technologies. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.reset_technologies) reset_technologies=function()end, ---Reapplies all possible research effects, including unlocked recipes. Any custom changes are lost. Preserves research state of technologies. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.reset_technology_effects) reset_technology_effects=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_ammo_damage_modifier) ---@param ammo string@Ammo category ---@param modifier double set_ammo_damage_modifier=function(ammo,modifier)end, ---Stop attacking members of a given force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_cease_fire) ---@param other ForceIdentification ---@param cease_fire boolean@When `true`, this force won't attack `other`; otherwise it will. set_cease_fire=function(other,cease_fire)end, ---Friends have unrestricted access to buildings and turrets won't fire at them. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_friend) ---@param other ForceIdentification ---@param friend boolean set_friend=function(other,friend)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_gun_speed_modifier) ---@param ammo string@Ammo category ---@param modifier double set_gun_speed_modifier=function(ammo,modifier)end, ---Sets if the given recipe can be hand-crafted. This is used to explicitly disable hand crafting a recipe - it won't allow hand-crafting otherwise not hand-craftable recipes. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_hand_crafting_disabled_for_recipe) ---@param recipe string|LuaRecipe ---@param hand_crafting_disabled boolean set_hand_crafting_disabled_for_recipe=function(recipe,hand_crafting_disabled)end, ---Sets the count of a given item launched in rockets. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_item_launched) ---@param item string@The item to set ---@param count uint@The count to set set_item_launched=function(item,count)end, ---Sets the saved progress for the given technology. The technology must not be in progress, must not be completed, and the new progress must be < 100%. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_saved_technology_progress) ---@param technology TechnologyIdentification@The technology ---@param progress double@Progress as a percent. Set to `nil` to remove the saved progress. set_saved_technology_progress=function(technology,progress)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_spawn_position) ---@param position Position@The new position on the given surface. ---@param surface SurfaceIdentification@Surface to set the spawn position for. set_spawn_position=function(position,surface)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_turret_attack_modifier) ---@param turret string@Turret prototype name ---@param modifier double set_turret_attack_modifier=function(turret,modifier)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.unchart_chunk) ---@param position ChunkPosition@The chunk position to unchart. ---@param surface SurfaceIdentification@Surface to unchart on. unchart_chunk=function(position,surface)end, } ---Prototype of a fuel category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFuelCategoryPrototype.html) ---@class LuaFuelCategoryPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFuelCategoryPrototype.html#LuaFuelCategoryPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFuelCategoryPrototype.html#LuaFuelCategoryPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFuelCategoryPrototype.html#LuaFuelCategoryPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFuelCategoryPrototype.html#LuaFuelCategoryPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFuelCategoryPrototype.html#LuaFuelCategoryPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFuelCategoryPrototype.html#LuaFuelCategoryPrototype.valid) ---@field valid boolean local LuaFuelCategoryPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaFuelCategoryPrototype.html#LuaFuelCategoryPrototype.help) ---@return string help=function()end, } ---**Global Description:** ---This is the main object, through which most of the API is accessed. It is, however, not available inside handlers registered with [LuaBootstrap::on_load](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_load). --- ---**Class Description:** ---Main toplevel type, provides access to most of the API though its members. An instance of LuaGameScript is available as the global object named `game`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html) ---@class LuaGameScript ---[R] ---A dictionary containing every LuaAchievementPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.achievement_prototypes) ---@field achievement_prototypes LuaCustomTable ---[R] ---The active mods versions. The keys are mod names, the values are the versions. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.active_mods) --- ---### Example ---This will print the names and versions of active mods to player p's console. ---``` ---for name, version in pairs(game.active_mods) do --- p.print(name .. " version " .. version) ---end ---``` ---@field active_mods table ---[R] ---A dictionary containing every LuaAmmoCategoryPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.ammo_category_prototypes) ---@field ammo_category_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaAutoplaceControlPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.autoplace_control_prototypes) ---@field autoplace_control_prototypes LuaCustomTable ---[RW] ---True by default. Can be used to disable autosaving. Make sure to turn it back on soon after. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.autosave_enabled) ---@field autosave_enabled boolean ---[R] ---Array of the names of all the backers that supported the game development early on. These are used as names for labs, locomotives, radars, roboports, and train stops. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.backer_names) ---@field backer_names LuaCustomTable ---[R] ---The players that are currently online. ---This is primarily useful when you want to do some action against all online players. --- ---**Note:** This does *not* index using player index. See [LuaPlayer::index](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.index) on each player instance for the player index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.connected_players) ---@field connected_players LuaPlayer[] ---[R] ---A dictionary containing every LuaCustomInputPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.custom_input_prototypes) ---@field custom_input_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaDamagePrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.damage_prototypes) ---@field damage_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaDecorativePrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.decorative_prototypes) ---@field decorative_prototypes LuaCustomTable ---[R] ---The default map gen settings for this save. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.default_map_gen_settings) ---@field default_map_gen_settings MapGenSettings ---[R] ---Current scenario difficulty. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.difficulty) ---@field difficulty defines.difficulty ---[R] ---The currently active set of difficulty settings. Even though this property is marked as read-only, the members of the dictionary that is returned can be modified mid-game. This is however not recommended as different difficulties can have differing technology and recipe trees, which can cause problems for players. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.difficulty_settings) --- ---### Example ---This will set the technology price multiplier to 12. ---``` ---game.difficulty_settings.technology_price_multiplier = 12 ---``` ---@field difficulty_settings DifficultySettings ---[RW] ---True by default. Can be used to disable the highlighting of resource patches when they are hovered on the map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.draw_resource_selection) ---@field draw_resource_selection boolean ---[RW] ---Determines if enemy land mines are completely invisible or not. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.enemy_has_vision_on_land_mines) ---@field enemy_has_vision_on_land_mines boolean ---[R] ---A dictionary containing every LuaEntityPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.entity_prototypes) ---@field entity_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaEquipmentCategoryPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.equipment_category_prototypes) ---@field equipment_category_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaEquipmentGridPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.equipment_grid_prototypes) ---@field equipment_grid_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaEquipmentPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.equipment_prototypes) ---@field equipment_prototypes LuaCustomTable ---[R] ---Is the scenario finished? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.finished) ---@field finished boolean ---[R] ---A dictionary containing every LuaFluidPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.fluid_prototypes) ---@field fluid_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaFontPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.font_prototypes) ---@field font_prototypes LuaCustomTable ---[R] ---Get a table of all the forces that currently exist. This sparse table allows you to find forces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the table. Iterating with `ipairs()` will not work at all. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.forces) ---@field forces LuaCustomTable ---[R] ---A dictionary containing every LuaFuelCategoryPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.fuel_category_prototypes) ---@field fuel_category_prototypes LuaCustomTable ---[R] ---A dictionary containing every ItemGroup indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.item_group_prototypes) ---@field item_group_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaItemPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.item_prototypes) ---@field item_prototypes LuaCustomTable ---[R] ---A dictionary containing every ItemSubgroup indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.item_subgroup_prototypes) ---@field item_subgroup_prototypes LuaCustomTable ---[R] ---A dictionary containing every MapGenPreset indexed by `name`. --- ---**Note:** A MapGenPreset is an exact copy of the prototype table provided from the data stage. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.map_gen_presets) ---@field map_gen_presets LuaCustomTable ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.map_settings) ---@field map_settings MapSettings ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.max_beacon_supply_area_distance) ---@field max_beacon_supply_area_distance double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.max_electric_pole_connection_distance) ---@field max_electric_pole_connection_distance double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.max_electric_pole_supply_area_distance) ---@field max_electric_pole_supply_area_distance float ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.max_force_distraction_chunk_distance) ---@field max_force_distraction_chunk_distance uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.max_force_distraction_distance) ---@field max_force_distraction_distance double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.max_gate_activation_distance) ---@field max_gate_activation_distance double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.max_inserter_reach_distance) ---@field max_inserter_reach_distance double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.max_pipe_to_ground_distance) ---@field max_pipe_to_ground_distance uint8 ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.max_underground_belt_distance) ---@field max_underground_belt_distance uint8 ---[R] ---A dictionary containing every LuaModSettingPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.mod_setting_prototypes) ---@field mod_setting_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaModuleCategoryPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.module_category_prototypes) ---@field module_category_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaNamedNoiseExpression indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.named_noise_expressions) ---@field named_noise_expressions LuaCustomTable ---[R] ---A dictionary containing every LuaNoiseLayerPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.noise_layer_prototypes) ---@field noise_layer_prototypes LuaCustomTable ---[R] ---This object's name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.object_name) ---@field object_name string ---[R] ---A dictionary containing every LuaParticlePrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.particle_prototypes) ---@field particle_prototypes LuaCustomTable ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.permissions) ---@field permissions LuaPermissionGroups ---[R] ---The player typing at the console - `nil` in all other instances. See [LuaGameScript::players](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players) for accessing all players. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.player) ---@field player LuaPlayer ---[R] ---Get a table of all the players that currently exist. This sparse table allows you to find players by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the table. Iterating with `ipairs()` will not work at all. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players) ---@field players LuaCustomTable ---[R] ---The pollution statistics for this map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.pollution_statistics) ---@field pollution_statistics LuaFlowStatistics ---[R] ---A dictionary containing every LuaRecipeCategoryPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.recipe_category_prototypes) ---@field recipe_category_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaRecipePrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.recipe_prototypes) ---@field recipe_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaResourceCategoryPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.resource_category_prototypes) ---@field resource_category_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaShortcutPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.shortcut_prototypes) ---@field shortcut_prototypes LuaCustomTable ---[RW] ---Speed to update the map at. 1.0 is normal speed -- 60 UPS. --- ---**Note:** Minimum value is 0.01. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.speed) ---@field speed float ---[R] ---The styles that [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) can use, indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.styles) ---@field styles LuaCustomTable ---[R] ---Get a table of all the surfaces that currently exist. This sparse table allows you to find surfaces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the table. Iterating with `ipairs()` will not work at all. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.surfaces) ---@field surfaces LuaCustomTable ---[R] ---A dictionary containing every [LuaTechnologyPrototype](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html) indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.technology_prototypes) ---@field technology_prototypes LuaCustomTable ---[R] ---Current map tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.tick) ---@field tick uint ---[RW] ---If the tick has been paused. This means that entity update has been paused. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.tick_paused) ---@field tick_paused boolean ---[R] ---The number of ticks since this game was 'created'. A game is 'created' either by using "new game" or "new game from scenario". --- ---**Note:** This differs over [LuaGameScript::tick](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.tick) in that making a game from a scenario always starts with ticks_played value at 0 even if the scenario has its own level data where the [LuaGameScript::tick](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.tick) is > 0. --- ---**Note:** This value has no relation with [LuaGameScript::tick](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.tick) and can be completely different values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.ticks_played) ---@field ticks_played uint ---[RW] ---The number of ticks to be run while the tick is paused. When [LuaGameScript::tick_paused](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.tick_paused) is true, ticks_to_run behaves the following way: While this is > 0, the entity update is running normally and this value is decremented every tick. When this reaches 0, the game will pause again. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.ticks_to_run) ---@field ticks_to_run uint ---[R] ---A dictionary containing every LuaTilePrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.tile_prototypes) ---@field tile_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaTrivialSmokePrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.trivial_smoke_prototypes) ---@field trivial_smoke_prototypes LuaCustomTable ---[R] ---A dictionary containing every LuaVirtualSignalPrototype indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.virtual_signal_prototypes) ---@field virtual_signal_prototypes LuaCustomTable game={ ---Instruct the game to perform an auto-save. --- ---**Note:** Only the server will save in multiplayer. In single player a standard auto-save is triggered. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.auto_save) ---@param name?string@The autosave name if any. Saves will be named _autosave-*name* when provided. auto_save=function(name)end, ---Bans the given player from this multiplayer game. Does nothing if this is a single player game of if the player running this isn't an admin. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.ban_player) ---@param player PlayerIdentification@The player to ban. ---@param reason?LocalisedString@The reason given if any. ban_player=function(player,reason)end, ---Run internal consistency checks. Allegedly prints any errors it finds. --- ---**Note:** Exists mainly for debugging reasons. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.check_consistency) check_consistency=function()end, ---Goes over all items, entities, tiles, recipes, technologies among other things and logs if the locale is incorrect. --- ---**Note:** Also prints true/false if called from the console. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.check_prototype_translations) check_prototype_translations=function()end, ---Counts how many distinct groups of pipes exist in the world. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.count_pipe_groups) count_pipe_groups=function()end, ---Create a new force. --- ---**Note:** The game currently supports a maximum of 64 forces, including the three built-in forces. This means that a maximum of 61 new forces may be created. --- ---**Note:** Force names must be unique. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_force) ---@param force string@Name of the new force ---@return LuaForce@The force that was just created create_force=function(force)end, ---Creates an inventory that is not owned by any game object. It can be resized later with [LuaInventory::resize](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.resize). --- ---**Note:** Make sure to destroy it when you are done with it with [LuaInventory::destroy](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.destroy). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_inventory) ---@param size uint16@The number of slots the inventory initially has. ---@return LuaInventory create_inventory=function(size)end, ---Creates a [LuaProfiler](https://lua-api.factorio.com/latest/LuaProfiler.html), which is used for measuring script performance. --- ---**Note:** LuaProfiler cannot be serialized. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_profiler) ---@param stopped?boolean@Create the timer stopped ---@return LuaProfiler create_profiler=function(stopped)end, ---Creates a deterministic standalone random generator with the given seed or if a seed is not provided the initial map seed is used. --- ---**Note:** *Make sure* you actually want to use this over math.random(...) as this provides entirely different functionality over math.random(...). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_random_generator) ---@param seed?uint ---@return LuaRandomGenerator create_random_generator=function(seed)end, ---Create a new surface --- ---**Note:** The game currently supports a maximum of 4,294,967,295 surfaces, including the default surface. --- ---**Note:** Surface names must be unique --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_surface) ---@param name string@Name of the new surface ---@param settings?MapGenSettings@Map generation settings ---@return LuaSurface@The surface that was just created create_surface=function(name,settings)end, ---Base64 decodes and inflates the given string. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.decode_string) ---@param string string@The string to decode. ---@return string@The decoded string or `nil` if the decode failed. decode_string=function(string)end, ---Deletes the given surface and all entities on it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.delete_surface) ---@param surface string|LuaSurface@The surface to be deleted. Currently the primary surface (1, 'nauvis') cannot be deleted. delete_surface=function(surface)end, ---Converts the given direction into the string version of the direction. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.direction_to_string) ---@param direction defines.direction direction_to_string=function(direction)end, ---Disables replay saving for the current save file. Once done there's no way to re-enable replay saving for the save file without loading an old save. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.disable_replay) disable_replay=function()end, ---Disables tutorial triggers, that unlock new tutorials and show notices about unlocked tutorials. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.disable_tutorial_triggers) disable_tutorial_triggers=function()end, ---Deflates and base64 encodes the given string. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.encode_string) ---@param string string@The string to encode. ---@return string@The encoded string or `nil` if the encode failed. encode_string=function(string)end, ---Evaluate an expression, substituting variables as provided. For details on the formula, see the relevant page on the [Factorio wiki](https://wiki.factorio.com/Prototype/Technology#unit). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.evaluate_expression) --- ---### Example ---Calculate the number of research units required to unlock mining productivity level 10. ---``` ---local formula = game.forces["player"].technologies["mining-productivity-4"].research_unit_count_formula ---local units = game.evaluate_expression(formula, { L = 10, l = 10 }) ---``` ---@param expression string@The expression to evaluate. ---@param variables?table@Variables to be substituted. ---@return double evaluate_expression=function(expression,variables)end, ---Force a CRC check. Tells all peers to calculate their current map CRC; these CRC are then compared against each other. If a mismatch is detected, the game is desynced and some peers are forced to reconnect. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.force_crc) force_crc=function()end, ---Gets the number of entities that are active (updated each tick). --- ---**Note:** This is very expensive to calculate. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_active_entities_count) ---@param surface?SurfaceIdentification@If give, only the entities active on this surface are counted. ---@return uint get_active_entities_count=function(surface)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_entity_by_tag) ---@param tag string ---@return LuaEntity get_entity_by_tag=function(tag)end, ---Returns a dictionary of all LuaAchievementPrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_achievement_prototypes) --- ---### Example ---Get every achievement prototype that is not allowed to be completed on the peaceful difficulty setting. ---``` ---local prototypes = game.get_filtered_achievement_prototypes{{filter="allowed-without-fight", invert=true}} ---``` ---@param filters AchievementPrototypeFilter[] ---@return LuaCustomTable get_filtered_achievement_prototypes=function(filters)end, ---Returns a dictionary of all LuaDecorativePrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_decorative_prototypes) --- ---### Example ---Get every decorative prototype that is auto-placed. ---``` ---local prototypes = game.get_filtered_decorative_prototypes{{filter="autoplace"}} ---``` ---@param filters DecorativePrototypeFilter[] ---@return LuaCustomTable get_filtered_decorative_prototypes=function(filters)end, ---Returns a dictionary of all LuaEntityPrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_entity_prototypes) --- ---### Example ---Get every entity prototype that can craft recipes involving fluids in the way some assembling machines can. ---``` ---local prototypes = game.get_filtered_entity_prototypes{{filter="crafting-category", crafting_category="crafting-with-fluid"}} ---``` ---@param filters EntityPrototypeFilter[] ---@return LuaCustomTable get_filtered_entity_prototypes=function(filters)end, ---Returns a dictionary of all LuaEquipmentPrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_equipment_prototypes) --- ---### Example ---Get every equipment prototype that functions as a battery. ---``` ---local prototypes = game.get_filtered_equipment_prototypes{{filter="type", type="battery-equipment"}} ---``` ---@param filters EquipmentPrototypeFilter[] ---@return LuaCustomTable get_filtered_equipment_prototypes=function(filters)end, ---Returns a dictionary of all LuaFluidPrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_fluid_prototypes) --- ---### Example ---Get every fluid prototype that has a heat capacity of exactly `100`. ---``` ---local prototypes = game.get_filtered_fluid_prototypes{{filter="heat-capacity", comparison="=", value=100}} ---``` ---@param filters FluidPrototypeFilter[] ---@return LuaCustomTable get_filtered_fluid_prototypes=function(filters)end, ---Returns a dictionary of all LuaItemPrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_item_prototypes) --- ---### Example ---Get every item prototype that, when launched with a rocket, produces a result. ---``` ---local prototypes = game.get_filtered_item_prototypes{{filter="has-rocket-launch-products"}} ---``` ---@param filters ItemPrototypeFilter[] ---@return LuaCustomTable get_filtered_item_prototypes=function(filters)end, ---Returns a dictionary of all LuaModSettingPrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_mod_setting_prototypes) --- ---### Example ---Get every mod setting prototype that belongs to the specified mod. ---``` ---local prototypes = game.get_filtered_mod_setting_prototypes{{filter="mod", mod="space-exploration"}} ---``` ---@param filters ModSettingPrototypeFilter[] ---@return LuaCustomTable get_filtered_mod_setting_prototypes=function(filters)end, ---Returns a dictionary of all LuaRecipePrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_recipe_prototypes) --- ---### Example ---Get every recipe prototype that takes less than half a second to craft (at crafting speed `1`). ---``` ---local prototypes = game.get_filtered_recipe_prototypes{{filter="energy", comparison="<", value=0.5}} ---``` ---@param filters RecipePrototypeFilter[] ---@return LuaCustomTable get_filtered_recipe_prototypes=function(filters)end, ---Returns a dictionary of all LuaTechnologyPrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_technology_prototypes) --- ---### Example ---Get every technology prototype that can be researched at the start of the game. ---``` ---local prototypes = game.get_filtered_technology_prototypes{{filter="has-prerequisites", invert=true}} ---``` ---@param filters TechnologyPrototypeFilter[] ---@return LuaCustomTable get_filtered_technology_prototypes=function(filters)end, ---Returns a dictionary of all LuaTilePrototypes that fit the given filters. The prototypes are indexed by `name`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_filtered_tile_prototypes) --- ---### Example ---Get every tile prototype that improves a player's walking speed by at least 50%. ---``` ---local prototypes = game.get_filtered_tile_prototypes{{filter="walking-speed-modifier", comparison="≥", value=1.5}} ---``` ---@param filters TilePrototypeFilter[] ---@return LuaCustomTable get_filtered_tile_prototypes=function(filters)end, ---Gets the map exchange string for the map generation settings that were used to create this map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_map_exchange_string) ---@return string get_map_exchange_string=function()end, ---Gets the given player or returns `nil` if no player is found. --- ---**Note:** This is a shortcut for game.players[...] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_player) ---@param player uint|string@The player index or name. ---@return LuaPlayer get_player=function(player)end, ---Gets the inventories created through [LuaGameScript::create_inventory](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_inventory) --- ---**Note:** Inventories created through console commands will be owned by `"core"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_script_inventories) ---@param mod?string@The mod who's inventories to get. If not provided all inventories are returned. ---@return table@A mapping of mod name to array of inventories owned by that mod. get_script_inventories=function(mod)end, ---Gets the given surface or returns `nil` if no surface is found. --- ---**Note:** This is a shortcut for game.surfaces[...] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_surface) ---@param surface uint|string@The surface index or name. ---@return LuaSurface get_surface=function(surface)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_train_stops) ---@class LuaGameScript.get_train_stops_param ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_train_stops) ---@field name string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_train_stops) ---@field surface SurfaceIdentification|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_train_stops) ---@field force ForceIdentification|nil ---Gets train stops matching the given filters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_train_stops) ---@param param?LuaGameScript.get_train_stops_param ---@return LuaEntity[] get_train_stops=function(param)end, ---Is this the demo version of Factorio? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.is_demo) ---@return boolean is_demo=function()end, ---Is the map loaded is multiplayer? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.is_multiplayer) ---@return boolean is_multiplayer=function()end, ---Checks if the given SoundPath is valid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.is_valid_sound_path) ---@param sound_path SoundPath@Path to the sound. ---@return boolean is_valid_sound_path=function(sound_path)end, ---Checks if the given SpritePath is valid and contains a loaded sprite. --- ---**Note:** The existence of the image is not checked for paths of type `file`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.is_valid_sprite_path) ---@param sprite_path SpritePath@Path to the image. ---@return boolean is_valid_sprite_path=function(sprite_path)end, ---Convert a JSON string to a table. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.json_to_table) ---@param json string@The string to convert. ---@return AnyBasic@The returned object, or `nil` if the json was invalid. json_to_table=function(json)end, ---Kicks the given player from this multiplayer game. Does nothing if this is a single player game or if the player running this isn't an admin. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.kick_player) ---@param player PlayerIdentification@The player to kick. ---@param reason?LocalisedString@The reason given if any. kick_player=function(player,reason)end, ---Marks two forces to be merge together. All entities in the source force will be reassigned to the target force. The source force will then be destroyed. --- ---**Note:** The three built-in forces -- player, enemy and neutral -- can't be destroyed. I.e. they can't be used as the source argument to this function. --- ---**Note:** The source force is not merged until the end of the current tick or if called during the [on_forces_merging](https://lua-api.factorio.com/latest/events.html#on_forces_merging) event or [on_forces_merged](https://lua-api.factorio.com/latest/events.html#on_forces_merged) event the end of the next tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.merge_forces) ---@param source ForceIdentification@The force to remove ---@param destination ForceIdentification@The force to reassign all entities to merge_forces=function(source,destination)end, ---Mutes the given player. Does nothing if the player running this isn't an admin. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.mute_player) ---@param player PlayerIdentification@The player to mute. mute_player=function(player)end, ---Convert a map exchange string to map gen settings and map settings. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.parse_map_exchange_string) ---@param map_exchange_string string ---@return MapExchangeStringData parse_map_exchange_string=function(map_exchange_string)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.play_sound) ---@class LuaGameScript.play_sound_param ---The sound to play. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.play_sound) ---@field path SoundPath ---Where the sound should be played. If not given, it's played at the current position of each player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.play_sound) ---@field position Position|nil ---The volume of the sound to play. Must be between 0 and 1 inclusive. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.play_sound) ---@field volume_modifier double|nil ---The volume mixer to play the sound through. Defaults to the default mixer for the given sound type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.play_sound) ---@field override_sound_type SoundType|nil ---Play a sound for every player in the game. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.play_sound) ---@param param LuaGameScript.play_sound_param play_sound=function(param)end, ---Print text to the chat console all players. --- ---**Note:** Messages that are identical to a message sent in the last 60 ticks are not printed again. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.print) ---@param message LocalisedString ---@param color?Color print=function(message,color)end, ---Purges the given players messages from the game. Does nothing if the player running this isn't an admin. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.purge_player) ---@param player PlayerIdentification@The player to purge. purge_player=function(player)end, ---Regenerate autoplacement of some entities on all surfaces. This can be used to autoplace newly-added entities. --- ---**Note:** All specified entity prototypes must be autoplacable. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.regenerate_entity) ---@param entities string|string[]@Prototype names of entity or entities to autoplace. regenerate_entity=function(entities)end, ---Forces a reload of all mods. --- ---**Note:** This will act like saving and loading from the mod(s) perspective. --- ---**Note:** This will do nothing if run in multiplayer. --- ---**Note:** This disables the replay if replay is enabled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.reload_mods) reload_mods=function()end, ---Forces a reload of the scenario script from the original scenario location. --- ---**Note:** This disables the replay if replay is enabled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.reload_script) reload_script=function()end, ---Remove players who are currently not connected from the map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.remove_offline_players) ---@param players?LuaPlayer|string[]@List of players to remove. If not specified, remove all offline players. remove_offline_players=function(players)end, ---Remove file or directory. Given path is taken relative to the script output directory. Can be used to remove files created by [LuaGameScript::write_file](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.write_file). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.remove_path) ---@param path string@Path to remove, relative to the script output directory remove_path=function(path)end, ---Resets the amount of time played for this map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.reset_time_played) reset_time_played=function()end, ---Saves the current configuration of Atlas to a file. This will result in huge file containing all of the game graphics moved to as small space as possible. --- ---**Note:** Exists mainly for debugging reasons. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.save_atlas) save_atlas=function()end, ---Instruct the server to save the map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.server_save) ---@param name?string@Save name. If not specified, writes into the currently-running save. server_save=function(name)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.set_game_state) ---@class LuaGameScript.set_game_state_param ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.set_game_state) ---@field game_finished boolean ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.set_game_state) ---@field player_won boolean ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.set_game_state) ---@field next_level string ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.set_game_state) ---@field can_continue boolean ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.set_game_state) ---@field victorious_force ForceIdentification ---Set scenario state. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.set_game_state) ---@param param LuaGameScript.set_game_state_param set_game_state=function(param)end, ---Forces the screenshot saving system to wait until all queued screenshots have been written to disk. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.set_wait_for_screenshots_to_finish) set_wait_for_screenshots_to_finish=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.show_message_dialog) ---@class LuaGameScript.show_message_dialog_param ---What the dialog should say --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.show_message_dialog) ---@field text LocalisedString ---Path to an image to show on the dialog --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.show_message_dialog) ---@field image string|nil ---If specified, dialog will show an arrow pointing to this place. When not specified, the arrow will point to the player's position. (Use `point_to={type="nowhere"}` to remove the arrow entirely.) The dialog itself will be placed near the arrow's target. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.show_message_dialog) ---@field point_to GuiArrowSpecification|nil ---The gui style to use for this speech bubble. Must be of type speech_bubble. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.show_message_dialog) ---@field style string|nil ---Must be of type flow_style. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.show_message_dialog) ---@field wrapper_frame_style string|nil ---Show an in-game message dialog. --- ---**Note:** Can only be used when the map contains exactly one player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.show_message_dialog) ---@param param LuaGameScript.show_message_dialog_param show_message_dialog=function(param)end, ---Convert a table to a JSON string --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.table_to_json) ---@param data table ---@return string table_to_json=function(data)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@class LuaGameScript.take_screenshot_param ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field player PlayerIdentification|nil ---If defined, the screenshot will only be taken for this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field by_player PlayerIdentification|nil ---If defined, the screenshot will be taken on this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field surface SurfaceIdentification|nil ---If defined, the screenshot will be centered on this position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field position Position|nil ---Maximum allowed resolution is 16384x16384 (resp. 8192x8192 when anti_alias is true), but maximum recommended resolution is 4096x4096 (resp. 2048x2048). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field resolution Position|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field zoom double|nil ---Path to save the screenshot in --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field path string|nil ---Include game GUI in the screenshot? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field show_gui boolean|nil ---Include entity info (alt-mode)? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field show_entity_info boolean|nil ---When true, and player is specified, building preview for item in player's cursor will be rendered also. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field show_cursor_building_preview boolean|nil ---Render in double resolution and scale down (including GUI)? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field anti_alias boolean|nil ---The render quality if using jpg format (0-100 inclusive). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field quality int|nil ---If true, the screenshot will be saved even during replay playback, otherwise this function call does nothing in replays. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field allow_in_replay boolean|nil ---Overrides current surface daytime for duration of screenshot rendering. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field daytime double|nil ---Overrides tick of water animation (if animated water is enabled). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field water_tick uint|nil ---Screenshot requests are processed in between update and render. The game may skip rendering (drop frames) if previous frame has not finished rendering or the game simulation starts to fall under 60 updates per second. If force_render is set to true, the game won't drop frames and process the screenshot request at the end of the update in which the request was created. This is not honored on multiplayer clients that are catching up to server. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@field force_render boolean|nil ---Take a screenshot and save it to a file. --- ---**Note:** If Factorio is running headless, this function will do nothing. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot) ---@param param LuaGameScript.take_screenshot_param take_screenshot=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot) ---@class LuaGameScript.take_technology_screenshot_param ---The force to use. If not given the `"player`" force is used. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot) ---@field force ForceIdentification|nil ---Path to save the screenshot in. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot) ---@field path string|nil ---If defined, the screenshot will only be taken for this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot) ---@field by_player PlayerIdentification|nil ---The technology to highlight. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot) ---@field selected_technology TechnologyIdentification|nil ---If `true`, disabled technologies will be skipped. Their successors will be attached to the disabled technology's parents. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot) ---@field skip_disabled boolean|nil ---The render quality if using jpg format (0-100 inclusive). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot) ---@field quality int|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot) ---@param param LuaGameScript.take_technology_screenshot_param take_technology_screenshot=function(param)end, ---Unbans the given player from this multiplayer game. Does nothing if this is a single player game of if the player running this isn't an admin. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.unban_player) ---@param player PlayerIdentification@The player to unban. unban_player=function(player)end, ---Unmutes the given player. Does nothing if the player running this isn't an admin. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.unmute_player) ---@param player PlayerIdentification@The player to unmute. unmute_player=function(player)end, ---Write a string to a file. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.write_file) ---@param filename string@Path to the file to write to. ---@param data LocalisedString@File content ---@param append?boolean@When `true`, this will append to the end of the file. Defaults to `false`, which will overwrite any pre-existing file with the new data. ---@param for_player?uint@If given, the file will only be written for this player_index. 0 means only the server if one exists. write_file=function(filename,data,append,for_player)end, } ---An abstract base class for behaviors that support switching the entity on or off based on some condition. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGenericOnOffControlBehavior.html) ---@class LuaGenericOnOffControlBehavior:LuaControlBehavior ---[RW] ---The circuit condition. --- ---**Note:** `condition` may be `nil` in order to clear the circuit condition. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.circuit_condition) --- ---### Example ---Tell an entity to be active (e.g. a lamp to be lit) when it receives a circuit signal of more than 4 chain signals. ---``` ---a_behavior.circuit_condition = {condition={comparator=">", --- first_signal={type="item", name="rail-chain-signal"}, --- constant=4}} ---``` ---@field circuit_condition CircuitConditionDefinition ---[RW] ---`true` if this should connect to the logistic network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.connect_to_logistic_network) ---@field connect_to_logistic_network boolean ---[R] ---If the entity is currently disabled because of the control behavior. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.disabled) ---@field disabled boolean ---[RW] ---The logistic condition. --- ---**Note:** `condition` may be `nil` in order to clear the logistic condition. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.logistic_condition) --- ---### Example ---Tell an entity to be active (e.g. a lamp to be lit) when the logistics network it's connected to has more than 4 chain signals. ---``` ---a_behavior.logistic_condition = {condition={comparator=">", --- first_signal={type="item", name="rail-chain-signal"}, --- constant=4}} ---``` ---@field logistic_condition CircuitConditionDefinition ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.valid) ---@field valid boolean local LuaGenericOnOffControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGenericOnOffControlBehavior.html#LuaGenericOnOffControlBehavior.help) ---@return string help=function()end, } ---Item group or subgroup. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html) ---@class LuaGroup ---[R] ---The parent group if any; `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.group) ---@field group LuaGroup ---[R] ---Localised name of the group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.localised_name) ---@field localised_name LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.object_name) ---@field object_name string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.order) ---@field order string ---[R] ---The additional order value used in recipe ordering. --- ---**Note:** Can only be used on groups, not on subgroups. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.order_in_recipe) ---@field order_in_recipe string ---[R] ---Subgroups of this group. --- ---**Note:** Can only be used on groups, not on subgroups. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.subgroups) ---@field subgroups LuaGroup[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.type) ---@field type string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.valid) ---@field valid boolean local LuaGroup={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGroup.html#LuaGroup.help) ---@return string help=function()end, } ---The root of the GUI. This type houses the root elements, `top`, `left`, `center`, `goal`, and `screen`, to which other elements can be added to be displayed on screen. --- ---**Note:** Every player can have a different GUI state. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html) ---@class LuaGui ---[R] ---The center part of the GUI. It is a flow element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.center) ---@field center LuaGuiElement ---[R] ---The children GUI elements mapped by name <> element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.children) ---@field children table ---[R] ---The flow used in the objectives window. It is a flow element. The objectives window is only visible when the flow is not empty or the objective text is set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.goal) ---@field goal LuaGuiElement ---[R] ---The left part of the GUI. It is a flow element inside a scroll pane element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.left) ---@field left LuaGuiElement ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.object_name) ---@field object_name string ---[R] ---The player who owns this gui. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.player) ---@field player LuaPlayer ---[R] ---For showing a GUI somewhere relative to one of the game GUIs. It is an empty-widget element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.relative) ---@field relative LuaGuiElement ---[R] ---For showing a GUI somewhere on the entire screen. It is an empty-widget element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen) ---@field screen LuaGuiElement ---[R] ---The top part of the GUI. It is a flow element inside a scroll pane element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.top) ---@field top LuaGuiElement ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.valid) ---@field valid boolean local LuaGui={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.help) ---@return string help=function()end, ---Returns `true` if sprite_path is valid and contains loaded sprite, otherwise `false`. Sprite path of type `file` doesn't validate if file exists. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.is_valid_sprite_path) ---@param sprite_path SpritePath@Path to a image. ---@return boolean is_valid_sprite_path=function(sprite_path)end, } ---An element of a custom GUI. This type is used to represent any kind of a GUI element - labels, buttons and frames are all instances of this type. Just like [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html), different kinds of elements support different attributes; attempting to access an attribute on an element that doesn't support it (for instance, trying to access the `column_count` of a `textfield`) will result in a runtime error. ---The following types of GUI element are supported: ---Each GUI element allows access to its children by having them as attributes. Thus, one can use the `parent.child` syntax to refer to children. Lua also supports the `parent["child"]` syntax to refer to the same element. This can be used in cases where the child has a name that isn't a valid Lua identifier. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html) --- ---### Example ---This will add a label called `greeting` to the top flow. Immediately after, it will change its text to illustrate accessing child elements. ---``` ---game.player.gui.top.add{type="label", name="greeting", caption="Hi"} ---game.player.gui.top.greeting.caption = "Hello there!" ---game.player.gui.top["greeting"].caption = "Actually, never mind, I don't like your face" ---``` --- ---### Example ---This will add a tabbed-pane and 2 tabs with contents. ---``` ---local tabbed_pane = game.player.gui.top.add{type="tabbed-pane"} ---local tab1 = tabbed_pane.add{type="tab", caption="Tab 1"} ---local tab2 = tabbed_pane.add{type="tab", caption="Tab 2"} ---local label1 = tabbed_pane.add{type="label", caption="Label 1"} ---local label2 = tabbed_pane.add{type="label", caption="Label 2"} ---tabbed_pane.add_tab(tab1, label1) ---tabbed_pane.add_tab(tab2, label2) ---``` ---@class LuaGuiElement ---[RW] ---Whether this textfield (when in numeric mode) allows decimal numbers. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.allow_decimal) --- ---_Can only be used if this is textfield_ ---@field allow_decimal boolean ---[RW] ---Whether this textfield (when in numeric mode) allows negative numbers. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.allow_negative) --- ---_Can only be used if this is textfield_ ---@field allow_negative boolean ---[RW] ---Whether the `"none"` state is allowed for this switch. --- ---**Note:** This can't be set to false if the current switch_state is 'none'. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.allow_none_state) --- ---_Can only be used if this is switch_ ---@field allow_none_state boolean ---[RW] ---Sets the anchor for this relative widget. Setting `nil` clears the anchor. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.anchor) ---@field anchor GuiAnchor ---[RW] ---Whether this frame auto-centers on window resize when stored in [LuaGui::screen](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.auto_center) --- ---_Can only be used if this is frame_ ---@field auto_center boolean ---[RW] ---The text to display after the normal tab text (designed to work with numbers) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.badge_text) --- ---_Can only be used if this is tab_ ---@field badge_text LocalisedString ---[RW] ---The text displayed on this element. For frames, this is the "heading". For other elements, like buttons or labels, this is the content. --- ---**Note:** Whilst this attribute may be used on all elements without producing an error, it doesn't make sense for tables and flows as they won't display it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.caption) ---@field caption LocalisedString ---[R] ---The child-elements of this GUI element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.children) ---@field children LuaGuiElement[] ---[R] ---Names of all the children of this element. These are the identifiers that can be used to access the child as an attribute of this element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.children_names) ---@field children_names string[] ---[RW] ---Makes it so right-clicking on this textfield clears and focuses it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clear_and_focus_on_right_click) --- ---_Can only be used if this is textfield or text-box_ ---@field clear_and_focus_on_right_click boolean ---[RW] ---The image to display on this sprite-button when it is clicked. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clicked_sprite) ---@field clicked_sprite SpritePath ---[R] ---The number of columns in this table. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.column_count) --- ---_Can only be used if this is table_ ---@field column_count uint ---[R] ---Direction of this element's layout. May be either `"horizontal"` or `"vertical"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.direction) --- ---_Can only be used if this is frame, flow or line_ ---@field direction string ---[RW] ---The frame drag target for this flow, frame, label, table, or empty-widget. --- ---**Note:** drag_target can only be set to a frame stored directly in [LuaGui::screen](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen) or `nil`. --- ---**Note:** drag_target can only be set on child elements in [LuaGui::screen](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen). --- ---**Note:** drag_target can only be set to a higher level parent element (this element must be owned at some nested level by the drag_target). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.drag_target) ---@field drag_target LuaGuiElement ---[RW] ---Whether this table should draw a horizontal grid line below the first table row. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.draw_horizontal_line_after_headers) --- ---_Can only be used if this is table_ ---@field draw_horizontal_line_after_headers boolean ---[RW] ---Whether this table should draw horizontal grid lines. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.draw_horizontal_lines) --- ---_Can only be used if this is table_ ---@field draw_horizontal_lines boolean ---[RW] ---Whether this table should draw vertical grid lines. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.draw_vertical_lines) --- ---_Can only be used if this is table_ ---@field draw_vertical_lines boolean ---[RW] ---The elem filters of this choose-elem-button or `nil` if there are no filters. --- ---**Note:** Writing to this field does not change or clear the currently selected element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.elem_filters) --- ---### Example ---This will configure a choose-elem-button of type `"entity"` to only show items of type `"furnace"`. ---``` ---button.elem_filters = {{filter = "type", type = "furnace"}} ---``` --- ---### Example ---Then, there are some types of filters that work on a specific kind of attribute. The following will configure a choose-elem-button of type `"entity"` to only show entities that have their `"hidden"` [flags](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) set. ---``` ---button.elem_filters = {{filter = "hidden"}} ---``` --- ---### Example ---Lastly, these filters can be combined at will, taking care to specify how they should be combined (either `"and"` or `"or"`). The following will filter for any `"entities"` that are `"furnaces"` and that are not `"hidden"`. ---``` ---button.elem_filters = {{filter = "type", type = "furnace"}, {filter = "hidden", invert = true, mode = "and"}} ---``` --- ---_Can only be used if this is choose-elem-button_ ---@field elem_filters PrototypeFilter[] ---[R] ---The elem type of this choose-elem-button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.elem_type) --- ---_Can only be used if this is choose-elem-button_ ---@field elem_type string ---[RW] ---The elem value of this choose-elem-button or `nil` if there is no value. --- ---**Note:** The `"signal"` type operates with [SignalID](https://lua-api.factorio.com/latest/Concepts.html#SignalID), while all other types use strings. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.elem_value) --- ---_Can only be used if this is choose-elem-button_ ---@field elem_value string|SignalID ---[RW] ---Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.enabled) ---@field enabled boolean ---[RW] ---The entity associated with this entity-preview, camera, minimap or `nil` if no entity is associated. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.entity) ---@field entity LuaEntity ---[RW] ---The force this minimap is using or `nil` if no force is set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.force) ---@field force string ---[R] ---The GUI this element is a child of. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.gui) ---@field gui LuaGui ---[RW] ---Policy of the horizontal scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.horizontal_scroll_policy) --- ---_Can only be used if this is scroll-pane_ ---@field horizontal_scroll_policy string ---[RW] ---The image to display on this sprite-button when it is hovered. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.hovered_sprite) --- ---_Can only be used if this is sprite-button_ ---@field hovered_sprite SpritePath ---[RW] ---Whether this GUI element is ignored by interaction. This makes clicks on this element 'go through' to the GUI element or even the game surface below it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.ignored_by_interaction) ---@field ignored_by_interaction boolean ---[R] ---The index of this GUI element (unique amongst the GUI elements of a LuaPlayer). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.index) ---@field index uint ---[RW] ---Whether this textfield displays as a password field, which renders all characters as `*`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.is_password) --- ---_Can only be used if this is textfield_ ---@field is_password boolean ---[RW] ---The items in this dropdown or listbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.items) ---@field items LocalisedString[] ---[RW] ---The text shown for the left switch label. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.left_label_caption) --- ---_Can only be used if this is switch_ ---@field left_label_caption LocalisedString ---[RW] ---The tooltip shown on the left switch label. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.left_label_tooltip) --- ---_Can only be used if this is switch_ ---@field left_label_tooltip LocalisedString ---[RW] ---The location of this widget when stored in [LuaGui::screen](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen) or `nil` if not not set or not in [LuaGui::screen](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.location) ---@field location GuiLocation ---[RW] ---Whether this choose-elem-button can be changed by the player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.locked) --- ---_Can only be used if this is choose-elem-button_ ---@field locked boolean ---[RW] ---Whether this textfield loses focus after [defines.events.on_gui_confirmed](https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_confirmed) is fired. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.lose_focus_on_confirm) --- ---_Can only be used if this is textfield_ ---@field lose_focus_on_confirm boolean ---[RW] ---The player index this minimap is using. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.minimap_player_index) --- ---_Can only be used if this is minimap_ ---@field minimap_player_index uint ---[RW] ---The mouse button filters for this button or sprite-button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.mouse_button_filter) ---@field mouse_button_filter MouseButtonFlags ---[RW] ---The name of this element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.name) --- ---### Example ---``` ---game.player.gui.top.greeting.name == "greeting" ---``` ---@field name string ---[RW] ---The number to be shown in the bottom right corner of this sprite-button. Set this to `nil` to show nothing. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.number) ---@field number double ---[RW] ---Whether this textfield is limited to only numberic characters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.numeric) --- ---_Can only be used if this is textfield_ ---@field numeric boolean ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.object_name) ---@field object_name string ---[R] ---The direct parent of this element; `nil` if this is a top-level element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.parent) ---@field parent LuaGuiElement ---[R] ---Index into [LuaGameScript::players](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players) specifying the player who owns this element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.player_index) ---@field player_index uint ---[RW] ---The position this camera or minimap is focused on, if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.position) ---@field position Position ---[RW] ---Whether this text-box is read-only. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.read_only) --- ---_Can only be used if this is text-box_ ---@field read_only boolean ---[RW] ---Whether the image widget should resize according to the sprite in it. Defaults to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.resize_to_sprite) ---@field resize_to_sprite boolean ---[RW] ---The text shown for the right switch label. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.right_label_caption) --- ---_Can only be used if this is switch_ ---@field right_label_caption LocalisedString ---[RW] ---The tooltip shown on the right switch label. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.right_label_tooltip) --- ---_Can only be used if this is switch_ ---@field right_label_tooltip LocalisedString ---[RW] ---Whether the contents of this text-box are selectable. Defaults to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.selectable) --- ---_Can only be used if this is text-box_ ---@field selectable boolean ---[RW] ---The selected index for this dropdown or listbox. Returns `0` if none is selected. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.selected_index) ---@field selected_index uint ---[RW] ---The selected tab index for this tabbed pane or `nil` if no tab is selected. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.selected_tab_index) --- ---_Can only be used if this is tabbed-pane_ ---@field selected_tab_index uint ---[RW] ---Related to the number to be shown in the bottom right corner of this sprite-button. When set to `true`, numbers that are non-zero and smaller than one are shown as a percentage rather than the value. For example, `0.5` will be shown as `50%` instead. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.show_percent_for_small_numbers) ---@field show_percent_for_small_numbers boolean ---[RW] ---The value of this slider element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.slider_value) --- ---_Can only be used if this is slider_ ---@field slider_value double ---[RW] ---The image to display on this sprite-button or sprite in the default state. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.sprite) ---@field sprite SpritePath ---[RW] ---Is this checkbox or radiobutton checked? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.state) --- ---_Can only be used if this is CheckBox or RadioButton_ ---@field state boolean ---[RW] ---The style of this element. When read, this evaluates to a [LuaStyle](https://lua-api.factorio.com/latest/LuaStyle.html). For writing, it only accepts a string that specifies the textual identifier (prototype name) of the desired style. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.style) ---@field style LuaStyle|string ---[RW] ---The surface index this camera or minimap is using. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.surface_index) ---@field surface_index uint ---[RW] ---The switch state (left, none, right) for this switch. --- ---**Note:** If [LuaGuiElement::allow_none_state](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.allow_none_state) is false this can't be set to `"none"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.switch_state) --- ---_Can only be used if this is switch_ ---@field switch_state string ---[R] ---The tabs and contents being shown in this tabbed-pane. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.tabs) ---@field tabs TabAndContent[] ---[RW] ---The tags associated with this LuaGuiElement. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.tags) ---@field tags Tags ---[RW] ---The text contained in this textfield or text-box. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.text) --- ---_Can only be used if this is textfield or text-box_ ---@field text string ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.tooltip) ---@field tooltip LocalisedString ---[R] ---The type of this GUI element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.type) ---@field type string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.valid) ---@field valid boolean ---[RW] ---How much this progress bar is filled. It is a value in the range [0, 1]. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.value) --- ---_Can only be used if this is progressbar_ ---@field value double ---[RW] ---Whether the content of this table should be vertically centered. Overrides [LuaStyle::column_alignments](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.column_alignments). Defaults to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.vertical_centering) --- ---_Can only be used if this is table_ ---@field vertical_centering boolean ---[RW] ---Policy of the vertical scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.vertical_scroll_policy) --- ---_Can only be used if this is scroll-pane_ ---@field vertical_scroll_policy string ---[RW] ---Sets whether this GUI element is visible or completely hidden, taking no space in the layout. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.visible) ---@field visible boolean ---[RW] ---Whether this text-box will word-wrap automatically. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.word_wrap) --- ---_Can only be used if this is text-box_ ---@field word_wrap boolean ---[RW] ---The zoom this camera or minimap is using. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.zoom) ---@field zoom double ---[R] ---The indexing operator. Gets children by name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.operator%20[]) ---@field __index LuaGuiElement local LuaGuiElement={ ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@class LuaGuiElement.add_param ---The kind of element to add. Has to be one of the GUI element types listed at the top of this page. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field type string ---Name of the child element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field name string|nil ---Text displayed on the child element. For frames, this is their title. For other elements, like buttons or labels, this is the content. Whilst this attribute may be used on all elements, it doesn't make sense for tables and flows as they won't display it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field caption LocalisedString|nil ---Tooltip of the child element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field tooltip LocalisedString|nil ---Whether the child element is enabled. Defaults to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field enabled boolean|nil ---Whether the child element is visible. Defaults to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field visible boolean|nil ---Whether the child element is ignored by interaction. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field ignored_by_interaction boolean|nil ---Style of the child element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field style string|nil ---[Tags](https://lua-api.factorio.com/latest/Concepts.html#Tags) associated with the child element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field tags Tags|nil ---Location in its parent that the child element should slot into. By default, the child will be appended onto the end. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field index uint|nil ---Where to position the child element when in the `relative` element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field anchor GuiAnchor|nil ---Applies to **"button"**: (optional) ---Which mouse buttons the button responds to. Defaults to `"left-and-right"`. --- ---Applies to **"sprite-button"**: (optional) ---The mouse buttons that the button responds to. Defaults to `"left-and-right"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field mouse_button_filter MouseButtonFlags|nil ---Applies to **"flow"**: (optional) ---The initial direction of the flow's layout. See [LuaGuiElement::direction](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.direction). Defaults to `"horizontal"`. --- ---Applies to **"frame"**: (optional) ---The initial direction of the frame's layout. See [LuaGuiElement::direction](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.direction). Defaults to `"horizontal"`. --- ---Applies to **"line"**: (optional) ---The initial direction of the line. Defaults to `"horizontal"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field direction string|nil ---Applies to **"table"**: (required) ---Number of columns. This can't be changed after the table is created. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field column_count uint ---Applies to **"table"**: (optional) ---Whether the table should draw vertical grid lines. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field draw_vertical_lines boolean|nil ---Applies to **"table"**: (optional) ---Whether the table should draw horizontal grid lines. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field draw_horizontal_lines boolean|nil ---Applies to **"table"**: (optional) ---Whether the table should draw a single horizontal grid line after the headers. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field draw_horizontal_line_after_headers boolean|nil ---Applies to **"table"**: (optional) ---Whether the content of the table should be vertically centered. Defaults to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field vertical_centering boolean|nil ---Applies to **"textfield"**: (optional) ---The initial text contained in the textfield. --- ---Applies to **"text-box"**: (optional) ---The initial text contained in the text-box. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field text string|nil ---Applies to **"textfield"**: (optional) ---Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field numeric boolean|nil ---Applies to **"textfield"**: (optional) ---Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field allow_decimal boolean|nil ---Applies to **"textfield"**: (optional) ---Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field allow_negative boolean|nil ---Applies to **"textfield"**: (optional) ---Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field is_password boolean|nil ---Applies to **"textfield"**: (optional) ---Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field lose_focus_on_confirm boolean|nil ---Applies to **"textfield"**: (optional) ---Defaults to `false`. --- ---Applies to **"text-box"**: (optional) ---Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field clear_and_focus_on_right_click boolean|nil ---Applies to **"progressbar"**: (optional) ---The initial value of the progressbar, in the range [0, 1]. Defaults to `0`. --- ---Applies to **"slider"**: (optional) ---The initial value for the slider. Defaults to `minimum_value`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field value double|nil ---Applies to **"checkbox"**: (required) ---The initial checked-state of the checkbox. --- ---Applies to **"radiobutton"**: (required) ---The initial checked-state of the radiobutton. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field state boolean ---Applies to **"sprite-button"**: (optional) ---Path to the image to display on the button. --- ---Applies to **"sprite"**: (optional) ---Path to the image to display. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field sprite SpritePath|nil ---Applies to **"sprite-button"**: (optional) ---Path to the image to display on the button when it is hovered. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field hovered_sprite SpritePath|nil ---Applies to **"sprite-button"**: (optional) ---Path to the image to display on the button when it is clicked. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field clicked_sprite SpritePath|nil ---Applies to **"sprite-button"**: (optional) ---The number shown on the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field number double|nil ---Applies to **"sprite-button"**: (optional) ---Formats small numbers as percentages. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field show_percent_for_small_numbers boolean|nil ---Applies to **"sprite"**: (optional) ---Whether the widget should resize according to the sprite in it. Defaults to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field resize_to_sprite boolean|nil ---Applies to **"scroll-pane"**: (optional) ---Policy of the horizontal scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. Defaults to `"auto"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field horizontal_scroll_policy string|nil ---Applies to **"scroll-pane"**: (optional) ---Policy of the vertical scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. Defaults to `"auto"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field vertical_scroll_policy string|nil ---Applies to **"drop-down"**: (optional) ---The initial items in the dropdown. --- ---Applies to **"list-box"**: (optional) ---The initial items in the listbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field items LocalisedString[]|nil ---Applies to **"drop-down"**: (optional) ---The index of the initially selected item. Defaults to 0. --- ---Applies to **"list-box"**: (optional) ---The index of the initially selected item. Defaults to 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field selected_index uint|nil ---Applies to **"camera"**: (required) ---The position the camera centers on. --- ---Applies to **"minimap"**: (optional) ---The position the minimap centers on. Defaults to the player's current position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field position Position ---Applies to **"camera"**: (optional) ---The surface that the camera will render. Defaults to the player's current surface. --- ---Applies to **"minimap"**: (optional) ---The surface the camera will render. Defaults to the player's current surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field surface_index uint|nil ---Applies to **"camera"**: (optional) ---The initial camera zoom. Defaults to `0.75`. --- ---Applies to **"minimap"**: (optional) ---The initial camera zoom. Defaults to `0.75`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field zoom double|nil ---Applies to **"choose-elem-button"**: (required) ---The type of the button - one of the following values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field elem_type string ---Applies to **"choose-elem-button"**: (optional) ---If type is `"item"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field item string|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"tile"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field tile string|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"entity"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field entity string|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"signal"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field signal SignalID|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"fluid"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field fluid string|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"recipe"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field recipe string|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"decorative"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field decorative string|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"item-group"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field item-group string|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"achievement"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field achievement string|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"equipment"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field equipment string|nil ---Applies to **"choose-elem-button"**: (optional) ---If type is `"technology"` - the default value for the button. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field technology string|nil ---Applies to **"choose-elem-button"**: (optional) ---Filters describing what to show in the selection window. See [LuaGuiElement::elem_filters](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.elem_filters). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field elem_filters PrototypeFilter[]|nil ---Applies to **"slider"**: (optional) ---The minimum value for the slider. Defaults to `0`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field minimum_value double|nil ---Applies to **"slider"**: (optional) ---The maximum value for the slider. Defaults to `30`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field maximum_value double|nil ---Applies to **"slider"**: (optional) ---The minimum value the slider can move. Defaults to `1`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field value_step double|nil ---Applies to **"slider"**: (optional) ---Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field discrete_slider boolean|nil ---Applies to **"slider"**: (optional) ---Defaults to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field discrete_values boolean|nil ---Applies to **"minimap"**: (optional) ---The player index the map should use. Defaults to the current player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field chart_player_index uint|nil ---Applies to **"minimap"**: (optional) ---The force this minimap should use. Defaults to the player's current force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field force string|nil ---Applies to **"tab"**: (optional) ---The text to display after the normal tab text (designed to work with numbers). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field badge_text LocalisedString|nil ---Applies to **"switch"**: (optional) ---Possible values are `"left"`, `"right"`, or `"none"`. If set to "none", `allow_none_state` must be `true`. Defaults to `"left"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field switch_state string|nil ---Applies to **"switch"**: (optional) ---Whether the switch can be set to a middle state. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field allow_none_state boolean|nil ---Applies to **"switch"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field left_label_caption LocalisedString|nil ---Applies to **"switch"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field left_label_tooltip LocalisedString|nil ---Applies to **"switch"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field right_label_caption LocalisedString|nil ---Applies to **"switch"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@field right_label_tooltip LocalisedString|nil ---Add a new child element to this GuiElement. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add) ---@param param LuaGuiElement.add_param ---@return LuaGuiElement@The added GUI element. add=function(param)end, ---Inserts a string at the end or at the given index of this dropdown or listbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add_item) ---@param string LocalisedString@The text to insert. ---@param index?uint@The index at which to insert the item. add_item=function(string,index)end, ---Adds the given tab and content widgets to this tabbed pane as a new tab. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add_tab) --- ---_Can only be used if this is tabbed-pane_ ---@param tab LuaGuiElement@The tab to add, must be a GUI element of type "tab". ---@param content LuaGuiElement@The content to show when this tab is selected. Can be any type of GUI element. add_tab=function(tab,content)end, ---Moves this GUI element to the "front" so it will draw over other elements. --- ---**Note:** Only works for elements in [LuaGui::screen](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.bring_to_front) bring_to_front=function()end, ---Remove children of this element. Any [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) objects referring to the destroyed elements become invalid after this operation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clear) --- ---### Example ---``` ---game.player.gui.top.clear() ---``` clear=function()end, ---Removes the items in this dropdown or listbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clear_items) clear_items=function()end, ---Remove this element, along with its children. Any [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) objects referring to the destroyed elements become invalid after this operation. --- ---**Note:** The top-level GUI elements - [LuaGui::top](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.top), [LuaGui::left](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.left), [LuaGui::center](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.center) and [LuaGui::screen](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen) - can't be destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.destroy) --- ---### Example ---``` ---game.player.gui.top.greeting.destroy() ---``` destroy=function()end, ---Focuses this GUI element if possible. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.focus) focus=function()end, ---Forces this frame to re-auto-center. Only works on frames stored directly in [LuaGui::screen](https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.force_auto_center) --- ---_Can only be used if this is frame_ force_auto_center=function()end, ---Gets the index that this element has in its parent element. --- ---**Note:** This iterates through the children of the parent of this element, meaning this has a non-free cost to get, but is faster than doing the equivalent in Lua. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_index_in_parent) ---@return uint get_index_in_parent=function()end, ---Gets the item at the given index from this dropdown or listbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_item) ---@param index uint@The index to get ---@return LocalisedString get_item=function(index)end, ---The mod that owns this Gui element or `nil` if it's owned by the scenario script. --- ---**Note:** This has a not-super-expensive, but non-free cost to get. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_mod) ---@return string get_mod=function()end, ---Returns whether this slider only allows being moved to discrete positions. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_discrete_slider) ---@return boolean get_slider_discrete_slider=function()end, ---Returns whether this slider only allows discrete values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_discrete_values) ---@return boolean get_slider_discrete_values=function()end, ---Gets this sliders maximum value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_maximum) ---@return double get_slider_maximum=function()end, ---Gets this sliders minimum value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_minimum) ---@return double get_slider_minimum=function()end, ---Gets the minimum distance this slider can move. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_value_step) ---@return double get_slider_value_step=function()end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.help) ---@return string help=function()end, ---Removes the item at the given index from this dropdown or listbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.remove_item) ---@param index uint@The index remove_item=function(index)end, ---Removes the given tab and its associated content from this tabbed pane. --- ---**Note:** Removing a tab does not destroy the tab or the tab contents. It just removes them from the view. --- ---**Note:** When removing tabs, [LuaGuiElement::selected_tab_index](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.selected_tab_index) needs to be manually updated. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.remove_tab) --- ---_Can only be used if this is tabbed-pane_ ---@param tab LuaGuiElement@The tab to remove. If not given, it removes all tabs. remove_tab=function(tab)end, ---Scrolls this scroll bar to the bottom. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_bottom) --- ---_Can only be used if this is scroll-pane or text-box_ scroll_to_bottom=function()end, ---Scrolls this scroll bar such that the specified GUI element is visible to the player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_element) --- ---_Can only be used if this is scroll-pane_ ---@param element LuaGuiElement@The element to scroll to. ---@param scroll_mode?string@Where the element should be positioned in the scroll-pane. Must be either `"in-view"` or `"top-third"`. Defaults to `"in-view"`. scroll_to_element=function(element,scroll_mode)end, ---Scrolls the scroll bar such that the specified listbox item is visible to the player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_item) --- ---_Can only be used if this is list-box_ ---@param index int@The item index to scroll to. ---@param scroll_mode?string@Where the item should be positioned in the scroll-pane. Must be either `"in-view"` or `"top-third"`. Defaults to `"in-view"`. scroll_to_item=function(index,scroll_mode)end, ---Scrolls this scroll bar to the left. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_left) --- ---_Can only be used if this is scroll-pane or text-box_ scroll_to_left=function()end, ---Scrolls this scroll bar to the right. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_right) --- ---_Can only be used if this is scroll-pane or text-box_ scroll_to_right=function()end, ---Scrolls this scroll bar to the top. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_top) --- ---_Can only be used if this is scroll-pane or text-box_ scroll_to_top=function()end, ---Selects a range of text in this textbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.select) --- ---### Example ---Select the characters `amp` from `example`: ---``` ---textbox.select(3, 5) ---``` --- ---### Example ---Move the cursor to the start of the text box: ---``` ---textbox.select(1, 0) ---``` --- ---_Can only be used if this is textfield or text-box_ ---@param start int@The index of the first character to select ---@param end_ int@The index of the last character to select select=function(start,end_)end, ---Selects all the text in this textbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.select_all) --- ---_Can only be used if this is textfield or text-box_ select_all=function()end, ---Sets the given string at the given index in this dropdown or listbox. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_item) ---@param index uint@The index whose text to replace. ---@param string LocalisedString@The text to set at the given index. set_item=function(index,string)end, ---Sets whether this slider only allows being moved to discrete positions. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_slider_discrete_slider) ---@param value boolean set_slider_discrete_slider=function(value)end, ---Sets whether this slider only allows discrete values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_slider_discrete_values) ---@param value boolean set_slider_discrete_values=function(value)end, ---Sets this sliders minimum and maximum values. --- ---**Note:** The minimum can't be >= the maximum. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_slider_minimum_maximum) ---@param minimum double ---@param maximum double set_slider_minimum_maximum=function(minimum,maximum)end, ---Sets the minimum distance this slider can move. --- ---**Note:** The minimum distance can't be > (max - min). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_slider_value_step) ---@param value double set_slider_value_step=function(value)end, } ---Prototype of a heat energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html) ---@class LuaHeatEnergySourcePrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.connections) ---@field connections HeatConnection[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.default_temperature) ---@field default_temperature double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.emissions) ---@field emissions double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.max_temperature) ---@field max_temperature double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.max_transfer) ---@field max_transfer double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.min_temperature_gradient) ---@field min_temperature_gradient double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.min_working_temperature) ---@field min_working_temperature double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.minimum_glow_temperature) ---@field minimum_glow_temperature double ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.object_name) ---@field object_name string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.render_no_network_icon) ---@field render_no_network_icon boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.render_no_power_icon) ---@field render_no_power_icon boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.specific_heat) ---@field specific_heat double ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.valid) ---@field valid boolean local LuaHeatEnergySourcePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaHeatEnergySourcePrototype.html#LuaHeatEnergySourcePrototype.help) ---@return string help=function()end, } ---Control behavior for inserters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html) ---@class LuaInserterControlBehavior:LuaGenericOnOffControlBehavior ---[RW] ---The hand read mode for the inserter. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_hand_read_mode) ---@field circuit_hand_read_mode defines.control_behavior.inserter.hand_read_mode ---[RW] ---The circuit mode of operations for the inserter. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_mode_of_operation) ---@field circuit_mode_of_operation defines.control_behavior.inserter.circuit_mode_of_operation ---[RW] ---`true` if the contents of the inserter hand should be sent to the circuit network --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_read_hand_contents) ---@field circuit_read_hand_contents boolean ---[RW] ---If the stack size of the inserter is set through the circuit network or not. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_set_stack_size) ---@field circuit_set_stack_size boolean ---[RW] ---The signal used to set the stack size of the inserter. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html#LuaInserterControlBehavior.circuit_stack_control_signal) ---@field circuit_stack_control_signal SignalID ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html#LuaInserterControlBehavior.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html#LuaInserterControlBehavior.valid) ---@field valid boolean local LuaInserterControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInserterControlBehavior.html#LuaInserterControlBehavior.help) ---@return string help=function()end, } ---A storage of item stacks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html) ---@class LuaInventory ---[R] ---The entity that owns this inventory or `nil` if this isn't owned by an entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.entity_owner) ---@field entity_owner LuaEntity ---[R] ---The equipment that owns this inventory or `nil` if this isn't owned by an equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.equipment_owner) ---@field equipment_owner LuaEquipment ---[R] ---The inventory index this inventory uses, or `nil` if the inventory doesn't have an index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.index) ---@field index defines.inventory ---[R] ---The mod that owns this inventory or `nil` if this isn't owned by a mod. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.mod_owner) ---@field mod_owner string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.object_name) ---@field object_name string ---[R] ---The player that owns this inventory or `nil` if this isn't owned by a player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.player_owner) ---@field player_owner LuaPlayer ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.valid) ---@field valid boolean ---[R] ---The indexing operator. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.operator%20[]) --- ---### Example ---Will get the first item in the player's inventory. ---``` ---game.player.get_main_inventory()[1] ---``` ---@field __index LuaItemStack ---[R] ---Get the number of slots in this inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.operator%20#) --- ---### Example ---Will print the number of slots in the player's main inventory. ---``` ---game.player.print(#game.player.get_main_inventory()) ---``` ---@field __len uint local LuaInventory={ ---Can at least some items be inserted? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.can_insert) ---@param items ItemStackIdentification@Items that would be inserted. ---@return boolean@`true` if at least a part of the given items could be inserted into this inventory. can_insert=function(items)end, ---If the given inventory slot filter can be set to the given filter. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.can_set_filter) ---@param index uint@The item stack index ---@param filter string@The item name of the filter ---@return boolean can_set_filter=function(index,filter)end, ---Make this inventory empty. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.clear) clear=function()end, ---Counts the number of empty stacks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.count_empty_stacks) ---@param include_filtered?boolean@If true, filtered slots will be included. Defaults to false. ---@return uint count_empty_stacks=function(include_filtered)end, ---Destroys this inventory. --- ---**Note:** Only inventories created by [LuaGameScript::create_inventory](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_inventory) can be destroyed this way. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.destroy) destroy=function()end, ---Finds the first empty stack. Filtered slots are excluded unless a filter item is given. --- ---**Note:** This will also return the stack index if one is found that matches as a second return value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.find_empty_stack) ---@param item?string@If given, empty stacks that are filtered for this item will be included. ---@return LuaItemStack@The first empty stack, or `nil` if there aren't any empty stacks. find_empty_stack=function(item)end, ---Gets the first LuaItemStack in the inventory that matches the given item name. --- ---**Note:** This will also return the stack index if one is found that matches as a second return value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.find_item_stack) ---@param item string@The item name to find ---@return LuaItemStack@The first matching stack, or `nil` if none match. find_item_stack=function(item)end, ---Get the current bar. This is the index at which the red area starts. --- ---**Note:** Only useable if this inventory supports having a bar. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_bar) ---@return uint get_bar=function()end, ---Get counts of all items in this inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_contents) ---@return table@The counts, indexed by item names. get_contents=function()end, ---Gets the filter for the given item stack index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_filter) ---@param index uint@The item stack index ---@return string@The current filter or nil if none. get_filter=function(index)end, ---Gets the number of the given item that can be inserted into this inventory. --- ---**Note:** This is a "best guess" number; things like assembling machine filtered slots, module slots, items with durability, and items with mixed health will cause the result to be inaccurate. --- ---**Note:** The main use for this is in checking how many of a basic item can fit into a basic inventory. --- ---**Note:** This accounts for the 'bar' on the inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_insertable_count) ---@param item string@The item to check. get_insertable_count=function(item)end, ---Get the number of all or some items in this inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_item_count) ---@param item?string@Prototype name of the item to count. If not specified, count all items. ---@return uint get_item_count=function(item)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.help) ---@return string help=function()end, ---Insert items into this inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.insert) ---@param items ItemStackIdentification@Items to insert. ---@return uint@Number of items actually inserted. insert=function(items)end, ---Does this inventory contain nothing? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.is_empty) ---@return boolean is_empty=function()end, ---If this inventory supports filters and has at least 1 filter set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.is_filtered) ---@return boolean is_filtered=function()end, ---Remove items from this inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.remove) ---@param items ItemStackIdentification@Items to remove. ---@return uint@Number of items actually removed. remove=function(items)end, ---Resizes the inventory. --- ---**Note:** Items in slots beyond the new capacity are deleted. --- ---**Note:** Only inventories created by [LuaGameScript::create_inventory](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_inventory) can be resized. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.resize) ---@param size uint16@New size of a inventory resize=function(size)end, ---Set the current bar. --- ---**Note:** Only useable if this inventory supports having a bar. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.set_bar) ---@param bar?uint@The new limit. Omitting this parameter will clear the limit. set_bar=function(bar)end, ---Sets the filter for the given item stack index. --- ---**Note:** Some inventory slots don't allow some filters (gun ammo can't be filtered for non-ammo). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.set_filter) ---@param index uint@The item stack index ---@param filter string@The new filter or nil to erase the filter ---@return boolean@If the filter was allowed to be set. set_filter=function(index,filter)end, ---Sorts and merges the items in this inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.sort_and_merge) sort_and_merge=function()end, ---Does this inventory support a bar? Bar is the draggable red thing, found for example on chests, that limits the portion of the inventory that may be manipulated by machines. --- ---**Note:** "Supporting a bar" doesn't mean that the bar is set to some nontrivial value. Supporting a bar means the inventory supports having this limit at all. The character's inventory is an example of an inventory without a bar; the wooden chest's inventory is an example of one with a bar. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.supports_bar) ---@return boolean supports_bar=function()end, ---If this inventory supports filters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.supports_filters) ---@return boolean supports_filters=function()end, } ---Prototype of an item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html) --- ---### Example ---``` ---game.item_prototypes["iron-plate"] ---``` ---@class LuaItemPrototype ---[R] ---The alt entity filter mode used by this selection tool. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.alt_entity_filter_mode) --- ---_Can only be used if this is SelectionTool_ ---@field alt_entity_filter_mode string ---[R] ---The alt entity filters used by this selection tool indexed by entity name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.alt_entity_filters) --- ---_Can only be used if this is SelectionTool_ ---@field alt_entity_filters table ---[R] ---The alt entity type filters used by this selection tool indexed by entity type. --- ---**Note:** The boolean value is meaningless and is used to allow easy lookup if a type exists in the dictionary. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.alt_entity_type_filters) --- ---_Can only be used if this is SelectionTool_ ---@field alt_entity_type_filters table ---[R] ---The color used when doing alt selection with this selection tool prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.alt_selection_border_color) --- ---_Can only be used if this is SelectionTool_ ---@field alt_selection_border_color Color ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.alt_selection_cursor_box_type) --- ---_Can only be used if this is SelectionTool_ ---@field alt_selection_cursor_box_type string ---[R] ---Flags that affect which entities will be selected during alternate selection. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.alt_selection_mode_flags) --- ---_Can only be used if this is SelectionTool_ ---@field alt_selection_mode_flags SelectionModeFlags ---[R] ---The alt tile filter mode used by this selection tool. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.alt_tile_filter_mode) --- ---_Can only be used if this is SelectionTool_ ---@field alt_tile_filter_mode string ---[R] ---The alt tile filters used by this selection tool indexed by tile name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.alt_tile_filters) --- ---_Can only be used if this is SelectionTool_ ---@field alt_tile_filters table ---[R] ---If tiles area always included when doing selection with this selection tool prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.always_include_tiles) --- ---_Can only be used if this is SelectionTool_ ---@field always_include_tiles boolean ---[R] ---The gun attack parameters or `nil` if not a gun item prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.attack_parameters) ---@field attack_parameters AttackParameters ---[R] ---The result of burning this item as fuel or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.burnt_result) ---@field burnt_result LuaItemPrototype ---[R] ---If this item can be mod-opened. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.can_be_mod_opened) ---@field can_be_mod_opened boolean ---[R] ---The capsule action for this capsule item prototype or `nil` if this isn't a capsule item prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.capsule_action) ---@field capsule_action CapsuleAction ---[R] ---The name of a [LuaModuleCategoryPrototype](https://lua-api.factorio.com/latest/LuaModuleCategoryPrototype.html). Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules of the same category with higher tier modules. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.category) --- ---_Can only be used if this is ModuleItem_ ---@field category string ---[R] ---The curved rail prototype used for this rail planner prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.curved_rail) --- ---_Can only be used if this is RailPlanner_ ---@field curved_rail LuaEntityPrototype ---[R] ---The default label color used for this item with label. `nil` if not defined or if this isn't an item with label. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.default_label_color) --- ---_Can only be used if this is ItemWithLabel_ ---@field default_label_color Color ---[R] ---The default request value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.default_request_amount) ---@field default_request_amount uint ---[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. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.draw_label_for_cursor_render) --- ---_Can only be used if this is ItemWithLabel_ ---@field draw_label_for_cursor_render boolean ---[R] ---The durability of this tool item or `nil` if not a tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.durability) --- ---_Can only be used if this is ToolItem_ ---@field durability double ---[R] ---The durability message key used when displaying the durability of this tool. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.durability_description_key) --- ---_Can only be used if this is ToolItem_ ---@field durability_description_key string ---[R] ---The entity filter mode used by this selection tool. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.entity_filter_mode) --- ---_Can only be used if this is SelectionTool_ ---@field entity_filter_mode string ---[R] ---The number of entity filters this deconstruction item has or `nil` if this isn't a deconstruction item prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.entity_filter_slots) --- ---_Can only be used if this is DeconstructionItem_ ---@field entity_filter_slots uint ---[R] ---The entity filters used by this selection tool indexed by entity name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.entity_filters) --- ---_Can only be used if this is SelectionTool_ ---@field entity_filters table ---[R] ---The entity type filters used by this selection tool indexed by entity type. --- ---**Note:** The boolean value is meaningless and is used to allow easy lookup if a type exists in the dictionary. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.entity_type_filters) --- ---_Can only be used if this is SelectionTool_ ---@field entity_type_filters table ---[R] ---The prototype of this armor equipment grid or `nil` if none or this is not an armor item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.equipment_grid) ---@field equipment_grid LuaEquipmentGridPrototype ---[R] ---If this item with inventory extends the inventory it resides in by default. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.extend_inventory_by_default) --- ---_Can only be used if this is ItemWithInventory_ ---@field extend_inventory_by_default boolean ---[R] ---The filter mode used by this item with inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.filter_mode) --- ---_Can only be used if this is ItemWithInventory_ ---@field filter_mode string ---[R] ---The item prototype flags for this item prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.flags) ---@field flags ItemPrototypeFlags ---[R] ---The acceleration multiplier when this item is used as fuel in a vehicle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.fuel_acceleration_multiplier) ---@field fuel_acceleration_multiplier double ---[R] ---The fuel category or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.fuel_category) ---@field fuel_category string ---[R] ---The emissions multiplier if this is used as fuel. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.fuel_emissions_multiplier) ---@field fuel_emissions_multiplier double ---[R] ---The fuel top speed multiplier when this item is used as fuel in a vehicle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.fuel_top_speed_multiplier) ---@field fuel_top_speed_multiplier double ---[R] ---Fuel value when burned. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.fuel_value) ---@field fuel_value float ---[R] ---The group this prototype belongs to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.group) ---@field group LuaGroup ---[R] ---If this tool item has infinite durability. `nil` if not a tool type item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.infinite) --- ---_Can only be used if this is ToolItem_ ---@field infinite boolean ---[R] ---The insertion priority mode used by this item with inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.insertion_priority_mode) --- ---_Can only be used if this is ItemWithInventory_ ---@field insertion_priority_mode string ---[R] ---The main inventory size for item-with-inventory-prototype. `nil` if not an item-with-inventory-prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.inventory_size) --- ---_Can only be used if this is ItemWithInventoryPrototype_ ---@field inventory_size uint ---[R] ---The inventory size bonus for this armor prototype. `nil` if this isn't an armor prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.inventory_size_bonus) --- ---_Can only be used if this is ArmorPrototype_ ---@field inventory_size_bonus uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.item_filters) --- ---_Can only be used if this is ItemWithInventory_ ---@field item_filters table ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.item_group_filters) --- ---_Can only be used if this is ItemWithInventory_ ---@field item_group_filters table ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.item_subgroup_filters) --- ---_Can only be used if this is ItemWithInventory_ ---@field item_subgroup_filters table ---[R] ---The limitation message key used when the player attempts to use this modules in some place it's not allowed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.limitation_message_key) --- ---_Can only be used if this is ModuleItem_ ---@field limitation_message_key string ---[R] ---An array of recipe names this module is allowed to work with. Empty when all recipes are allowed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.limitations) --- ---_Can only be used if this is ModuleItem_ ---@field limitations string[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.localised_description) ---@field localised_description LocalisedString ---[R] ---The localised string used when the player attempts to put items into this item with inventory that aren't allowed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.localised_filter_message) --- ---_Can only be used if this is ItemWithInventory_ ---@field localised_filter_message LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Size of full magazine; `nil` if this is not an ammo item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.magazine_size) ---@field magazine_size float ---[R] ---How many filters an upgrade item has. `nil` if not a upgrade item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.mapper_count) --- ---_Can only be used if this is UpgradeItem_ ---@field mapper_count uint ---[R] ---Effects of this module; `nil` if this is not a module. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.module_effects) --- ---_Can only be used if this is ModuleItem_ ---@field module_effects ModuleEffects ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.object_name) ---@field object_name string ---[R] ---Order string. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.order) ---@field order string ---[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. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.place_as_equipment_result) ---@field place_as_equipment_result LuaEquipmentPrototype ---[R] ---The place as tile result if one is defined else `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.place_as_tile_result) ---@field place_as_tile_result PlaceAsTileResult ---[R] ---Prototype of the entity that will be created by placing this item, or `nil` if there is no such entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.place_result) ---@field place_result LuaEntityPrototype ---[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. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.reload_time) ---@field reload_time float ---[R] ---The repair result of this repair tool prototype or `nil` if this isn't a repair tool prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.repair_result) --- ---_Can only be used if this is RepairTool_ ---@field repair_result TriggerItem[] ---[R] ---Resistances of this armour item, indexed by damage type name. `nil` if not an armor or the armor has no resistances. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.resistances) ---@field resistances table ---[R] ---The results from launching this item in a rocket. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.rocket_launch_products) ---@field rocket_launch_products Product[] ---[R] ---The color used when doing normal selection with this selection tool prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.selection_border_color) --- ---_Can only be used if this is SelectionTool_ ---@field selection_border_color Color ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.selection_cursor_box_type) --- ---_Can only be used if this is SelectionTool_ ---@field selection_cursor_box_type string ---[R] ---Flags that affect which entities will be selected. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.selection_mode_flags) --- ---_Can only be used if this is SelectionTool_ ---@field selection_mode_flags SelectionModeFlags ---[R] ---The repairing speed if this is a repairing tool; otherwise `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.speed) ---@field speed float ---[R] ---Maximum stack size of the item specified by this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.stack_size) ---@field stack_size uint ---[R] ---Is this item allowed to stack at all? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.stackable) ---@field stackable boolean ---[R] ---The straight rail prototype used for this rail planner prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.straight_rail) --- ---_Can only be used if this is RailPlanner_ ---@field straight_rail LuaEntityPrototype ---[R] ---The subgroup this prototype belongs to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.subgroup) ---@field subgroup LuaGroup ---[R] ---Tier of the module inside its category. Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules with higher tier modules if they have the same category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.tier) --- ---_Can only be used if this is ModuleItem_ ---@field tier uint ---[R] ---The tile filter mode used by this selection tool. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.tile_filter_mode) --- ---_Can only be used if this is SelectionTool_ ---@field tile_filter_mode string ---[R] ---The number of tile filters this deconstruction item has or `nil` if this isn't a deconstruction item prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.tile_filter_slots) --- ---_Can only be used if this is DeconstructionItem_ ---@field tile_filter_slots uint ---[R] ---The tile filters used by this selection tool indexed by tile name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.tile_filters) --- ---_Can only be used if this is SelectionTool_ ---@field tile_filters table ---[R] ---Type of this prototype. E.g. `"gun"` or `"mining-tool"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.type) ---@field type string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.valid) ---@field valid boolean ---[R] ---The number of items needed to connect 2 entities with this as wire. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.wire_count) ---@field wire_count uint local LuaItemPrototype={ ---Type of this ammo prototype or `nil` if this is not an ammo prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.get_ammo_type) ---@param ammo_source_type?string@"default", "player", "turret", or "vehicle" ---@return AmmoType get_ammo_type=function(ammo_source_type)end, ---Does this prototype have a flag enabled? ---Any other value will cause an error. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.has_flag) ---@param flag string@The flag to check. Can be one of [ItemPrototypeFlags](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@return boolean has_flag=function(flag)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemPrototype.html#LuaItemPrototype.help) ---@return string help=function()end, } ---A reference to an item and count owned by some external entity. --- ---**Note:** In most instances this is a simple reference as in: it points at a specific slot in an inventory and not the item in the slot. --- ---**Note:** In the instance this references an item on a [LuaTransportLine](https://lua-api.factorio.com/latest/LuaTransportLine.html) the reference is only guaranteed to stay valid (and refer to the same item) as long as nothing changes the transport line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html) ---@class LuaItemStack ---[RW] ---The active blueprint index for this blueprint book. May be `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.active_index) --- ---_Can only be used if this is BlueprintBookItem_ ---@field active_index uint ---[RW] ---If the label for this item can be manually changed. When false the label can only be changed through the API. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.allow_manual_label_change) --- ---_Can only be used if this is ItemWithLabel_ ---@field allow_manual_label_change boolean ---[RW] ---Number of bullets left in the magazine. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.ammo) --- ---_Can only be used if this is AmmoItem_ ---@field ammo uint ---[RW] ---If absolute snapping is enabled on this blueprint item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.blueprint_absolute_snapping) --- ---_Can only be used if this is BlueprintItem_ ---@field blueprint_absolute_snapping boolean ---[RW] ---Icons of a blueprint item, blueprint book, deconstruction item or upgrade planner. An item that doesn't have icons returns nil on read and throws error on write. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.blueprint_icons) --- ---_Can only be used if this is BlueprintItem_ ---@field blueprint_icons BlueprintSignalIcon[] ---[RW] ---The offset from the absolute grid or nil if absolute snapping is not enabled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.blueprint_position_relative_to_grid) --- ---_Can only be used if this is BlueprintItem_ ---@field blueprint_position_relative_to_grid Position ---[RW] ---The snapping grid size in this blueprint item or nil if snapping is not enabled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.blueprint_snap_to_grid) --- ---_Can only be used if this is BlueprintItem_ ---@field blueprint_snap_to_grid Position ---[RW] ---If this item is a spidertron remote that has a spidertron bound to it, it returns the connected spider-vehicle entity, `nil` otherwise. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.connected_entity) ---@field connected_entity LuaEntity ---[R] ---Raw materials required to build this blueprint. Result is a dictionary mapping each item prototype name to the required count. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.cost_to_build) --- ---_Can only be used if this is BlueprintItem_ ---@field cost_to_build table ---[RW] ---Number of items in this stack. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.count) ---@field count uint ---[RW] ---The custom description this item-with-tags. This is shown over the normal item description if this is set to a non-empty value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.custom_description) ---@field custom_description LocalisedString ---[R] ---The default icons for a blueprint item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.default_icons) --- ---_Can only be used if this is BlueprintItem_ ---@field default_icons BlueprintItemIcon[] ---[RW] ---Durability of the contained item. Automatically capped at the item's maximum durability. --- ---**Note:** When used on a non-tool item, the value of this attribute is `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.durability) ---@field durability double ---[R] ---The number of entity filters this deconstruction item supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.entity_filter_count) --- ---_Can only be used if this is DeconstructionItem_ ---@field entity_filter_count uint ---[RW] ---The blacklist/whitelist entity filter mode for this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.entity_filter_mode) --- ---_Can only be used if this is DeconstructionItem_ ---@field entity_filter_mode defines.deconstruction_item.entity_filter_mode ---[RW] ---The entity filters for this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.entity_filters) ---@field entity_filters string[] ---[RW] ---If this item extends the inventory it resides in (provides its contents for counts, crafting, insertion). Only callable on items with inventories. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.extends_inventory) --- ---_Can only be used if this is ItemWithInventory_ ---@field extends_inventory boolean ---[R] ---The equipment grid of this item or `nil` if this item doesn't have a grid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.grid) ---@field grid LuaEquipmentGrid ---[RW] ---How much health the item has, as a number in range [0, 1]. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.health) ---@field health float ---[R] ---If this is an armor item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_armor) ---@field is_armor boolean ---[R] ---If this is a blueprint item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_blueprint) ---@field is_blueprint boolean ---[R] ---If this is a blueprint book item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_blueprint_book) ---@field is_blueprint_book boolean ---[R] ---If this is a deconstruction tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_deconstruction_item) ---@field is_deconstruction_item boolean ---[R] ---If this is an item with entity data item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_item_with_entity_data) ---@field is_item_with_entity_data boolean ---[R] ---If this is an item with inventory item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_item_with_inventory) ---@field is_item_with_inventory boolean ---[R] ---If this is an item with label item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_item_with_label) ---@field is_item_with_label boolean ---[R] ---If this is an item with tags item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_item_with_tags) ---@field is_item_with_tags boolean ---[R] ---If this is a mining tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_mining_tool) ---@field is_mining_tool boolean ---[R] ---If this is a module item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_module) ---@field is_module boolean ---[R] ---If this is a repair tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_repair_tool) ---@field is_repair_tool boolean ---[R] ---If this is a selection tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_selection_tool) ---@field is_selection_tool boolean ---[R] ---If this is a tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_tool) ---@field is_tool boolean ---[R] ---If this is a upgrade item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_upgrade_item) ---@field is_upgrade_item boolean ---[R] ---The unique identifier for this item if it has one, `nil` otherwise. Note that this ID stays the same no matter where the item is moved to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.item_number) ---@field item_number uint ---[RW] ---The current label for this item. Nil when none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.label) --- ---_Can only be used if this is ItemWithLabel_ ---@field label string ---[RW] ---The current label color for this item. Nil when none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.label_color) --- ---_Can only be used if this is ItemWithLabel_ ---@field label_color Color ---[R] ---Prototype name of the item held in this stack. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.object_name) ---@field object_name string ---[RW] ---The insertion mode priority this ItemWithInventory uses when items are inserted into an inventory it resides in. Only callable on items with inventories. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.prioritize_insertion_mode) --- ---_Can only be used if this is ItemWithInventory_ ---@field prioritize_insertion_mode string ---[R] ---Prototype of the item held in this stack. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.prototype) ---@field prototype LuaItemPrototype ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.tags) --- ---_Can only be used if this is ItemWithTags_ ---@field tags Tags ---[R] ---The number of tile filters this deconstruction item supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.tile_filter_count) --- ---_Can only be used if this is DeconstructionItem_ ---@field tile_filter_count uint ---[RW] ---The blacklist/whitelist tile filter mode for this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.tile_filter_mode) --- ---_Can only be used if this is DeconstructionItem_ ---@field tile_filter_mode defines.deconstruction_item.tile_filter_mode ---[RW] ---The tile filters for this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.tile_filters) ---@field tile_filters string[] ---[RW] ---The tile selection mode for this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.tile_selection_mode) --- ---_Can only be used if this is DeconstructionItem_ ---@field tile_selection_mode defines.deconstruction_item.tile_selection_mode ---[RW] ---If this deconstruction item is set to allow trees and rocks only. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.trees_and_rocks_only) --- ---_Can only be used if this is DeconstructionItem_ ---@field trees_and_rocks_only boolean ---[R] ---Type of the item prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.type) ---@field type string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.valid) ---@field valid boolean ---[R] ---Is this valid for reading? Differs from the usual `valid` in that `valid` will be `true` even if the item stack is blank but the entity that holds it is still valid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.valid_for_read) ---@field valid_for_read boolean local LuaItemStack={ ---Add ammo to this ammo item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.add_ammo) --- ---_Can only be used if this is AmmoItem_ ---@param amount float@Amount of ammo to add. add_ammo=function(amount)end, ---Add durability to this tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.add_durability) --- ---_Can only be used if this is ToolItem_ ---@param amount double@Amount of durability to add. add_durability=function(amount)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@class LuaItemStack.build_blueprint_param ---Surface to build on --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@field surface SurfaceIdentification ---Force to use for the building --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@field force ForceIdentification ---The position to build at --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@field position Position ---When true, anything that can be built is else nothing is built if any one thing can't be built --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@field force_build boolean|nil ---The direction to use when building --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@field direction defines.direction|nil ---If chunks covered by fog-of-war are skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@field skip_fog_of_war boolean|nil ---The player to use if any. If provided [defines.events.on_built_entity](https://lua-api.factorio.com/latest/defines.html#defines.events.on_built_entity) will also be fired on successful entity creation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@field by_player PlayerIdentification|nil ---If true; [defines.events.script_raised_built](https://lua-api.factorio.com/latest/defines.html#defines.events.script_raised_built) will be fired on successful entity creation. Note: this is ignored if by_player is provided. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@field raise_built boolean|nil ---Build this blueprint --- ---**Note:** Built entities can be come invalid between the building of the blueprint and the function returning if by_player or raise_built is used and one of those events invalidates the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.build_blueprint) ---@param param LuaItemStack.build_blueprint_param ---@return LuaEntity[]@Array of created ghosts build_blueprint=function(param)end, ---Would a call to [LuaItemStack::set_stack](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_stack) succeed? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.can_set_stack) ---@param stack?ItemStackIdentification@Stack that would be set, possibly `nil`. ---@return boolean can_set_stack=function(stack)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.cancel_deconstruct_area) ---@class LuaItemStack.cancel_deconstruct_area_param ---Surface to cancel deconstruct on --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.cancel_deconstruct_area) ---@field surface SurfaceIdentification ---Force to use for canceling deconstruction --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.cancel_deconstruct_area) ---@field force ForceIdentification ---The area to deconstruct --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.cancel_deconstruct_area) ---@field area BoundingBox> ---If chunks covered by fog-of-war are skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.cancel_deconstruct_area) ---@field skip_fog_of_war boolean|nil ---The player to use if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.cancel_deconstruct_area) ---@field by_player PlayerIdentification|nil ---Cancel deconstruct the given area with this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.cancel_deconstruct_area) ---@param param LuaItemStack.cancel_deconstruct_area_param cancel_deconstruct_area=function(param)end, ---Clear this item stack. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.clear) clear=function()end, ---Clears this blueprint item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.clear_blueprint) --- ---_Can only be used if this is BlueprintItem_ clear_blueprint=function()end, ---Clears all settings/filters on this deconstruction item resetting it to default values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.clear_deconstruction_item) --- ---_Can only be used if this is DeconstructionItem_ clear_deconstruction_item=function()end, ---Clears all settings/filters on this upgrade item resetting it to default values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.clear_upgrade_item) --- ---_Can only be used if this is UpgradeItem_ clear_upgrade_item=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@class LuaItemStack.create_blueprint_param ---Surface to create from --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@field surface SurfaceIdentification ---Force to use for the creation --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@field force ForceIdentification ---The bounding box --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@field area BoundingBox> ---When true, blueprintable tiles are always included in the blueprint. When false they're only included if no entities exist in the setup area. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@field always_include_tiles boolean|nil ---When true, entities are included in the blueprint. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@field include_entities boolean|nil ---When true, modules are included in the blueprint. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@field include_modules boolean|nil ---When true, station names are included in the blueprint. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@field include_station_names boolean|nil ---When true, trains are included in the blueprint. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@field include_trains boolean|nil ---When true, train fuel is included in the blueprint, Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@field include_fuel boolean|nil ---Sets up this blueprint using the found blueprintable entities/tiles on the surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_blueprint) ---@param param LuaItemStack.create_blueprint_param ---@return table@The blueprint entity index to source entity mapping. create_blueprint=function(param)end, ---Creates the equipment grid for this item if it doesn't exist and this is an item-with-entity-data that supports equipment grids. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_grid) --- ---_Can only be used if this is ItemWithEntityData_ ---@return LuaEquipmentGrid create_grid=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.deconstruct_area) ---@class LuaItemStack.deconstruct_area_param ---Surface to deconstruct on --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.deconstruct_area) ---@field surface SurfaceIdentification ---Force to use for the deconstruction --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.deconstruct_area) ---@field force ForceIdentification ---The area to deconstruct --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.deconstruct_area) ---@field area BoundingBox> ---If chunks covered by fog-of-war are skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.deconstruct_area) ---@field skip_fog_of_war boolean|nil ---The player to use if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.deconstruct_area) ---@field by_player PlayerIdentification|nil ---Deconstruct the given area with this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.deconstruct_area) ---@param param LuaItemStack.deconstruct_area_param deconstruct_area=function(param)end, ---Remove ammo from this ammo item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.drain_ammo) --- ---_Can only be used if this is AmmoItem_ ---@param amount float@Amount of ammo to remove. drain_ammo=function(amount)end, ---Remove durability from this tool item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.drain_durability) --- ---_Can only be used if this is ToolItem_ ---@param amount double@Amount of durability to remove. drain_durability=function(amount)end, ---Export a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) to a string --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.export_stack) ---@return string@The exported string export_stack=function()end, ---The entities in this blueprint. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_blueprint_entities) --- ---_Can only be used if this is BlueprintItem_ ---@return BlueprintEntity[] get_blueprint_entities=function()end, ---Gets the number of entities in this blueprint item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_blueprint_entity_count) --- ---_Can only be used if this is BlueprintItem_ ---@return uint get_blueprint_entity_count=function()end, ---Gets the given tag on the given blueprint entity index in this blueprint item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_blueprint_entity_tag) --- ---_Can only be used if this is BlueprintItem_ ---@param index uint@The entity index. ---@param tag string@The tag to get. ---@return AnyBasic get_blueprint_entity_tag=function(index,tag)end, ---Gets the tags for the given blueprint entity index in this blueprint item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_blueprint_entity_tags) --- ---_Can only be used if this is BlueprintItem_ ---@param index uint ---@return Tags get_blueprint_entity_tags=function(index)end, ---A list of the tiles in this blueprint. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_blueprint_tiles) --- ---_Can only be used if this is BlueprintItem_ ---@return Tile[] get_blueprint_tiles=function()end, ---Gets the entity filter at the given index for this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_entity_filter) --- ---_Can only be used if this is DeconstructionItem_ ---@param index uint ---@return string get_entity_filter=function(index)end, ---Access the inner inventory of an item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_inventory) ---@param inventory defines.inventory@Index of the inventory to access -- currently can only be [defines.inventory.item_main](https://lua-api.factorio.com/latest/defines.html#defines.inventory.item_main). ---@return LuaInventory@or `nil` if there is no inventory with the given index. get_inventory=function(inventory)end, ---Gets the filter at the given index for this upgrade item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_mapper) --- ---_Can only be used if this is UpgradeItem_ ---@param index uint@The index of the mapper to read. ---@param type string@'from' or 'to'. ---@return UpgradeFilter get_mapper=function(index,type)end, ---Gets the tag with the given name or returns `nil` if it doesn't exist. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_tag) --- ---_Can only be used if this is ItemWithTags_ ---@param tag_name string ---@return AnyBasic get_tag=function(tag_name)end, ---Gets the tile filter at the given index for this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.get_tile_filter) --- ---_Can only be used if this is DeconstructionItem_ ---@param index uint ---@return string get_tile_filter=function(index)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.help) ---@return string help=function()end, ---Import a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) from a string --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.import_stack) ---@param data string@The string to import ---@return int@0 if the import succeeded with no errors. -1 if the import succeeded with errors. 1 if the import failed. import_stack=function(data)end, ---Is this blueprint item setup? I.e. is it a non-empty blueprint? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_blueprint_setup) ---@return boolean is_blueprint_setup=function()end, ---Removes a tag with the given name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.remove_tag) --- ---_Can only be used if this is ItemWithTags_ ---@param tag string ---@return boolean@If the tag existed and was removed. remove_tag=function(tag)end, ---Set new entities to be a part of this blueprint. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_blueprint_entities) --- ---_Can only be used if this is BlueprintItem_ ---@param entities BlueprintEntity[]@The new blueprint entities. set_blueprint_entities=function(entities)end, ---Sets the given tag on the given blueprint entity index in this blueprint item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_blueprint_entity_tag) --- ---_Can only be used if this is BlueprintItem_ ---@param index uint@The entity index. ---@param tag string@The tag to set. ---@param value AnyBasic@The tag value to set or `nil` to clear the tag. set_blueprint_entity_tag=function(index,tag,value)end, ---Sets the tags on the given blueprint entity index in this blueprint item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_blueprint_entity_tags) --- ---_Can only be used if this is BlueprintItem_ ---@param index uint@The entity index ---@param tags Tags set_blueprint_entity_tags=function(index,tags)end, ---Set specific tiles in this blueprint. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_blueprint_tiles) --- ---_Can only be used if this is BlueprintItem_ ---@param tiles Tile[]@Tiles to be a part of the blueprint. set_blueprint_tiles=function(tiles)end, ---Sets the entity filter at the given index for this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_entity_filter) --- ---_Can only be used if this is DeconstructionItem_ ---@param index uint ---@param filter string|LuaEntityPrototype|LuaEntity@Setting to nil erases the filter. ---@return boolean@If the new filter was set (was valid.) set_entity_filter=function(index,filter)end, ---Sets the module filter at the given index for this upgrade item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_mapper) --- ---_Can only be used if this is UpgradeItem_ ---@param index uint@The index of the mapper to set. ---@param type string@`from` or `to`. ---@param filter UpgradeFilter@The filter to set or `nil` set_mapper=function(index,type,filter)end, ---Set this item stack to another item stack. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_stack) ---@param stack?ItemStackIdentification@Item stack to set this one to. Omitting this parameter or passing `nil` will clear this item stack, as if by calling [LuaItemStack::clear](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.clear). ---@return boolean@Was the stack set successfully? set_stack=function(stack)end, ---Sets the tag with the given name and value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_tag) --- ---_Can only be used if this is ItemWithTags_ ---@param tag_name string ---@param tag AnyBasic ---@return AnyBasic set_tag=function(tag_name,tag)end, ---Sets the tile filter at the given index for this deconstruction item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.set_tile_filter) --- ---_Can only be used if this is DeconstructionItem_ ---@param index uint ---@param filter string|LuaTilePrototype|LuaTile@Setting to nil erases the filter. ---@return boolean@If the new filter was set (was valid.) set_tile_filter=function(index,filter)end, ---Swaps this item stack with the given item stack if allowed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.swap_stack) ---@param stack LuaItemStack ---@return boolean@if the 2 stacks were swapped successfully. swap_stack=function(stack)end, ---Transfers the given item stack into this item stack. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.transfer_stack) ---@param stack ItemStackIdentification ---@return boolean@True if the full stack was transferred. transfer_stack=function(stack)end, } ---Control behavior for lamps. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLampControlBehavior.html) ---@class LuaLampControlBehavior:LuaGenericOnOffControlBehavior ---[R] ---The color the lamp is showing or `nil` if not using any color. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLampControlBehavior.html#LuaLampControlBehavior.color) ---@field color Color ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLampControlBehavior.html#LuaLampControlBehavior.object_name) ---@field object_name string ---[RW] ---`true` if the lamp should set the color from the circuit network signals. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLampControlBehavior.html#LuaLampControlBehavior.use_colors) ---@field use_colors boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLampControlBehavior.html#LuaLampControlBehavior.valid) ---@field valid boolean local LuaLampControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLampControlBehavior.html#LuaLampControlBehavior.help) ---@return string help=function()end, } ---A lazily loaded value. For performance reasons, we sometimes return a custom lazily-loaded value type instead of the native Lua value. This custom type lazily constructs the necessary value when [LuaLazyLoadedValue::get](https://lua-api.factorio.com/latest/LuaLazyLoadedValue.html#LuaLazyLoadedValue.get) is called, therefore preventing its unnecessary construction in some cases. ---An instance of LuaLazyLoadedValue is only valid during the event it was created from and cannot be saved. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLazyLoadedValue.html) ---@class LuaLazyLoadedValue ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLazyLoadedValue.html#LuaLazyLoadedValue.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLazyLoadedValue.html#LuaLazyLoadedValue.valid) ---@field valid boolean local LuaLazyLoadedValue={ ---Gets the value of this lazy loaded value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLazyLoadedValue.html#LuaLazyLoadedValue.get) ---@return Any get=function()end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLazyLoadedValue.html#LuaLazyLoadedValue.help) ---@return string help=function()end, } ---Logistic cell of a particular [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html). A "Logistic Cell" is the given name for settings and properties used by what would normally be seen as a "Roboport". A logistic cell however doesn't have to be attached to the roboport entity (the character has one for the personal roboport). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html) ---@class LuaLogisticCell ---[R] ---Radius at which the robots hover when waiting to be charged. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.charge_approach_distance) ---@field charge_approach_distance float ---[R] ---Number of robots currently charging. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.charging_robot_count) ---@field charging_robot_count uint ---[R] ---Robots currently being charged. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.charging_robots) ---@field charging_robots LuaEntity[] ---[R] ---Construction radius of this cell. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.construction_radius) ---@field construction_radius float ---[R] ---The network that owns this cell or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.logistic_network) ---@field logistic_network LuaLogisticNetwork ---[R] ---Logistic radius of this cell. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.logistic_radius) ---@field logistic_radius float ---[R] ---Logistic connection distance of this cell. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.logistics_connection_distance) ---@field logistics_connection_distance float ---[R] ---`true` if this is a mobile cell. In vanilla, only the logistic cell created by a character's personal roboport is mobile. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.mobile) ---@field mobile boolean ---[R] ---Neighbouring cells. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.neighbours) ---@field neighbours LuaLogisticCell[] ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.object_name) ---@field object_name string ---[R] ---This cell's owner. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.owner) ---@field owner LuaEntity ---[R] ---Number of stationed construction robots in this cell. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.stationed_construction_robot_count) ---@field stationed_construction_robot_count uint ---[R] ---Number of stationed logistic robots in this cell. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.stationed_logistic_robot_count) ---@field stationed_logistic_robot_count uint ---[R] ---Number of robots waiting to charge. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.to_charge_robot_count) ---@field to_charge_robot_count uint ---[R] ---Robots waiting to charge. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.to_charge_robots) ---@field to_charge_robots LuaEntity[] ---[R] ---`true` if this cell is active. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.transmitting) ---@field transmitting boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.valid) ---@field valid boolean local LuaLogisticCell={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.help) ---@return string help=function()end, ---Is a given position within the construction range of this cell? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.is_in_construction_range) ---@param position Position ---@return boolean is_in_construction_range=function(position)end, ---Is a given position within the logistic range of this cell? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.is_in_logistic_range) ---@param position Position ---@return boolean is_in_logistic_range=function(position)end, ---Are two cells neighbours? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticCell.html#LuaLogisticCell.is_neighbour_with) ---@param other LuaLogisticCell ---@return boolean is_neighbour_with=function(other)end, } ---Control behavior for logistic chests. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticContainerControlBehavior.html) ---@class LuaLogisticContainerControlBehavior:LuaControlBehavior ---[RW] ---The circuit mode of operations for the logistic container. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticContainerControlBehavior.html#LuaLogisticContainerControlBehavior.circuit_mode_of_operation) ---@field circuit_mode_of_operation defines.control_behavior.logistic_container.circuit_mode_of_operation ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticContainerControlBehavior.html#LuaLogisticContainerControlBehavior.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticContainerControlBehavior.html#LuaLogisticContainerControlBehavior.valid) ---@field valid boolean local LuaLogisticContainerControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticContainerControlBehavior.html#LuaLogisticContainerControlBehavior.help) ---@return string help=function()end, } ---A single logistic network of a given force on a given surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html) ---@class LuaLogisticNetwork ---[R] ---All active provider points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.active_provider_points) ---@field active_provider_points LuaLogisticPoint[] ---[R] ---The total number of construction robots in the network (idle and active + in roboports). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.all_construction_robots) ---@field all_construction_robots uint ---[R] ---The total number of logistic robots in the network (idle and active + in roboports). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.all_logistic_robots) ---@field all_logistic_robots uint ---[R] ---Number of construction robots available for a job. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.available_construction_robots) ---@field available_construction_robots uint ---[R] ---Number of logistic robots available for a job. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.available_logistic_robots) ---@field available_logistic_robots uint ---[R] ---All cells in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.cells) ---@field cells LuaLogisticCell[] ---[R] ---All construction robots in this logistic network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.construction_robots) ---@field construction_robots LuaEntity[] ---[R] ---All things that have empty provider points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.empty_provider_points) ---@field empty_provider_points LuaLogisticPoint[] ---[R] ---All entities that have empty logistic provider points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.empty_providers) ---@field empty_providers LuaEntity[] ---[R] ---The force this logistic network belongs to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.force) ---@field force LuaForce ---[R] ---All other entities that have logistic points in this network (inserters mostly). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.logistic_members) ---@field logistic_members LuaEntity[] ---[R] ---All logistic robots in this logistic network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.logistic_robots) ---@field logistic_robots LuaEntity[] ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.object_name) ---@field object_name string ---[R] ---All passive provider points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.passive_provider_points) ---@field passive_provider_points LuaLogisticPoint[] ---[R] ---All things that have provider points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.provider_points) ---@field provider_points LuaLogisticPoint[] ---[R] ---All entities that have logistic provider points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.providers) ---@field providers LuaEntity[] ---[R] ---All things that have requester points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.requester_points) ---@field requester_points LuaLogisticPoint[] ---[R] ---All entities that have logistic requester points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.requesters) ---@field requesters LuaEntity[] ---[R] ---Maximum number of robots the network can work with. Currently only used for the personal roboport. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.robot_limit) ---@field robot_limit uint ---[R] ---All robots in this logistic network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.robots) ---@field robots LuaEntity[] ---[R] ---All things that have storage points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.storage_points) ---@field storage_points LuaLogisticPoint[] ---[R] ---All entities that have logistic storage points in this network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.storages) ---@field storages LuaEntity[] ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.valid) ---@field valid boolean local LuaLogisticNetwork={ ---Find logistic cell closest to a given position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.find_cell_closest_to) ---@param position Position ---@return LuaLogisticCell@May be `nil` if no cell was found. find_cell_closest_to=function(position)end, ---Get item counts for the entire network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.get_contents) --- ---### See also ---- [LuaInventory::get_contents](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_contents) ---@return table@A mapping of item prototype names to the number available in the network. get_contents=function()end, ---Count given or all items in the network or given members. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.get_item_count) ---@param item?string@Item name to count. If not given, gives counts of all items in the network. ---@param member?string@Logistic members to check, must be either `"storage"` or `"providers"`. If not given, gives count in the entire network. ---@return int get_item_count=function(item,member)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.help) ---@return string help=function()end, ---Insert items into the logistic network. This will actually insert the items into some logistic chests. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.insert) ---@param item ItemStackIdentification@What to insert. ---@param members?string@Which logistic members to insert the items to. Must be `"storage"`, `"storage-empty"` (storage chests that are completely empty), `"storage-empty-slot"` (storage chests that have an empty slot), or `"requester"`. If not specified, inserts items into the logistic network in the usual order. ---@return uint@Number of items actually inserted. insert=function(item,members)end, ---Remove items from the logistic network. This will actually remove the items from some logistic chests. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.remove_item) ---@param item ItemStackIdentification@What to remove. ---@param members?string@Which logistic members to remove from. Must be `"storage"`, `"passive-provider"`, `"buffer"`, or `"active-provider"`. If not specified, removes from the network in the usual order. ---@return uint@Number of items removed. remove_item=function(item,members)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_drop_point) ---@class LuaLogisticNetwork.select_drop_point_param ---Name of the item to select. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_drop_point) ---@field stack ItemStackIdentification ---When given, it will find from only the specific type of member. Must be `"storage"`, `"storage-empty"`, `"storage-empty-slot"` or `"requester"`. If not specified, selects with normal priorities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_drop_point) ---@field members string|nil ---Find a logistic point to drop the specific item stack. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_drop_point) ---@param param LuaLogisticNetwork.select_drop_point_param ---@return LuaLogisticPoint@May be `nil` if no point was found. select_drop_point=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_pickup_point) ---@class LuaLogisticNetwork.select_pickup_point_param ---Name of the item to select. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_pickup_point) ---@field name string ---When given, it will find the storage 'best' storage point from this position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_pickup_point) ---@field position Position|nil ---Whether to consider buffer chests or not. Defaults to false. Only considered if selecting with position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_pickup_point) ---@field include_buffers boolean|nil ---When given, it will find from only the specific type of member. Must be `"storage"`, `"passive-provider"`, `"buffer"` or `"active-provider"`. If not specified, selects with normal priorities. Not considered if position is specified. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_pickup_point) ---@field members string|nil ---Find the 'best' logistic point with this item ID and from the given position or from given chest type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticNetwork.html#LuaLogisticNetwork.select_pickup_point) ---@param param LuaLogisticNetwork.select_pickup_point_param ---@return LuaLogisticPoint@May be `nil` if no point was found. select_pickup_point=function(param)end, } ---Logistic point of a particular [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html). A "Logistic point" is the name given for settings and properties used by requester, provider, and storage points in a given logistic network. These "points" don't have to be a logistic container but often are. One other entity that can own several points is the "character" character type entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html) ---@class LuaLogisticPoint ---[R] ---If this logistic point is using the exact mode. In exact mode robots never over-deliver requests. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.exact) ---@field exact boolean ---[R] ---The logistic filters for this logistic point or `nil` if this doesn't use logistic filters. --- ---**Note:** The returned array will always have an entry for each filter and will be indexed in sequence when not nil. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.filters) ---@field filters LogisticFilter[] ---[R] ---The force of this logistic point. --- ---**Note:** This will always be the same as the [LuaLogisticPoint::owner](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.owner) force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.force) ---@field force LuaForce ---[R] ---The Logistic member index of this logistic point. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.logistic_member_index) ---@field logistic_member_index uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.logistic_network) ---@field logistic_network LuaLogisticNetwork ---[R] ---The logistic mode. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.mode) ---@field mode defines.logistic_mode ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.object_name) ---@field object_name string ---[R] ---The [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) owner of this [LuaLogisticPoint](https://lua-api.factorio.com/latest/LuaLogisticPoint.html). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.owner) ---@field owner LuaEntity ---[R] ---Items targeted to be dropped off into this logistic point by robots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.targeted_items_deliver) ---@field targeted_items_deliver table ---[R] ---Items targeted to be picked up from this logistic point by robots. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.targeted_items_pickup) ---@field targeted_items_pickup table ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.valid) ---@field valid boolean local LuaLogisticPoint={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaLogisticPoint.html#LuaLogisticPoint.help) ---@return string help=function()end, } ---Control behavior for mining drills. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html) ---@class LuaMiningDrillControlBehavior:LuaGenericOnOffControlBehavior ---[RW] ---`true` if this drill is enabled or disabled using the logistics or circuit condition. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.circuit_enable_disable) ---@field circuit_enable_disable boolean ---[RW] ---`true` if this drill should send the resources in the field to the circuit network. Which resources depends on [LuaMiningDrillControlBehavior::resource_read_mode](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.resource_read_mode) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.circuit_read_resources) ---@field circuit_read_resources boolean ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.object_name) ---@field object_name string ---[RW] ---If the mining drill should send just the resources in its area or the entire field it's on to the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.resource_read_mode) ---@field resource_read_mode defines.control_behavior.mining_drill.resource_read_mode ---[R] ---The resource entities that the mining drill will send information about to the circuit network or an empty array. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.resource_read_targets) ---@field resource_read_targets LuaEntity[] ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.valid) ---@field valid boolean local LuaMiningDrillControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaMiningDrillControlBehavior.html#LuaMiningDrillControlBehavior.help) ---@return string help=function()end, } ---Prototype of a mod setting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html) ---@class LuaModSettingPrototype ---[R] ---If this string setting allows blank values or `nil` if not a string setting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.allow_blank) ---@field allow_blank boolean ---[R] ---The allowed values for this setting or `nil` if this setting doesn't use the a fixed set of values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.allowed_values) ---@field allowed_values string[]|int[]|double[] ---[R] ---If this string setting auto-trims values or `nil` if not a string setting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.auto_trim) ---@field auto_trim boolean ---[R] ---The default value of this setting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.default_value) ---@field default_value boolean|double|int|string ---[R] ---If this setting is hidden from the GUI. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.hidden) ---@field hidden boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---The maximum value for this setting or `nil` if this setting type doesn't support a maximum. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.maximum_value) ---@field maximum_value double|int ---[R] ---The minimum value for this setting or `nil` if this setting type doesn't support a minimum. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.minimum_value) ---@field minimum_value double|int ---[R] ---The mod that owns this setting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.mod) ---@field mod string ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.order) ---@field order string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.setting_type) ---@field setting_type string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.valid) ---@field valid boolean local LuaModSettingPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.help) ---@return string help=function()end, } ---Prototype of a module category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModuleCategoryPrototype.html) ---@class LuaModuleCategoryPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModuleCategoryPrototype.html#LuaModuleCategoryPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModuleCategoryPrototype.html#LuaModuleCategoryPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModuleCategoryPrototype.html#LuaModuleCategoryPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModuleCategoryPrototype.html#LuaModuleCategoryPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModuleCategoryPrototype.html#LuaModuleCategoryPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModuleCategoryPrototype.html#LuaModuleCategoryPrototype.valid) ---@field valid boolean local LuaModuleCategoryPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaModuleCategoryPrototype.html#LuaModuleCategoryPrototype.help) ---@return string help=function()end, } ---Prototype of a named noise expression. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html) ---@class LuaNamedNoiseExpression ---[R] ---The expression itself. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.expression) ---@field expression NoiseExpression ---[R] ---Name of the property that this expression is intended to provide a value for, if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.intended_property) ---@field intended_property string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.valid) ---@field valid boolean local LuaNamedNoiseExpression={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNamedNoiseExpression.html#LuaNamedNoiseExpression.help) ---@return string help=function()end, } ---Prototype of a noise layer. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNoiseLayerPrototype.html) ---@class LuaNoiseLayerPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNoiseLayerPrototype.html#LuaNoiseLayerPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNoiseLayerPrototype.html#LuaNoiseLayerPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNoiseLayerPrototype.html#LuaNoiseLayerPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNoiseLayerPrototype.html#LuaNoiseLayerPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNoiseLayerPrototype.html#LuaNoiseLayerPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNoiseLayerPrototype.html#LuaNoiseLayerPrototype.valid) ---@field valid boolean local LuaNoiseLayerPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaNoiseLayerPrototype.html#LuaNoiseLayerPrototype.help) ---@return string help=function()end, } ---Prototype of an optimized particle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html) ---@class LuaParticlePrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.ended_in_water_trigger_effect) ---@field ended_in_water_trigger_effect TriggerEffectItem ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.life_time) ---@field life_time uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.localised_name) ---@field localised_name LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.mining_particle_frame_speed) ---@field mining_particle_frame_speed float ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.movement_modifier) ---@field movement_modifier float ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.movement_modifier_when_on_ground) ---@field movement_modifier_when_on_ground float ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.order) ---@field order string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.regular_trigger_effect) ---@field regular_trigger_effect TriggerEffectItem ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.regular_trigger_effect_frequency) ---@field regular_trigger_effect_frequency uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.render_layer) ---@field render_layer RenderLayer ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.render_layer_when_on_ground) ---@field render_layer_when_on_ground RenderLayer ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.valid) ---@field valid boolean local LuaParticlePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaParticlePrototype.html#LuaParticlePrototype.help) ---@return string help=function()end, } ---A permission group that defines what players in this group are allowed to do. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html) ---@class LuaPermissionGroup ---[R] ---The group ID --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.group_id) ---@field group_id uint ---[RW] ---The name of this group. --- ---**Note:** Setting the name to `nil` or an empty string sets the name to the default value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.object_name) ---@field object_name string ---[R] ---The players in this group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.players) ---@field players LuaPlayer[] ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.valid) ---@field valid boolean local LuaPermissionGroup={ ---Adds the given player to this group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.add_player) ---@param player PlayerIdentification ---@return boolean@If the player was added. add_player=function(player)end, ---Whether this group allows the given action. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.allows_action) ---@param action defines.input_action@The action in question. ---@return boolean allows_action=function(action)end, ---Destroys this group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.destroy) ---@return boolean@Whether the group was successfully destroyed. destroy=function()end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.help) ---@return string help=function()end, ---Removes the given player from this group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.remove_player) ---@param player PlayerIdentification ---@return boolean@If the player was removed. remove_player=function(player)end, ---Sets whether this group allows the performance the given action. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroup.html#LuaPermissionGroup.set_allows_action) ---@param action defines.input_action@The action in question. ---@param allow_action boolean@Whether to allow the specified action. ---@return boolean@Whether the value was successfully applied. set_allows_action=function(action,allow_action)end, } ---All permission groups. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroups.html) ---@class LuaPermissionGroups ---[R] ---All of the permission groups. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroups.html#LuaPermissionGroups.groups) ---@field groups LuaPermissionGroup[] ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroups.html#LuaPermissionGroups.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroups.html#LuaPermissionGroups.valid) ---@field valid boolean local LuaPermissionGroups={ ---Creates a new permission group. --- ---**Note:** May return nil if the calling player doesn't have permission to make groups. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroups.html#LuaPermissionGroups.create_group) ---@param name?string ---@return LuaPermissionGroup create_group=function(name)end, ---Gets the permission group with the given name or group ID or `nil` if there is no matching group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroups.html#LuaPermissionGroups.get_group) ---@param group string|uint ---@return LuaPermissionGroup get_group=function(group)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPermissionGroups.html#LuaPermissionGroups.help) ---@return string help=function()end, } ---A player in the game. Pay attention that a player may or may not have a character, which is the [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) of the little guy running around the world doing things. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html) ---@class LuaPlayer:LuaControl ---[RW] ---`true` if the player is an admin. --- ---**Note:** Trying to change player admin status from the console when you aren't an admin does nothing. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.admin) ---@field admin boolean ---[R] ---How many ticks since the last action of this player --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.afk_time) ---@field afk_time uint ---[R] ---If the main inventory will be auto sorted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.auto_sort_main_inventory) ---@field auto_sort_main_inventory boolean ---[R] ---The item stack containing a blueprint to be setup. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.blueprint_to_setup) ---@field blueprint_to_setup LuaItemStack ---[RW] ---The character attached to this player, or `nil` if no character. --- ---**Note:** Will also return `nil` when the player is disconnected (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character) ---@field character LuaEntity ---[RW] ---The color used when this player talks in game. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.chat_color) ---@field chat_color Color ---[RW] ---The color associated with the player. This will be used to tint the player's character as well as their buildings and vehicles. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.color) ---@field color Color ---[R] ---`true` if the player is currently connected to the game. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected) ---@field connected boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.controller_type) ---@field controller_type defines.controllers ---[R] ---When in a cutscene; the character this player would be using once the cutscene is over. --- ---**Note:** Will also return `nil` when the player is disconnected (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.cutscene_character) ---@field cutscene_character LuaEntity ---[R] ---The display resolution for this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.display_resolution) ---@field display_resolution DisplayResolution ---[R] ---The display scale for this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.display_scale) ---@field display_scale double ---[R] ---The source entity used during entity settings copy-paste if any. ---`nil` if there isn't currently a source entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.entity_copy_source) ---@field entity_copy_source LuaEntity ---[RW] ---The player's game view settings. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.game_view_settings) ---@field game_view_settings GameViewSettings ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.gui) ---@field gui LuaGui ---[RW] ---The original location of the item in the cursor, marked with a hand. When writing, the specified inventory slot must be empty and the cursor stack must not be empty. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.hand_location) ---@field hand_location ItemStackLocation ---[R] ---This player's index in [LuaGameScript::players](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.index) ---@field index uint ---[RW] ---The filters for this map editor infinity inventory settings. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.infinity_inventory_filters) ---@field infinity_inventory_filters InfinityInventoryFilter[] ---[R] ---At what tick this player was last online. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.last_online) ---@field last_online uint ---[W] ---The player's map view settings. To write to this, use a table containing the fields that should be changed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.map_view_settings) ---@field map_view_settings MapViewSettings ---[RW] ---`true` if the minimap is visible. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.minimap_enabled) ---@field minimap_enabled boolean ---[R] ---Gets the current per-player settings for the this player, indexed by prototype name. Returns the same structure as [LuaSettings::get_player_settings](https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.get_player_settings). --- ---**Note:** This can become invalid if during operation this player becomes invalid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.mod_settings) ---@field mod_settings LuaCustomTable ---[R] ---The player's username. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.object_name) ---@field object_name string ---[R] ---How many ticks did this player spend playing this save (all sessions combined) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.online_time) ---@field online_time uint ---[R] ---`true` if the player opened itself. I.e. if they opened the character or god-controller GUI. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.opened_self) ---@field opened_self boolean ---[RW] ---The permission group this player is part of or `nil` if not part of any group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.permission_group) ---@field permission_group LuaPermissionGroup ---[RW] ---If items not included in this map editor infinity inventory filters should be removed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_unfiltered_items) ---@field remove_unfiltered_items boolean ---[R] ---The render mode of the player, like map or zoom to world. The render mode can be set using [LuaPlayer::open_map](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.open_map), [LuaPlayer::zoom_to_world](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.zoom_to_world) and [LuaPlayer::close_map](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.close_map). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.render_mode) ---@field render_mode defines.render_mode ---[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. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.spectator) ---@field spectator boolean ---[R] ---The stashed controller type or `nil` if no controller is stashed. --- ---**Note:** This is mainly useful when a player is in the map editor. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.stashed_controller_type) ---@field stashed_controller_type defines.controllers ---[RW] ---The tag that is shown after the player in chat and on the map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.tag) ---@field tag string ---[RW] ---The number of ticks until this player will respawn or `nil` if not waiting to respawn. --- ---**Note:** Set to `nil` to immediately respawn the player. --- ---**Note:** Set to any positive value to trigger the respawn state for this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.ticks_to_respawn) ---@field ticks_to_respawn uint ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.valid) ---@field valid boolean ---[W] ---The player's zoom-level. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.zoom) ---@field zoom double local LuaPlayer={ ---Gets a copy of the currently selected blueprint in the clipboard queue into the player's cursor, as if the player activated Paste. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.activate_paste) activate_paste=function()end, ---Adds an alert to this player for the given entity of the given alert type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.add_alert) ---@param entity LuaEntity ---@param type defines.alert_type add_alert=function(entity,type)end, ---Adds a custom alert to this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.add_custom_alert) ---@param entity LuaEntity@If the alert is clicked, the map will open at the position of this entity. ---@param icon SignalID ---@param message LocalisedString ---@param show_on_map boolean add_custom_alert=function(entity,icon,message,show_on_map)end, ---Adds the given recipe to the list of recipe notifications for this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.add_recipe_notification) ---@param recipe string@Name of the recipe prototype to add. add_recipe_notification=function(recipe)end, ---Adds the given blueprint to this player's clipboard queue. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.add_to_clipboard) ---@param blueprint LuaItemStack@The blueprint to add. add_to_clipboard=function(blueprint)end, ---Associates a character with this player. --- ---**Note:** The character must not be connected to any controller. --- ---**Note:** If this player is currently disconnected (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)) the character will be immediately "logged off". --- ---**Note:** See [LuaPlayer::get_associated_characters](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_associated_characters) for more information. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.associate_character) ---@param character LuaEntity@The character entity. associate_character=function(character)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor) ---@class LuaPlayer.build_from_cursor_param ---Where the entity would be placed --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor) ---@field position Position ---Direction the entity would be placed --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor) ---@field direction defines.direction|nil ---If alt build should be used instead of normal build. Defaults to normal. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor) ---@field alt boolean|nil ---The size for building terrain if building terrain. Defaults to 2. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor) ---@field terrain_building_size uint|nil ---If chunks covered by fog-of-war are skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor) ---@field skip_fog_of_war boolean|nil ---Builds what ever is in the cursor on the surface the player is on. --- ---**Note:** Anything built will fire normal player-built events. --- ---**Note:** The cursor stack will automatically be reduced as if the player built normally. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor) ---@param param LuaPlayer.build_from_cursor_param build_from_cursor=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor) ---@class LuaPlayer.can_build_from_cursor_param ---Where the entity would be placed --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor) ---@field position Position ---Direction the entity would be placed --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor) ---@field direction defines.direction|nil ---If alt build should be used instead of normal build. Defaults to normal. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor) ---@field alt boolean|nil ---The size for building terrain if building terrain. Defaults to 2. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor) ---@field terrain_building_size uint|nil ---If chunks covered by fog-of-war are skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor) ---@field skip_fog_of_war boolean|nil ---Checks if this player can build what ever is in the cursor on the surface the player is on. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor) ---@param param LuaPlayer.can_build_from_cursor_param ---@return boolean can_build_from_cursor=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity) ---@class LuaPlayer.can_place_entity_param ---Name of the entity to check --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity) ---@field name string ---Where the entity would be placed --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity) ---@field position Position ---Direction the entity would be placed --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity) ---@field direction defines.direction|nil ---Checks if this player can build the give entity at the given location on the surface the player is on. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity) ---@param param LuaPlayer.can_place_entity_param ---@return boolean can_place_entity=function(param)end, ---Clear the chat console. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.clear_console) clear_console=function()end, ---Invokes the "clear cursor" action on the player as if the user pressed it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.clear_cursor) ---@return boolean@If the cursor is now empty. clear_cursor=function()end, ---Clears all recipe notifications for this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.clear_recipe_notifications) clear_recipe_notifications=function()end, ---Queues request to switch to the normal game view from the map or zoom to world view. Render mode change requests are processed before rendering of the next frame. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.close_map) close_map=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server) ---@class LuaPlayer.connect_to_server_param ---The server (address:port) if port is not given the default Factorio port is used. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server) ---@field address string ---The name of the server. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server) ---@field name LocalisedString|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server) ---@field description LocalisedString|nil ---The password if different from the one used to join this game. Note, if the current password is not empty but the one required to join the new server is an empty string should be given for this field. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server) ---@field password string|nil ---Asks the player if they would like to connect to the given server. --- ---**Note:** This only does anything when used on a multiplayer peer. Single player and server hosts will ignore the prompt. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server) ---@param param LuaPlayer.connect_to_server_param connect_to_server=function(param)end, ---Creates and attaches a character entity to this player. --- ---**Note:** The player must not have a character already connected and must be online (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_character) ---@param character?string@The character to create else the default is used. ---@return boolean@Whether the character was created. create_character=function(character)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text) ---@class LuaPlayer.create_local_flying_text_param ---The flying text to show. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text) ---@field text LocalisedString ---The location on the map at which to show the flying text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text) ---@field position Position|nil ---If `true`, the flying text is created at the player's cursor. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text) ---@field create_at_cursor boolean|nil ---The color of the flying text. Defaults to white text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text) ---@field color Color|nil ---The amount of ticks that the flying text will be shown for. Defaults to `80`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text) ---@field time_to_live uint|nil ---The speed at which the text rises upwards in tiles/second. Can't be a negative value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text) ---@field speed double|nil ---Spawn flying text that is only visible to this player. Either `position` or `create_at_cursor` are required. When `create_at_cursor` is `true`, all parameters other than `text` are ignored. --- ---**Note:** If no custom `speed` is set and the text is longer than 25 characters, its `time_to_live` and `speed` are dynamically adjusted to give players more time to read it. --- ---**Note:** Local flying text is not saved, which means it will disappear after a save/load-cycle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text) ---@param param LuaPlayer.create_local_flying_text_param create_local_flying_text=function(param)end, ---Disables alerts for the given alert category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.disable_alert) ---@param alert_type defines.alert_type ---@return boolean@If the alert type was disabled (false if it was already disabled). disable_alert=function(alert_type)end, ---Disable recipe groups. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.disable_recipe_groups) disable_recipe_groups=function()end, ---Disable recipe subgroups. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.disable_recipe_subgroups) disable_recipe_subgroups=function()end, ---Disassociates a character from this player. This is functionally the same as setting [LuaEntity::associated_player](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.associated_player) to `nil`. --- ---**Note:** See [LuaPlayer::get_associated_characters](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_associated_characters) for more information. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.disassociate_character) ---@param character LuaEntity@The character entity disassociate_character=function(character)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.drag_wire) ---@class LuaPlayer.drag_wire_param ---Position at which cursor was clicked. Used only to decide which side of arithmetic combinator, decider combinator or power switch is to be connected. Entity itself to be connected is based on the player's selected entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.drag_wire) ---@field position Position ---Start/end wire dragging at the specified location, wire type is based on the cursor contents --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.drag_wire) ---@param param LuaPlayer.drag_wire_param ---@return boolean@`true` if the action did something drag_wire=function(param)end, ---Enables alerts for the given alert category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.enable_alert) ---@param alert_type defines.alert_type ---@return boolean@If the alert type was enabled (false if it was already enabled). enable_alert=function(alert_type)end, ---Enable recipe groups. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.enable_recipe_groups) enable_recipe_groups=function()end, ---Enable recipe subgroups. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.enable_recipe_subgroups) enable_recipe_subgroups=function()end, ---Exit the current cutscene. Errors if not in a cutscene. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.exit_cutscene) exit_cutscene=function()end, ---Gets which quick bar page is being used for the given screen page or `nil` if not known. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_active_quick_bar_page) ---@param index uint@The screen page. Index 1 is the top row in the gui. Index can go beyond the visible number of bars on the screen to account for the interface config setting change. ---@return uint8 get_active_quick_bar_page=function(index)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts) ---@class LuaPlayer.get_alerts_param ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts) ---@field entity LuaEntity|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts) ---@field prototype LuaEntityPrototype|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts) ---@field position Position|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts) ---@field type defines.alert_type|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts) ---@field surface SurfaceIdentification|nil ---Get all alerts matching the given filters, or all alerts if no filters are given. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts) ---@param param LuaPlayer.get_alerts_param ---@return table>@A mapping of surface index to an array of arrays of [alerts](https://lua-api.factorio.com/latest/Concepts.html#Alert) indexed by the [alert type](https://lua-api.factorio.com/latest/defines.html#defines.alert_type). get_alerts=function(param)end, ---The characters associated with this player. --- ---**Note:** The array will always be empty when the player is disconnected (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)) regardless of there being associated characters. --- ---**Note:** Characters associated with this player will be logged off when this player disconnects but are not controlled by any player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_associated_characters) ---@return LuaEntity[] get_associated_characters=function()end, ---Get the current goal description, as a localised string. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_goal_description) ---@return LocalisedString get_goal_description=function()end, ---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. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_infinity_inventory_filter) ---@param index uint@The index to get. ---@return InfinityInventoryFilter get_infinity_inventory_filter=function(index)end, ---Gets the quick bar filter for the given slot or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_quick_bar_slot) ---@param index uint@The slot index. 1 for the first slot of page one, 2 for slot two of page one, 11 for the first slot of page 2, etc. ---@return LuaItemPrototype get_quick_bar_slot=function(index)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.help) ---@return string help=function()end, ---If the given alert type is currently enabled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.is_alert_enabled) ---@param alert_type defines.alert_type ---@return boolean is_alert_enabled=function(alert_type)end, ---If the given alert type is currently muted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.is_alert_muted) ---@param alert_type defines.alert_type ---@return boolean is_alert_muted=function(alert_type)end, ---Is a custom Lua shortcut currently available? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.is_shortcut_available) ---@param prototype_name string@Prototype name of the custom shortcut. ---@return boolean is_shortcut_available=function(prototype_name)end, ---Is a custom Lua shortcut currently toggled? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.is_shortcut_toggled) ---@param prototype_name string@Prototype name of the custom shortcut. ---@return boolean is_shortcut_toggled=function(prototype_name)end, ---Jump to the specified cutscene waypoint. Only works when the player is viewing a cutscene. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.jump_to_cutscene_waypoint) ---@param waypoint_index uint jump_to_cutscene_waypoint=function(waypoint_index)end, ---Logs a dictionary of chunks -> active entities for the surface this player is on. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.log_active_entity_chunk_counts) log_active_entity_chunk_counts=function()end, ---Logs a dictionary of active entities -> count for the surface this player is on. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.log_active_entity_counts) log_active_entity_counts=function()end, ---Mutes alerts for the given alert category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.mute_alert) ---@param alert_type defines.alert_type ---@return boolean@If the alert type was muted (false if it was already muted). mute_alert=function(alert_type)end, ---Queues a request to open the map at the specified position. If the map is already opened, the request will simply set the position (and scale). Render mode change requests are processed before rendering of the next frame. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.open_map) ---@param position Position ---@param scale?double open_map=function(position,scale)end, ---Invokes the "smart pipette" action on the player as if the user pressed it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.pipette_entity) ---@param entity string|LuaEntity|LuaEntityPrototype ---@return boolean@If the smart pipette found something to place pipette_entity=function(entity)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound) ---@class LuaPlayer.play_sound_param ---The sound to play. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound) ---@field path SoundPath ---Where the sound should be played. If not given, it's played at the current position of the player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound) ---@field position Position|nil ---The volume of the sound to play. Must be between 0 and 1 inclusive. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound) ---@field volume_modifier double|nil ---The volume mixer to play the sound through. Defaults to the default mixer for the given sound type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound) ---@field override_sound_type SoundType|nil ---Play a sound for this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound) ---@param param LuaPlayer.play_sound_param play_sound=function(param)end, ---Print text to the chat console. --- ---**Note:** Messages that are identical to a message sent in the last 60 ticks are not printed again. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.print) ---@param message LocalisedString ---@param color?Color print=function(message,color)end, ---Print entity statistics to the player's console. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.print_entity_statistics) ---@param entities?string[]@Entity prototypes to get statistics for. If not specified or empty, display statistics for all entities. print_entity_statistics=function(entities)end, ---Print LuaObject counts per mod. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.print_lua_object_statistics) print_lua_object_statistics=function()end, ---Print construction robot job counts to the players console. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.print_robot_jobs) print_robot_jobs=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert) ---@class LuaPlayer.remove_alert_param ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert) ---@field entity LuaEntity|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert) ---@field prototype LuaEntityPrototype|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert) ---@field position Position|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert) ---@field type defines.alert_type|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert) ---@field surface SurfaceIdentification|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert) ---@field icon SignalID|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert) ---@field message LocalisedString|nil ---Removes all alerts matching the given filters or if an empty filters table is given all alerts are removed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert) ---@param param LuaPlayer.remove_alert_param remove_alert=function(param)end, ---Requests a translation for the given localised string. If the request is successful the [on_string_translated](https://lua-api.factorio.com/latest/events.html#on_string_translated) event will be fired at a later time with the results. --- ---**Note:** Does nothing if this player is not connected. (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.request_translation) ---@param localised_string LocalisedString ---@return boolean@If the request was sent or not. request_translation=function(localised_string)end, ---Sets which quick bar page is being used for the given screen page. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_active_quick_bar_page) ---@param screen_index uint@The screen page. Index 1 is the top row in the gui. Index can go beyond the visible number of bars on the screen to account for the interface config setting change. ---@param page_index uint@The new quick bar page. set_active_quick_bar_page=function(screen_index,page_index)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller) ---@class LuaPlayer.set_controller_param ---Which controller to use. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller) ---@field type defines.controllers ---Entity to control. Mandatory when `type` is [defines.controllers.character](https://lua-api.factorio.com/latest/defines.html#defines.controllers.character), ignored otherwise. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller) ---@field character LuaEntity|nil ---List of waypoints for the cutscene controller. This parameter is mandatory when `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller) ---@field waypoints CutsceneWaypoint|nil ---If specified and `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene), the cutscene will start at this position. If not given the start position will be the player position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller) ---@field start_position Position|nil ---If specified and `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene), the cutscene will start at this zoom level. If not given the start zoom will be the players zoom. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller) ---@field start_zoom double|nil ---If specified and `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene), it is the time in ticks it will take for the camera to pan from the final waypoint back to the starting position. If not given the camera will not pan back to the start position/zoom. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller) ---@field final_transition_time uint|nil ---If specified and `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene), the game will switch to chart-mode (map zoomed out) rendering when the zoom level is less than this value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller) ---@field chart_mode_cutoff double|nil ---Set the controller type of the player. --- ---**Note:** Setting a player to [defines.controllers.editor](https://lua-api.factorio.com/latest/defines.html#defines.controllers.editor) auto promotes the player to admin and enables cheat mode. --- ---**Note:** Setting a player to [defines.controllers.editor](https://lua-api.factorio.com/latest/defines.html#defines.controllers.editor) also requires the calling player be an admin. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller) ---@param param LuaPlayer.set_controller_param set_controller=function(param)end, ---Setup the screen to be shown when the game is finished. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_ending_screen_data) ---@param message LocalisedString@Message to be shown. ---@param file?string@Path to image to be shown. set_ending_screen_data=function(message,file)end, ---Set the text in the goal window (top left). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_goal_description) ---@param text?LocalisedString@The text to display. Lines can be delimited with `\n`. Passing an empty string or omitting this parameter entirely will make the goal window disappear. ---@param only_update?boolean@When `true`, won't play the "goal updated" sound. set_goal_description=function(text,only_update)end, ---Sets the filter for this map editor infinity filters at the given index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_infinity_inventory_filter) --- ---_Can only be used if this is InfinityContainer_ ---@param index uint@The index to set. ---@param filter InfinityInventoryFilter@The new filter or `nil` to clear the filter. set_infinity_inventory_filter=function(index,filter)end, ---Sets the quick bar filter for the given slot. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_quick_bar_slot) ---@param index uint@The slot index. 1 for the first slot of page one, 2 for slot two of page one, 11 for the first slot of page 2, etc. ---@param filter string|LuaItemPrototype|LuaItemStack@The filter or `nil`. set_quick_bar_slot=function(index,filter)end, ---Make a custom Lua shortcut available or unavailable. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_shortcut_available) ---@param prototype_name string@Prototype name of the custom shortcut. ---@param available boolean set_shortcut_available=function(prototype_name,available)end, ---Toggle or untoggle a custom Lua shortcut --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_shortcut_toggled) ---@param prototype_name string@Prototype name of the custom shortcut. ---@param toggled boolean set_shortcut_toggled=function(prototype_name,toggled)end, ---Toggles this player into or out of the map editor. Does nothing if this player isn't an admin or if the player doesn't have permission to use the map editor. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.toggle_map_editor) toggle_map_editor=function()end, ---Unlock the achievements of the given player. This has any effect only when this is the local player, the achievement isn't unlocked so far and the achievement is of the type "achievement". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.unlock_achievement) ---@param name string@name of the achievement to unlock unlock_achievement=function(name)end, ---Unmutes alerts for the given alert category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.unmute_alert) ---@param alert_type defines.alert_type ---@return boolean@If the alert type was unmuted (false if it was wasn't muted). unmute_alert=function(alert_type)end, ---Uses the current item in the cursor if it's a capsule or does nothing if not. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.use_from_cursor) ---@param position Position@Where the item would be used. use_from_cursor=function(position)end, ---Queues a request to zoom to world at the specified position. If the player is already zooming to world, the request will simply set the position (and scale). Render mode change requests are processed before rendering of the next frame. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.zoom_to_world) ---@param position Position ---@param scale?double zoom_to_world=function(position,scale)end, } ---An object used to measure script performance. --- ---**Note:** Since performance is non-deterministic these objects don't allow reading the raw time values from lua. They can be used anywhere a [LocalisedString](https://lua-api.factorio.com/latest/Concepts.html#LocalisedString) is used. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProfiler.html) ---@class LuaProfiler ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProfiler.html#LuaProfiler.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProfiler.html#LuaProfiler.valid) ---@field valid boolean local LuaProfiler={ ---Add the duration of another timer to this timer. Useful to reduce start/stop overhead when accumulating time onto many timers at once. --- ---**Note:** If other is running, the time to now will be added. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProfiler.html#LuaProfiler.add) ---@param other LuaProfiler@The timer to add to this timer. add=function(other)end, ---Divides the current duration by a set value. Useful for calculating the average of many iterations. --- ---**Note:** Does nothing if this isn't stopped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProfiler.html#LuaProfiler.divide) ---@param number double@The number to divide by. Must be > 0. divide=function(number)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProfiler.html#LuaProfiler.help) ---@return string help=function()end, ---Resets the clock, also restarting it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProfiler.html#LuaProfiler.reset) reset=function()end, ---Start the clock again, without resetting it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProfiler.html#LuaProfiler.restart) restart=function()end, ---Stops the clock. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProfiler.html#LuaProfiler.stop) stop=function()end, } ---Control behavior for programmable speakers. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProgrammableSpeakerControlBehavior.html) ---@class LuaProgrammableSpeakerControlBehavior:LuaControlBehavior ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProgrammableSpeakerControlBehavior.html#LuaProgrammableSpeakerControlBehavior.circuit_condition) ---@field circuit_condition CircuitConditionDefinition ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProgrammableSpeakerControlBehavior.html#LuaProgrammableSpeakerControlBehavior.circuit_parameters) ---@field circuit_parameters ProgrammableSpeakerCircuitParameters ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProgrammableSpeakerControlBehavior.html#LuaProgrammableSpeakerControlBehavior.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProgrammableSpeakerControlBehavior.html#LuaProgrammableSpeakerControlBehavior.valid) ---@field valid boolean local LuaProgrammableSpeakerControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaProgrammableSpeakerControlBehavior.html#LuaProgrammableSpeakerControlBehavior.help) ---@return string help=function()end, } ---**Global Description:** ---Allows printing messages to the calling RCON instance if any. --- ---**Class Description:** ---An interface to send messages to the calling RCON interface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRCON.html) ---@class LuaRCON ---[R] ---This object's name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRCON.html#LuaRCON.object_name) ---@field object_name string rcon={ ---Print text to the calling RCON interface if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRCON.html#LuaRCON.print) ---@param message LocalisedString print=function(message)end, } ---Control behavior for rail chain signals. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailChainSignalControlBehavior.html) ---@class LuaRailChainSignalControlBehavior:LuaControlBehavior ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailChainSignalControlBehavior.html#LuaRailChainSignalControlBehavior.blue_signal) ---@field blue_signal SignalID ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailChainSignalControlBehavior.html#LuaRailChainSignalControlBehavior.green_signal) ---@field green_signal SignalID ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailChainSignalControlBehavior.html#LuaRailChainSignalControlBehavior.object_name) ---@field object_name string ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailChainSignalControlBehavior.html#LuaRailChainSignalControlBehavior.orange_signal) ---@field orange_signal SignalID ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailChainSignalControlBehavior.html#LuaRailChainSignalControlBehavior.red_signal) ---@field red_signal SignalID ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailChainSignalControlBehavior.html#LuaRailChainSignalControlBehavior.valid) ---@field valid boolean local LuaRailChainSignalControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailChainSignalControlBehavior.html#LuaRailChainSignalControlBehavior.help) ---@return string help=function()end, } ---A rail path. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailPath.html) ---@class LuaRailPath ---[R] ---The current rail index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailPath.html#LuaRailPath.current) ---@field current uint ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailPath.html#LuaRailPath.object_name) ---@field object_name string ---[R] ---Array of the rails that this path travels over. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailPath.html#LuaRailPath.rails) ---@field rails LuaCustomTable ---[R] ---The total number of rails in this path. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailPath.html#LuaRailPath.size) ---@field size uint ---[R] ---The total path distance. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailPath.html#LuaRailPath.total_distance) ---@field total_distance double ---[R] ---The total distance travelled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailPath.html#LuaRailPath.travelled_distance) ---@field travelled_distance double ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailPath.html#LuaRailPath.valid) ---@field valid boolean local LuaRailPath={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailPath.html#LuaRailPath.help) ---@return string help=function()end, } ---Control behavior for rail signals. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html) ---@class LuaRailSignalControlBehavior:LuaControlBehavior ---[RW] ---The circuit condition when controlling the signal through the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.circuit_condition) ---@field circuit_condition CircuitConditionDefinition ---[RW] ---If this will close the rail signal based off the circuit condition. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.close_signal) ---@field close_signal boolean ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.green_signal) ---@field green_signal SignalID ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.object_name) ---@field object_name string ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.orange_signal) ---@field orange_signal SignalID ---[RW] ---If this will read the rail signal state. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.read_signal) ---@field read_signal boolean ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.red_signal) ---@field red_signal SignalID ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.valid) ---@field valid boolean local LuaRailSignalControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRailSignalControlBehavior.html#LuaRailSignalControlBehavior.help) ---@return string help=function()end, } ---A deterministic random generator independent from the core games random generator that can be seeded and re-seeded at will. This random generator can be saved and loaded and will maintain its state. Note this is entirely different from calling [math.random](https://lua-api.factorio.com/latest/Libraries.html#math.random)() and you should be sure you actually want to use this over calling `math.random()`. If you aren't sure if you need to use this over calling `math.random()` then you probably don't need to use this. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRandomGenerator.html) --- ---### Example ---Create a generator and use it to print a random number. ---``` ---global.generator = game.create_random_generator() ---game.player.print(global.generator()) ---``` ---@class LuaRandomGenerator ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRandomGenerator.html#LuaRandomGenerator.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRandomGenerator.html#LuaRandomGenerator.valid) ---@field valid boolean local LuaRandomGenerator={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRandomGenerator.html#LuaRandomGenerator.help) ---@return string help=function()end, ---Re-seeds the random generator with the given value. --- ---**Note:** Seeds that are close together will produce similar results. Seeds from 0 to 341 will produce the same results. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRandomGenerator.html#LuaRandomGenerator.re_seed) ---@param seed uint re_seed=function(seed)end, ---Generates a random number. If no parameters are given a number in the [0, 1) range is returned. If a single parameter is given a floored number in the [1, N] range is returned. If 2 parameters are given a floored number in the [N1, N2] range is returned. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRandomGenerator.html#LuaRandomGenerator.operator%20()) ---@param lower?int@Inclusive lower bound on the result ---@param upper?int@Inclusive upper bound on the result ---@return double __call=function(lower,upper)end, } ---A crafting recipe. Recipes belong to forces (see [LuaForce](https://lua-api.factorio.com/latest/LuaForce.html)) because some recipes are unlocked by research, and researches are per-force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html) ---@class LuaRecipe ---[R] ---Category of the recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.category) ---@field category string ---[RW] ---Can the recipe be used? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.enabled) ---@field enabled boolean ---[R] ---Energy required to execute this recipe. This directly affects the crafting time: Recipe's energy is exactly its crafting time in seconds, when crafted in an assembling machine with crafting speed exactly equal to one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.energy) ---@field energy double ---[R] ---The force that owns this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.force) ---@field force LuaForce ---[R] ---Group of this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.group) ---@field group LuaGroup ---[R] ---Is the recipe hidden? Hidden recipe don't show up in the crafting menu. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.hidden) ---@field hidden boolean ---[RW] ---Is the recipe hidden from flow statistics? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.hidden_from_flow_stats) ---@field hidden_from_flow_stats boolean ---[R] ---Ingredients for this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.ingredients) --- ---### Example ---What the "steel-chest" recipe would return ---``` ---{ {type="item", name="steel-plate", amount=8} } ---``` --- ---### Example ---What the "advanced-oil-processing" recipe would return ---``` ---{ {type="fluid", name="crude-oil", amount=10}, {type="fluid", name="water", amount=5} } ---``` ---@field ingredients Ingredient[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.localised_description) ---@field localised_description LocalisedString ---[R] ---Localised name of the recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of the recipe. This can be different than the name of the result items as there could be more recipes to make the same item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.object_name) ---@field object_name string ---[R] ---Order string. This is used to sort the crafting menu. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.order) ---@field order string ---[R] ---The results of this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.products) ---@field products Product[] ---[R] ---The prototype for this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.prototype) ---@field prototype LuaRecipePrototype ---[R] ---Subgroup of this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.subgroup) ---@field subgroup LuaGroup ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.valid) ---@field valid boolean local LuaRecipe={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.help) ---@return string help=function()end, ---Reload the recipe from the prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.reload) reload=function()end, } ---Prototype of a recipe category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipeCategoryPrototype.html) ---@class LuaRecipeCategoryPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipeCategoryPrototype.html#LuaRecipeCategoryPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipeCategoryPrototype.html#LuaRecipeCategoryPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipeCategoryPrototype.html#LuaRecipeCategoryPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipeCategoryPrototype.html#LuaRecipeCategoryPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipeCategoryPrototype.html#LuaRecipeCategoryPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipeCategoryPrototype.html#LuaRecipeCategoryPrototype.valid) ---@field valid boolean local LuaRecipeCategoryPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipeCategoryPrototype.html#LuaRecipeCategoryPrototype.help) ---@return string help=function()end, } ---A crafting recipe prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html) ---@class LuaRecipePrototype ---[R] ---If this recipe is enabled for the purpose of intermediate hand-crafting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.allow_as_intermediate) ---@field allow_as_intermediate boolean ---[R] ---Is this recipe allowed to be broken down for the recipe tooltip "Total raw" calculations? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.allow_decomposition) ---@field allow_decomposition boolean ---[R] ---If the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.allow_inserter_overload) ---@field allow_inserter_overload boolean ---[R] ---If this recipe is allowed to use intermediate recipes when hand-crafting. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.allow_intermediates) ---@field allow_intermediates boolean ---[R] ---Should this recipe always show "Made in" in the tooltip? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.always_show_made_in) ---@field always_show_made_in boolean ---[R] ---If the products are always shown in the recipe tooltip. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.always_show_products) ---@field always_show_products boolean ---[R] ---Category of the recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.category) ---@field category string ---[R] ---The emissions multiplier for this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.emissions_multiplier) ---@field emissions_multiplier double ---[R] ---If this recipe prototype is enabled by default (enabled at the beginning of a game). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.enabled) ---@field enabled boolean ---[R] ---Energy required to execute this recipe. This directly affects the crafting time: Recipe's energy is exactly its crafting time in seconds, when crafted in an assembling machine with crafting speed exactly equal to one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.energy) ---@field energy double ---[R] ---Group of this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.group) ---@field group LuaGroup ---[R] ---Is the recipe hidden? Hidden recipe don't show up in the crafting menu. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.hidden) ---@field hidden boolean ---[R] ---Is the recipe hidden from flow statistics (item/fluid production statistics)? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.hidden_from_flow_stats) ---@field hidden_from_flow_stats boolean ---[R] ---Is the recipe hidden from player crafting? The recipe will still show up for selection in machines. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.hidden_from_player_crafting) ---@field hidden_from_player_crafting boolean ---[R] ---Ingredients for this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.ingredients) ---@field ingredients Ingredient[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.localised_description) ---@field localised_description LocalisedString ---[R] ---Localised name of the recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---The main product of this recipe, `nil` if no main product is defined. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.main_product) ---@field main_product Product ---[R] ---Name of the recipe. This can be different than the name of the result items as there could be more recipes to make the same item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.object_name) ---@field object_name string ---[R] ---Order string. This is used to sort the crafting menu. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.order) ---@field order string ---[R] ---Used to determine how many extra items are put into an assembling machine before it's considered "full enough". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.overload_multiplier) ---@field overload_multiplier uint ---[R] ---The results of this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.products) ---@field products Product[] ---[R] ---The multiplier used when this recipe is copied from an assembling machine to a requester chest. For each item in the recipe the item count * this value is set in the requester chest. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.request_paste_multiplier) ---@field request_paste_multiplier uint ---[R] ---If the amount is shown in the recipe tooltip title when the recipe produces more than 1 product. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.show_amount_in_title) ---@field show_amount_in_title boolean ---[R] ---Subgroup of this recipe. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.subgroup) ---@field subgroup LuaGroup ---[R] ---Is this recipe unlocks the result item(s) so they're shown in filter-select GUIs. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.unlock_results) ---@field unlock_results boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.valid) ---@field valid boolean local LuaRecipePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.help) ---@return string help=function()end, } ---**Global Description:** ---Allows inter-mod communication by way of providing a repository of interfaces that is shared by all mods. --- ---**Class Description:** ---Registry of interfaces between scripts. An interface is simply a dictionary mapping names to functions. A script or mod can then register an interface with [LuaRemote](https://lua-api.factorio.com/latest/LuaRemote.html), after that any script can call the registered functions, provided it knows the interface name and the desired function name. An instance of LuaRemote is available through the global object named `remote`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRemote.html) --- ---### Example ---Will register a remote interface containing two functions. Later, it will call these functions through `remote`. ---``` ---remote.add_interface("human interactor", --- {hello = function() game.player.print("Hi!") end, --- bye = function(name) game.player.print("Bye " .. name) end}) ----- Some time later, possibly in a different mod... ---remote.call("human interactor", "hello") ---remote.call("human interactor", "bye", "dear reader") ---``` ---@class LuaRemote ---[R] ---List of all registered interfaces. For each interface name, `remote.interfaces[name]` is a dictionary mapping the interface's registered functions to the value `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRemote.html#LuaRemote.interfaces) --- ---### Example ---Assuming the "human interactor" interface is registered as above ---``` ---game.player.print(tostring(remote.interfaces["human interactor"]["hello"])) -- prints true ---game.player.print(tostring(remote.interfaces["human interactor"]["nonexistent"])) -- prints nil ---``` ---@field interfaces table> ---[R] ---This object's name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRemote.html#LuaRemote.object_name) ---@field object_name string remote={ ---Add a remote interface. --- ---**Note:** It is an error if the given interface `name` is already registered. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRemote.html#LuaRemote.add_interface) ---@param name string@Name of the interface. ---@param functions table@List of functions that are members of the new interface. add_interface=function(name,functions)end, ---Call a function of an interface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRemote.html#LuaRemote.call) ---@param interface string@Interface to look up `function` in. ---@param function_ string@Function name that belongs to `interface`. ---@vararg Any --- ---**vararg**: Arguments to pass to the called function. ---@return Any call=function(interface,function_,...)end, ---Removes an interface with the given name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRemote.html#LuaRemote.remove_interface) ---@param name string@Name of the interface. ---@return boolean@If the interface was removed. `False` if the interface didn't exist. remove_interface=function(name)end, } ---**Global Description:** ---Allows rendering of geometric shapes, text and sprites in the game world. --- ---**Class Description:** ---Allows rendering of geometric shapes, text and sprites in the game world. Each render object is identified by an id that is universally unique for the lifetime of a whole game. --- ---**Note:** If an entity target of an object is destroyed or changes surface, then the object is also destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html) ---@class LuaRendering ---[R] ---This object's name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.object_name) ---@field object_name string rendering={ ---Reorder this object so that it is drawn in front of the already existing objects. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.bring_to_front) ---@param id uint64 bring_to_front=function(id)end, ---Destroys all render objects. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.clear) ---@param mod_name?string@If provided, only the render objects created by this mod are destroyed. clear=function(mod_name)end, ---Destroy the object with the given id. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.destroy) ---@param id uint64 destroy=function(id)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@class LuaRendering.draw_animation_param ---Name of an [animation prototype](https://wiki.factorio.com/Prototype/Animation). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field animation string ---The orientation of the animation. Default is 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field orientation RealOrientation|nil ---Horizontal scale of the animation. Default is 1. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field x_scale double|nil ---Vertical scale of the animation. Default is 1. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field y_scale double|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field tint Color|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field render_layer RenderLayer|nil ---How many frames the animation goes forward per tick. Default is 1. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field animation_speed double|nil ---Offset of the animation in frames. Default is 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field animation_offset double|nil ---If given, the animation rotates so that it faces this target. Note that `orientation` is still applied to the animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field orientation_target Position|LuaEntity|nil ---Only used if `orientation_target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field orientation_target_offset Vector|nil ---Offsets the center of the animation if `orientation_target` is given. This offset will rotate together with the animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field oriented_offset Vector|nil ---Center of the animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field target Position|LuaEntity ---Only used if `target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field target_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field surface SurfaceIdentification ---In ticks. Defaults to living forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field time_to_live uint|nil ---The forces that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field forces ForceIdentification[]|nil ---The players that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field players PlayerIdentification[]|nil ---If this is rendered to anyone at all. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field visible boolean|nil ---If this should only be rendered in alt mode. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@field only_in_alt_mode boolean|nil ---Create an animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_animation) ---@param param LuaRendering.draw_animation_param ---@return uint64@Id of the render object draw_animation=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@class LuaRendering.draw_arc_param ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field color Color ---The radius of the outer edge of the arc, in tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field max_radius double ---The radius of the inner edge of the arc, in tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field min_radius double ---Where the arc starts, in radian. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field start_angle float ---The angle of the arc, in radian. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field angle float ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field target Position|LuaEntity ---Only used if `target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field target_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field surface SurfaceIdentification ---In ticks. Defaults to living forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field time_to_live uint|nil ---The forces that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field forces ForceIdentification[]|nil ---The players that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field players PlayerIdentification[]|nil ---If this is rendered to anyone at all. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field visible boolean|nil ---If this should be drawn below sprites and entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field draw_on_ground boolean|nil ---If this should only be rendered in alt mode. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@field only_in_alt_mode boolean|nil ---Create an arc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_arc) ---@param param LuaRendering.draw_arc_param ---@return uint64@Id of the render object draw_arc=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@class LuaRendering.draw_circle_param ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field color Color ---In tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field radius double ---Width of the outline, used only if filled = false. Value is in pixels (32 per tile). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field width float|nil ---If the circle should be filled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field filled boolean ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field target Position|LuaEntity ---Only used if `target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field target_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field surface SurfaceIdentification ---In ticks. Defaults to living forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field time_to_live uint|nil ---The forces that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field forces ForceIdentification[]|nil ---The players that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field players PlayerIdentification[]|nil ---If this is rendered to anyone at all. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field visible boolean|nil ---If this should be drawn below sprites and entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field draw_on_ground boolean|nil ---If this should only be rendered in alt mode. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@field only_in_alt_mode boolean|nil ---Create a circle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_circle) ---@param param LuaRendering.draw_circle_param ---@return uint64@Id of the render object draw_circle=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@class LuaRendering.draw_light_param ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field sprite SpritePath ---The orientation of the light. Default is 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field orientation RealOrientation|nil ---Default is 1. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field scale float|nil ---Default is 1. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field intensity float|nil ---The minimum darkness at which this light is rendered. Default is 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field minimum_darkness float|nil ---If this light has the same orientation as the entity target, default is false. Note that `orientation` is still applied to the sprite. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field oriented boolean|nil ---Defaults to white (no tint). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field color Color|nil ---Center of the light. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field target Position|LuaEntity ---Only used if `target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field target_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field surface SurfaceIdentification ---In ticks. Defaults to living forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field time_to_live uint|nil ---The forces that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field forces ForceIdentification[]|nil ---The players that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field players PlayerIdentification[]|nil ---If this is rendered to anyone at all. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field visible boolean|nil ---If this should only be rendered in alt mode. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@field only_in_alt_mode boolean|nil ---Create a light. --- ---**Note:** The base game uses the utility sprites `light_medium` and `light_small` for lights. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_light) ---@param param LuaRendering.draw_light_param ---@return uint64@Id of the render object draw_light=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@class LuaRendering.draw_line_param ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field color Color ---In pixels (32 per tile). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field width float ---Length of the gaps that this line has, in tiles. Default is 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field gap_length double|nil ---Length of the dashes that this line has. Used only if gap_length > 0. Default is 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field dash_length double|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field from Position|LuaEntity ---Only used if `from` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field from_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field to Position|LuaEntity ---Only used if `to` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field to_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field surface SurfaceIdentification ---In ticks. Defaults to living forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field time_to_live uint|nil ---The forces that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field forces ForceIdentification[]|nil ---The players that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field players PlayerIdentification[]|nil ---If this is rendered to anyone at all. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field visible boolean|nil ---If this should be drawn below sprites and entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field draw_on_ground boolean|nil ---If this should only be rendered in alt mode. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) ---@field only_in_alt_mode boolean|nil ---Create a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_line) --- ---### Example ---Draw a white and 2 pixel wide line from {0, 0} to {2, 2}. ---``` ---rendering.draw_line{surface = game.player.surface, from = {0, 0}, to = {2, 2}, color = {1, 1, 1}, width = 2} ---``` --- ---### Example ---Draw a red and 3 pixel wide line from {0, 0} to {0, 5}. The line has 1 tile long dashes and gaps. ---``` ---rendering.draw_line{surface = game.player.surface, from = {0, 0}, to = {0, 5}, color = {r = 1}, width = 3, gap_length = 1, dash_length = 1} ---``` ---@param param LuaRendering.draw_line_param ---@return uint64@Id of the render object draw_line=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@class LuaRendering.draw_polygon_param ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field color Color ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field vertices ScriptRenderVertexTarget[] ---Acts like an offset applied to all vertices that are not set to an entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field target Position|LuaEntity|nil ---Only used if `target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field target_offset Vector|nil ---The orientation applied to all vertices. Default is 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field orientation RealOrientation|nil ---If given, the vertices (that are not set to an entity) rotate so that it faces this target. Note that `orientation` is still applied. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field orientation_target Position|LuaEntity|nil ---Only used if `orientation_target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field orientation_target_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field surface SurfaceIdentification ---In ticks. Defaults to living forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field time_to_live uint|nil ---The forces that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field forces ForceIdentification[]|nil ---The players that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field players PlayerIdentification[]|nil ---If this is rendered to anyone at all. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field visible boolean|nil ---If this should be drawn below sprites and entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field draw_on_ground boolean|nil ---If this should only be rendered in alt mode. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@field only_in_alt_mode boolean|nil ---Create a triangle mesh defined by a triangle strip. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_polygon) ---@param param LuaRendering.draw_polygon_param ---@return uint64@Id of the render object draw_polygon=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@class LuaRendering.draw_rectangle_param ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field color Color ---Width of the outline, used only if filled = false. Value is in pixels (32 per tile). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field width float|nil ---If the rectangle should be filled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field filled boolean ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field left_top Position|LuaEntity ---Only used if `left_top` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field left_top_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field right_bottom Position|LuaEntity ---Only used if `right_bottom` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field right_bottom_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field surface SurfaceIdentification ---In ticks. Defaults to living forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field time_to_live uint|nil ---The forces that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field forces ForceIdentification[]|nil ---The players that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field players PlayerIdentification[]|nil ---If this is rendered to anyone at all. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field visible boolean|nil ---If this should be drawn below sprites and entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field draw_on_ground boolean|nil ---If this should only be rendered in alt mode. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@field only_in_alt_mode boolean|nil ---Create a rectangle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_rectangle) ---@param param LuaRendering.draw_rectangle_param ---@return uint64@Id of the render object draw_rectangle=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@class LuaRendering.draw_sprite_param ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field sprite SpritePath ---The orientation of the sprite. Default is 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field orientation RealOrientation|nil ---Horizontal scale of the sprite. Default is 1. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field x_scale double|nil ---Vertical scale of the sprite. Default is 1. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field y_scale double|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field tint Color|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field render_layer RenderLayer|nil ---If given, the sprite rotates so that it faces this target. Note that `orientation` is still applied to the sprite. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field orientation_target Position|LuaEntity|nil ---Only used if `orientation_target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field orientation_target_offset Vector|nil ---Offsets the center of the sprite if `orientation_target` is given. This offset will rotate together with the sprite. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field oriented_offset Vector|nil ---Center of the sprite. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field target Position|LuaEntity ---Only used if `target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field target_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field surface SurfaceIdentification ---In ticks. Defaults to living forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field time_to_live uint|nil ---The forces that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field forces ForceIdentification[]|nil ---The players that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field players PlayerIdentification[]|nil ---If this is rendered to anyone at all. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field visible boolean|nil ---If this should only be rendered in alt mode. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) ---@field only_in_alt_mode boolean|nil ---Create a sprite. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_sprite) --- ---### Example ---This will draw an iron plate icon at the character's feet. The sprite will move together with the character. ---``` ---rendering.draw_sprite{sprite = "item.iron-plate", target = game.player.character, surface = game.player.surface} ---``` --- ---### Example ---This will draw an iron plate icon at the character's head. The sprite will move together with the character. ---``` ---rendering.draw_sprite{sprite = "item.iron-plate", target = game.player.character, target_offset = {0, -2}, surface = game.player.surface} ---``` ---@param param LuaRendering.draw_sprite_param ---@return uint64@Id of the render object draw_sprite=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@class LuaRendering.draw_text_param ---The text to display. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field text LocalisedString ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field surface SurfaceIdentification ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field target Position|LuaEntity ---Only used if `target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field target_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field color Color ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field scale double|nil ---Name of font to use. Defaults to the same font as flying-text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field font string|nil ---In ticks. Defaults to living forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field time_to_live uint|nil ---The forces that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field forces ForceIdentification[]|nil ---The players that this object is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field players PlayerIdentification[]|nil ---If this is rendered to anyone at all. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field visible boolean|nil ---If this should be drawn below sprites and entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field draw_on_ground boolean|nil ---The orientation of the text. Default is 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field orientation RealOrientation|nil ---Defaults to "left". Other options are "right" and "center". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field alignment string|nil ---Defaults to "top". Other options are "middle", "baseline" and "bottom". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field vertical_alignment string|nil ---Defaults to false. If true, the text scales with player zoom, resulting in it always being the same size on screen, and the size compared to the game world changes. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field scale_with_zoom boolean|nil ---If this should only be rendered in alt mode. Defaults to false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@field only_in_alt_mode boolean|nil ---Create a text. --- ---**Note:** Not all fonts support scaling. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.draw_text) ---@param param LuaRendering.draw_text_param ---@return uint64@Id of the render object draw_text=function(param)end, ---Get the alignment of the text with this id or `nil` if the object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_alignment) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@return string get_alignment=function(id)end, ---Gets an array of all valid object ids. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_all_ids) ---@param mod_name?string@If provided, get only the render objects created by this mod. ---@return uint64[] get_all_ids=function(mod_name)end, ---Get the angle of the arc with this id or `nil` if the object is not a arc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_angle) --- ---_Can only be used if this is Arc_ ---@param id uint64 ---@return float@angle in radian get_angle=function(id)end, ---Get the animation prototype name of the animation with this id or `nil` if the object is not an animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_animation) --- ---_Can only be used if this is Animation_ ---@param id uint64 ---@return string get_animation=function(id)end, ---Get the animation offset of the animation with this id or `nil` if the object is not an animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_animation_offset) --- ---_Can only be used if this is Animation_ ---@param id uint64 ---@return double@Animation offset in frames. get_animation_offset=function(id)end, ---Get the animation speed of the animation with this id or `nil` if the object is not an animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_animation_speed) --- ---_Can only be used if this is Animation_ ---@param id uint64 ---@return double@Animation speed in frames per tick. get_animation_speed=function(id)end, ---Get the color or tint of the object with this id. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_color) --- ---_Can only be used if this is Text, Line, Circle, Rectangle, Arc, Polygon, Sprite, Light or Animation_ ---@param id uint64 ---@return Color@or `nil` if the object does not support color. get_color=function(id)end, ---Get the dash length of the line with this id or `nil` if the object is not a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_dash_length) --- ---_Can only be used if this is Line_ ---@param id uint64 ---@return double get_dash_length=function(id)end, ---Get whether this is being drawn on the ground, under most entities and sprites. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_draw_on_ground) --- ---_Can only be used if this is Text, Line, Circle, Rectangle, Arc or Polygon_ ---@param id uint64 ---@return boolean get_draw_on_ground=function(id)end, ---Get if the circle or rectangle with this id is filled or `nil` if the object is not a circle or rectangle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_filled) --- ---_Can only be used if this is Circle or Rectangle_ ---@param id uint64 ---@return boolean get_filled=function(id)end, ---Get the font of the text with this id or `nil` if the object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_font) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@return string get_font=function(id)end, ---Get the forces that the object with this id is rendered to or `nil` if visible to all forces. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_forces) ---@param id uint64 ---@return LuaForce[] get_forces=function(id)end, ---Get from where the line with this id is drawn or `nil` if this object is not a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_from) --- ---_Can only be used if this is Line_ ---@param id uint64 ---@return ScriptRenderTarget get_from=function(id)end, ---Get the length of the gaps in the line with this id or `nil` if the object is not a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_gap_length) --- ---_Can only be used if this is Line_ ---@param id uint64 ---@return double get_gap_length=function(id)end, ---Get the intensity of the light with this id or `nil` if the object is not a light. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_intensity) --- ---_Can only be used if this is Light_ ---@param id uint64 ---@return float get_intensity=function(id)end, ---Get where top left corner of the rectangle with this id is drawn or `nil` if the object is not a rectangle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_left_top) --- ---_Can only be used if this is Rectangle_ ---@param id uint64 ---@return ScriptRenderTarget get_left_top=function(id)end, ---Get the radius of the outer edge of the arc with this id or `nil` if the object is not a arc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_max_radius) --- ---_Can only be used if this is Arc_ ---@param id uint64 ---@return double get_max_radius=function(id)end, ---Get the radius of the inner edge of the arc with this id or `nil` if the object is not a arc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_min_radius) --- ---_Can only be used if this is Arc_ ---@param id uint64 ---@return double get_min_radius=function(id)end, ---Get the minimum darkness at which the light with this id is rendered or `nil` if the object is not a light. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_minimum_darkness) --- ---_Can only be used if this is Light_ ---@param id uint64 ---@return float get_minimum_darkness=function(id)end, ---Get whether this is only rendered in alt-mode. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_only_in_alt_mode) ---@param id uint64 ---@return boolean get_only_in_alt_mode=function(id)end, ---Get the orientation of the object with this id or `nil` if the object is not a text, polygon, sprite, light or animation. --- ---**Note:** Polygon vertices that are set to an entity will ignore this. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_orientation) --- ---_Can only be used if this is Text, Polygon, Sprite, Light or Animation_ ---@param id uint64 ---@return RealOrientation get_orientation=function(id)end, ---The object rotates so that it faces this target. Note that `orientation` is still applied to the object. Get the orientation_target of the object with this id or `nil` if no target or if this object is not a polygon, sprite, or animation. --- ---**Note:** Polygon vertices that are set to an entity will ignore this. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_orientation_target) --- ---_Can only be used if this is Polygon, Sprite or Animation_ ---@param id uint64 ---@return ScriptRenderTarget get_orientation_target=function(id)end, ---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. Note that `orientation` is still applied to the sprite. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_oriented) --- ---_Can only be used if this is Light_ ---@param id uint64 ---@return boolean get_oriented=function(id)end, ---Offsets the center of the sprite or animation if `orientation_target` is given. This offset will rotate together with the sprite or animation. Get the oriented_offset of the sprite or animation with this id or `nil` if this object is not a sprite or animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_oriented_offset) --- ---_Can only be used if this is Sprite or Animation_ ---@param id uint64 ---@return Vector get_oriented_offset=function(id)end, ---Get the players that the object with this id is rendered to or `nil` if visible to all players. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_players) ---@param id uint64 ---@return LuaPlayer[] get_players=function(id)end, ---Get the radius of the circle with this id or `nil` if the object is not a circle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_radius) --- ---_Can only be used if this is Circle_ ---@param id uint64 ---@return double get_radius=function(id)end, ---Get the render layer of the sprite or animation with this id or `nil` if the object is not a sprite or animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_render_layer) --- ---_Can only be used if this is Sprite or Animation_ ---@param id uint64 ---@return RenderLayer get_render_layer=function(id)end, ---Get where bottom right corner of the rectangle with this id is drawn or `nil` if the object is not a rectangle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_right_bottom) --- ---_Can only be used if this is Rectangle_ ---@param id uint64 ---@return ScriptRenderTarget get_right_bottom=function(id)end, ---Get the scale of the text or light with this id or `nil` if the object is not a text or light. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_scale) --- ---_Can only be used if this is Text or Light_ ---@param id uint64 ---@return double get_scale=function(id)end, ---Get if the text with this id scales with player zoom or `nil` if the object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_scale_with_zoom) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@return boolean get_scale_with_zoom=function(id)end, ---Get the sprite of the sprite or light with this id or `nil` if the object is not a sprite or light. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_sprite) --- ---_Can only be used if this is Sprite or Light_ ---@param id uint64 ---@return SpritePath get_sprite=function(id)end, ---Get where the arc with this id starts or `nil` if the object is not a arc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_start_angle) --- ---_Can only be used if this is Arc_ ---@param id uint64 ---@return float@angle in radian get_start_angle=function(id)end, ---The surface the object with this id is rendered on. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_surface) ---@param id uint64 ---@return LuaSurface get_surface=function(id)end, ---Get where the object with this id is drawn or `nil` if the object does not support target. --- ---**Note:** Polygon vertices that are set to an entity will ignore this. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_target) --- ---_Can only be used if this is Text, Circle, Arc, Polygon, Sprite, Light or Animation_ ---@param id uint64 ---@return ScriptRenderTarget get_target=function(id)end, ---Get the text that is displayed by the text with this id or `nil` if the object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_text) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@return LocalisedString get_text=function(id)end, ---Get the time to live of the object with this id. This will be 0 if the object does not expire. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_time_to_live) ---@param id uint64 ---@return uint get_time_to_live=function(id)end, ---Get where the line with this id is drawn to or `nil` if the object is not a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_to) --- ---_Can only be used if this is Line_ ---@param id uint64 ---@return ScriptRenderTarget get_to=function(id)end, ---Gets the type of the given object. The types are "text", "line", "circle", "rectangle", "arc", "polygon", "sprite", "light" and "animation". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_type) ---@param id uint64 ---@return string get_type=function(id)end, ---Get the vertical alignment of the text with this id or `nil` if the object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_vertical_alignment) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@return string get_vertical_alignment=function(id)end, ---Get the vertices of the polygon with this id or `nil` if the object is not a polygon. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_vertices) --- ---_Can only be used if this is Polygon_ ---@param id uint64 ---@return ScriptRenderTarget[] get_vertices=function(id)end, ---Get whether this is rendered to anyone at all. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_visible) ---@param id uint64 ---@return boolean get_visible=function(id)end, ---Get the width of the object with this id. Value is in pixels (32 per tile). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_width) --- ---_Can only be used if this is Line, Circle or Rectangle_ ---@param id uint64 ---@return float@or `nil` if the object does not support width. get_width=function(id)end, ---Get the horizontal scale of the sprite or animation with this id or `nil` if the object is not a sprite or animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_x_scale) --- ---_Can only be used if this is Sprite or Animation_ ---@param id uint64 ---@return double get_x_scale=function(id)end, ---Get the vertical scale of the sprite or animation with this id or `nil` if the object is not a sprite or animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_y_scale) --- ---_Can only be used if this is Sprite or Animation_ ---@param id uint64 ---@return double get_y_scale=function(id)end, ---Does a font with this name exist? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.is_font_valid) ---@param font_name string ---@return boolean is_font_valid=function(font_name)end, ---Does a valid object with this id exist? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.is_valid) ---@param id uint64 ---@return boolean is_valid=function(id)end, ---Set the alignment of the text with this id. Does nothing if this object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_alignment) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@param alignment string@"left", "right" or "center". set_alignment=function(id,alignment)end, ---Set the angle of the arc with this id. Does nothing if this object is not a arc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_angle) --- ---_Can only be used if this is Arc_ ---@param id uint64 ---@param angle float@angle in radian set_angle=function(id,angle)end, ---Set the animation prototype name of the animation with this id. Does nothing if this object is not an animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_animation) --- ---_Can only be used if this is Animation_ ---@param id uint64 ---@param animation string set_animation=function(id,animation)end, ---Set the animation offset of the animation with this id. Does nothing if this object is not an animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_animation_offset) --- ---_Can only be used if this is Animation_ ---@param id uint64 ---@param animation_offset double@Animation offset in frames. set_animation_offset=function(id,animation_offset)end, ---Set the animation speed of the animation with this id. Does nothing if this object is not an animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_animation_speed) --- ---_Can only be used if this is Animation_ ---@param id uint64 ---@param animation_speed double@Animation speed in frames per tick. set_animation_speed=function(id,animation_speed)end, ---Set the color or tint of the object with this id. Does nothing if this object does not support color. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_color) --- ---_Can only be used if this is Text, Line, Circle, Rectangle, Arc, Polygon, Sprite, Light or Animation_ ---@param id uint64 ---@param color Color set_color=function(id,color)end, ---Set the corners of the rectangle with this id. Does nothing if this object is not a rectangle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_corners) --- ---_Can only be used if this is Rectangle_ ---@param id uint64 ---@param left_top Position|LuaEntity ---@param left_top_offset Vector ---@param right_bottom Position|LuaEntity ---@param right_bottom_offset Vector set_corners=function(id,left_top,left_top_offset,right_bottom,right_bottom_offset)end, ---Set the dash length of the line with this id. Does nothing if this object is not a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_dash_length) --- ---_Can only be used if this is Line_ ---@param id uint64 ---@param dash_length double set_dash_length=function(id,dash_length)end, ---Set the length of the dashes and the length of the gaps in the line with this id. Does nothing if this object is not a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_dashes) --- ---_Can only be used if this is Line_ ---@param id uint64 ---@param dash_length double ---@param gap_length double set_dashes=function(id,dash_length,gap_length)end, ---Set whether this is being drawn on the ground, under most entities and sprites. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_draw_on_ground) --- ---_Can only be used if this is Text, Line, Circle, Rectangle, Arc or Polygon_ ---@param id uint64 ---@param draw_on_ground boolean set_draw_on_ground=function(id,draw_on_ground)end, ---Set if the circle or rectangle with this id is filled. Does nothing if this object is not a circle or rectangle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_filled) --- ---_Can only be used if this is Circle or Rectangle_ ---@param id uint64 ---@param filled boolean set_filled=function(id,filled)end, ---Set the font of the text with this id. Does nothing if this object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_font) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@param font string set_font=function(id,font)end, ---Set the forces that the object with this id is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_forces) ---@param id uint64 ---@param forces ForceIdentification[]@Providing an empty array will set the object to be visible to all forces. set_forces=function(id,forces)end, ---Set from where the line with this id is drawn. Does nothing if the object is not a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_from) --- ---_Can only be used if this is Line_ ---@param id uint64 ---@param from Position|LuaEntity ---@param from_offset?Vector set_from=function(id,from,from_offset)end, ---Set the length of the gaps in the line with this id. Does nothing if this object is not a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_gap_length) --- ---_Can only be used if this is Line_ ---@param id uint64 ---@param gap_length double set_gap_length=function(id,gap_length)end, ---Set the intensity of the light with this id. Does nothing if this object is not a light. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_intensity) --- ---_Can only be used if this is Light_ ---@param id uint64 ---@param intensity float set_intensity=function(id,intensity)end, ---Set where top left corner of the rectangle with this id is drawn. Does nothing if this object is not a rectangle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_left_top) --- ---_Can only be used if this is Rectangle_ ---@param id uint64 ---@param left_top Position|LuaEntity ---@param left_top_offset?Vector set_left_top=function(id,left_top,left_top_offset)end, ---Set the radius of the outer edge of the arc with this id. Does nothing if this object is not a arc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_max_radius) --- ---_Can only be used if this is Arc_ ---@param id uint64 ---@param max_radius double set_max_radius=function(id,max_radius)end, ---Set the radius of the inner edge of the arc with this id. Does nothing if this object is not a arc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_min_radius) --- ---_Can only be used if this is Arc_ ---@param id uint64 ---@param min_radius double set_min_radius=function(id,min_radius)end, ---Set the minimum darkness at which the light with this id is rendered. Does nothing if this object is not a light. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_minimum_darkness) --- ---_Can only be used if this is Light_ ---@param id uint64 ---@param minimum_darkness float set_minimum_darkness=function(id,minimum_darkness)end, ---Set whether this is only rendered in alt-mode. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_only_in_alt_mode) ---@param id uint64 ---@param only_in_alt_mode boolean set_only_in_alt_mode=function(id,only_in_alt_mode)end, ---Set the orientation of the object with this id. Does nothing if this object is not a text, polygon, sprite, light or animation. --- ---**Note:** Polygon vertices that are set to an entity will ignore this. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_orientation) --- ---_Can only be used if this is Text, Polygon, Sprite, Light or Animation_ ---@param id uint64 ---@param orientation RealOrientation set_orientation=function(id,orientation)end, ---The object rotates so that it faces this target. Note that `orientation` is still applied to the object. Set the orientation_target of the object with this id. Does nothing if this object is not a polygon, sprite, or animation. Set to `nil` if the object should not have an orientation_target. --- ---**Note:** Polygon vertices that are set to an entity will ignore this. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_orientation_target) --- ---_Can only be used if this is Polygon, Sprite or Animation_ ---@param id uint64 ---@param orientation_target Position|LuaEntity ---@param orientation_target_offset?Vector set_orientation_target=function(id,orientation_target,orientation_target_offset)end, ---Set if the light with this id is rendered has the same orientation as the target entity. Does nothing if this object is not a light. Note that `orientation` is still applied to the sprite. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_oriented) --- ---_Can only be used if this is Light_ ---@param id uint64 ---@param oriented boolean set_oriented=function(id,oriented)end, ---Offsets the center of the sprite or animation if `orientation_target` is given. This offset will rotate together with the sprite or animation. Set the oriented_offset of the sprite or animation with this id. Does nothing if this object is not a sprite or animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_oriented_offset) --- ---_Can only be used if this is Sprite or Animation_ ---@param id uint64 ---@param oriented_offset Vector set_oriented_offset=function(id,oriented_offset)end, ---Set the players that the object with this id is rendered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_players) ---@param id uint64 ---@param players PlayerIdentification[]@Providing an empty array will set the object to be visible to all players. set_players=function(id,players)end, ---Set the radius of the circle with this id. Does nothing if this object is not a circle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_radius) --- ---_Can only be used if this is Circle_ ---@param id uint64 ---@param radius double set_radius=function(id,radius)end, ---Set the render layer of the sprite or animation with this id. Does nothing if this object is not a sprite or animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_render_layer) --- ---_Can only be used if this is Sprite or Animation_ ---@param id uint64 ---@param render_layer RenderLayer set_render_layer=function(id,render_layer)end, ---Set where top bottom right of the rectangle with this id is drawn. Does nothing if this object is not a rectangle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_right_bottom) --- ---_Can only be used if this is Rectangle_ ---@param id uint64 ---@param right_bottom Position|LuaEntity ---@param right_bottom_offset?Vector set_right_bottom=function(id,right_bottom,right_bottom_offset)end, ---Set the scale of the text or light with this id. Does nothing if this object is not a text or light. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_scale) --- ---_Can only be used if this is Text or Light_ ---@param id uint64 ---@param scale double set_scale=function(id,scale)end, ---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. Does nothing if this object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_scale_with_zoom) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@param scale_with_zoom boolean set_scale_with_zoom=function(id,scale_with_zoom)end, ---Set the sprite of the sprite or light with this id. Does nothing if this object is not a sprite or light. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_sprite) --- ---_Can only be used if this is Sprite or Light_ ---@param id uint64 ---@param sprite SpritePath set_sprite=function(id,sprite)end, ---Set where the arc with this id starts. Does nothing if this object is not a arc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_start_angle) --- ---_Can only be used if this is Arc_ ---@param id uint64 ---@param start_angle float@angle in radian set_start_angle=function(id,start_angle)end, ---Set where the object with this id is drawn. Does nothing if this object does not support target. --- ---**Note:** Polygon vertices that are set to an entity will ignore this. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_target) --- ---_Can only be used if this is Text, Circle, Arc, Polygon, Sprite, Light or Animation_ ---@param id uint64 ---@param target Position|LuaEntity ---@param target_offset?Vector set_target=function(id,target,target_offset)end, ---Set the text that is displayed by the text with this id. Does nothing if this object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_text) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@param text LocalisedString set_text=function(id,text)end, ---Set the time to live of the object with this id. Set to 0 if the object should not expire. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_time_to_live) ---@param id uint64 ---@param time_to_live uint set_time_to_live=function(id,time_to_live)end, ---Set where the line with this id is drawn to. Does nothing if this object is not a line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_to) --- ---_Can only be used if this is Line_ ---@param id uint64 ---@param to Position|LuaEntity ---@param to_offset?Vector set_to=function(id,to,to_offset)end, ---Set the vertical alignment of the text with this id. Does nothing if this object is not a text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_vertical_alignment) --- ---_Can only be used if this is Text_ ---@param id uint64 ---@param alignment string@"top", "middle", "baseline" or "bottom" set_vertical_alignment=function(id,alignment)end, ---Set the vertices of the polygon with this id. Does nothing if this object is not a polygon. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_vertices) --- ---_Can only be used if this is Polygon_ ---@param id uint64 ---@param vertices ScriptRenderVertexTarget[] set_vertices=function(id,vertices)end, ---Set whether this is rendered to anyone at all. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_visible) ---@param id uint64 ---@param visible boolean set_visible=function(id,visible)end, ---Set the width of the object with this id. Does nothing if this object does not support width. Value is in pixels (32 per tile). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_width) --- ---_Can only be used if this is Line, Circle or Rectangle_ ---@param id uint64 ---@param width float set_width=function(id,width)end, ---Set the horizontal scale of the sprite or animation with this id. Does nothing if this object is not a sprite or animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_x_scale) --- ---_Can only be used if this is Sprite or Animation_ ---@param id uint64 ---@param x_scale double set_x_scale=function(id,x_scale)end, ---Set the vertical scale of the sprite or animation with this id. Does nothing if this object is not a sprite or animation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_y_scale) --- ---_Can only be used if this is Sprite or Animation_ ---@param id uint64 ---@param y_scale double set_y_scale=function(id,y_scale)end, } ---Prototype of a resource category. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaResourceCategoryPrototype.html) ---@class LuaResourceCategoryPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaResourceCategoryPrototype.html#LuaResourceCategoryPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaResourceCategoryPrototype.html#LuaResourceCategoryPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaResourceCategoryPrototype.html#LuaResourceCategoryPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaResourceCategoryPrototype.html#LuaResourceCategoryPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaResourceCategoryPrototype.html#LuaResourceCategoryPrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaResourceCategoryPrototype.html#LuaResourceCategoryPrototype.valid) ---@field valid boolean local LuaResourceCategoryPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaResourceCategoryPrototype.html#LuaResourceCategoryPrototype.help) ---@return string help=function()end, } ---Control behavior for roboports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html) ---@class LuaRoboportControlBehavior:LuaControlBehavior ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.available_construction_output_signal) ---@field available_construction_output_signal SignalID ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.available_logistic_output_signal) ---@field available_logistic_output_signal SignalID ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.object_name) ---@field object_name string ---[RW] ---`true` if the roboport should report the logistics network content to the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.read_logistics) ---@field read_logistics boolean ---[RW] ---`true` if the roboport should report the robot statistics to the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.read_robot_stats) ---@field read_robot_stats boolean ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.total_construction_output_signal) ---@field total_construction_output_signal SignalID ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.total_logistic_output_signal) ---@field total_logistic_output_signal SignalID ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.valid) ---@field valid boolean local LuaRoboportControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaRoboportControlBehavior.html#LuaRoboportControlBehavior.help) ---@return string help=function()end, } ---**Global Description:** ---Allows reading the current mod settings. --- ---**Class Description:** ---Object containing mod settings of three distinct types: `startup`, `global`, and `player`. An instance of LuaSettings is available through the global object named `settings`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSettings.html) ---@class LuaSettings ---[R] ---The current global mod settings, indexed by prototype name. ---Even though these are marked as read-only, they can be changed by overwriting individual [ModSetting](https://lua-api.factorio.com/latest/Concepts.html#ModSetting) tables in the custom table. Mods can only change their own settings. Using the in-game console, all global settings can be changed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.global) ---@field global LuaCustomTable ---[R] ---This object's name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.object_name) ---@field object_name string ---[R] ---The default player mod settings for this map, indexed by prototype name. ---Even though these are marked as read-only, they can be changed by overwriting individual [ModSetting](https://lua-api.factorio.com/latest/Concepts.html#ModSetting) tables in the custom table. Mods can only change their own settings. Using the in-game console, all player settings can be changed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.player) ---@field player LuaCustomTable ---[R] ---The startup mod settings, indexed by prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.startup) ---@field startup LuaCustomTable settings={ ---Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure as [LuaPlayer::mod_settings](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.mod_settings). --- ---**Note:** This can become invalid if during operation if the given player becomes invalid. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.get_player_settings) ---@param player PlayerIdentification ---@return LuaCustomTable get_player_settings=function(player)end, } ---Prototype of a shortcut. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html) ---@class LuaShortcutPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.action) ---@field action string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.associated_control_input) ---@field associated_control_input string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.item_to_spawn) ---@field item_to_spawn LuaItemPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.order) ---@field order string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.technology_to_unlock) ---@field technology_to_unlock LuaTechnologyPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.toggleable) ---@field toggleable boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.valid) ---@field valid boolean local LuaShortcutPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaShortcutPrototype.html#LuaShortcutPrototype.help) ---@return string help=function()end, } ---Control behavior for storage tanks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStorageTankControlBehavior.html) ---@class LuaStorageTankControlBehavior:LuaControlBehavior ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStorageTankControlBehavior.html#LuaStorageTankControlBehavior.object_name) ---@field object_name string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStorageTankControlBehavior.html#LuaStorageTankControlBehavior.valid) ---@field valid boolean local LuaStorageTankControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStorageTankControlBehavior.html#LuaStorageTankControlBehavior.help) ---@return string help=function()end, } ---Style of a GUI element. All of the attributes listed here may be `nil` if not available for a particular GUI element. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html) ---@class LuaStyle ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.badge_font) --- ---_Can only be used if this is TabStyle_ ---@field badge_font string ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.badge_horizontal_spacing) --- ---_Can only be used if this is TabStyle_ ---@field badge_horizontal_spacing int ---[RW] ---Space between the table cell contents bottom and border. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.bottom_cell_padding) --- ---_Can only be used if this is LuaTableStyle_ ---@field bottom_cell_padding int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.bottom_margin) ---@field bottom_margin int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.bottom_padding) ---@field bottom_padding int ---[W] ---Space between the table cell contents and border. Sets top/right/bottom/left cell paddings to this value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.cell_padding) --- ---_Can only be used if this is LuaTableStyle_ ---@field cell_padding int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.clicked_font_color) --- ---_Can only be used if this is LuaButtonStyle_ ---@field clicked_font_color Color ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.clicked_vertical_offset) --- ---_Can only be used if this is LuaButtonStyle_ ---@field clicked_vertical_offset int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.color) --- ---_Can only be used if this is LuaProgressBarStyle_ ---@field color Color ---[R] ---Array containing the alignment for every column of this table element. Even though this property is marked as read-only, the alignment can be changed by indexing the LuaCustomTable, like so: --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.column_alignments) --- ---### Example ---``` ---table_element.style.column_alignments[1] = "center" ---``` ---@field column_alignments LuaCustomTable ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.default_badge_font_color) --- ---_Can only be used if this is TabStyle_ ---@field default_badge_font_color Color ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.disabled_badge_font_color) --- ---_Can only be used if this is TabStyle_ ---@field disabled_badge_font_color Color ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.disabled_font_color) --- ---_Can only be used if this is LuaButtonStyle or LuaTabStyle_ ---@field disabled_font_color Color ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_bottom_margin_when_activated) --- ---_Can only be used if this is ScrollPaneStyle_ ---@field extra_bottom_margin_when_activated int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_bottom_padding_when_activated) --- ---_Can only be used if this is ScrollPaneStyle_ ---@field extra_bottom_padding_when_activated int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_left_margin_when_activated) --- ---_Can only be used if this is ScrollPaneStyle_ ---@field extra_left_margin_when_activated int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_left_padding_when_activated) --- ---_Can only be used if this is ScrollPaneStyle_ ---@field extra_left_padding_when_activated int ---[W] ---Sets extra_top/right/bottom/left_margin_when_activated to this value. An array with two values sets top/bottom margin to the first value and left/right margin to the second value. An array with four values sets top, right, bottom, left margin respectively. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_margin_when_activated) ---@field extra_margin_when_activated int|int[] ---[W] ---Sets extra_top/right/bottom/left_padding_when_actived to this value. An array with two values sets top/bottom padding to the first value and left/right padding to the second value. An array with four values sets top, right, bottom, left padding respectively. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_padding_when_activated) ---@field extra_padding_when_activated int|int[] ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_right_margin_when_activated) --- ---_Can only be used if this is ScrollPaneStyle_ ---@field extra_right_margin_when_activated int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_right_padding_when_activated) --- ---_Can only be used if this is ScrollPaneStyle_ ---@field extra_right_padding_when_activated int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_top_margin_when_activated) --- ---_Can only be used if this is ScrollPaneStyle_ ---@field extra_top_margin_when_activated int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.extra_top_padding_when_activated) --- ---_Can only be used if this is ScrollPaneStyle_ ---@field extra_top_padding_when_activated int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.font) ---@field font string ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.font_color) ---@field font_color Color ---[R] ---Gui of the [LuaGuiElement](https://lua-api.factorio.com/latest/LuaGuiElement.html) of this style. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.gui) ---@field gui LuaGui ---[W] ---Sets both minimal and maximal height to the given value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.height) ---@field height int ---[RW] ---Horizontal align of the inner content of the widget, possible values are "left", "center" or "right" --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.horizontal_align) ---@field horizontal_align string ---[RW] ---Horizontal space between individual cells. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.horizontal_spacing) --- ---_Can only be used if this is LuaTableStyle, LuaFlowStyle or LuaHorizontalFlow_ ---@field horizontal_spacing int ---[RW] ---If the GUI element can be squashed (by maximal width of some parent element) horizontally. This is mainly meant to be used for scroll-pane The default value is false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.horizontally_squashable) ---@field horizontally_squashable boolean ---[RW] ---If the GUI element stretches its size horizontally to other elements. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.horizontally_stretchable) ---@field horizontally_stretchable boolean ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.hovered_font_color) --- ---_Can only be used if this is LuaButtonStyle_ ---@field hovered_font_color Color ---[RW] ---Space between the table cell contents left and border. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.left_cell_padding) --- ---_Can only be used if this is LuaTableStyle_ ---@field left_cell_padding int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.left_margin) ---@field left_margin int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.left_padding) ---@field left_padding int ---[W] ---Sets top/right/bottom/left margins to this value. An array with two values sets top/bottom margin to the first value and left/right margin to the second value. An array with four values sets top, right, bottom, left margin respectively. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.margin) ---@field margin int|int[] ---[RW] ---Maximal height ensures, that the widget will never be bigger than than that size. It can't be stretched to be bigger. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.maximal_height) ---@field maximal_height int ---[RW] ---Maximal width ensures, that the widget will never be bigger than than that size. It can't be stretched to be bigger. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.maximal_width) ---@field maximal_width int ---[RW] ---Minimal height ensures, that the widget will never be smaller than than that size. It can't be squashed to be smaller. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.minimal_height) ---@field minimal_height int ---[RW] ---Minimal width ensures, that the widget will never be smaller than than that size. It can't be squashed to be smaller. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.minimal_width) ---@field minimal_width int ---[R] ---Name of this style. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.name) ---@field name string ---[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. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.natural_height) ---@field natural_height 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. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.natural_width) ---@field natural_width int ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.object_name) ---@field object_name string ---[W] ---Sets top/right/bottom/left paddings to this value. An array with two values sets top/bottom padding to the first value and left/right padding to the second value. An array with four values sets top, right, bottom, left padding respectively. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.padding) ---@field padding int|int[] ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.pie_progress_color) --- ---_Can only be used if this is LuaButtonStyle_ ---@field pie_progress_color Color ---[RW] ---How this GUI element handles rich text. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.rich_text_setting) --- ---_Can only be used if this is LuaLabelStyle, LuaTextBoxStyle or LuaTextFieldStyle_ ---@field rich_text_setting defines.rich_text_setting ---[RW] ---Space between the table cell contents right and border. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.right_cell_padding) --- ---_Can only be used if this is LuaTableStyle_ ---@field right_cell_padding int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.right_margin) ---@field right_margin int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.right_padding) ---@field right_padding int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.selected_badge_font_color) --- ---_Can only be used if this is TabStyle_ ---@field selected_badge_font_color Color ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.selected_clicked_font_color) --- ---_Can only be used if this is LuaButtonStyle_ ---@field selected_clicked_font_color Color ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.selected_font_color) --- ---_Can only be used if this is LuaButtonStyle_ ---@field selected_font_color Color ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.selected_hovered_font_color) --- ---_Can only be used if this is LuaButtonStyle_ ---@field selected_hovered_font_color Color ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.single_line) --- ---_Can only be used if this is LabelStyle_ ---@field single_line boolean ---[W] ---Sets both width and height to the given value. Also accepts an array with two values, setting width to the first and height to the second one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.size) ---@field size int|int[] ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.stretch_image_to_widget_size) --- ---_Can only be used if this is ImageStyle_ ---@field stretch_image_to_widget_size boolean ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.strikethrough_color) --- ---_Can only be used if this is LuaButtonStyle_ ---@field strikethrough_color Color ---[RW] ---Space between the table cell contents top and border. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.top_cell_padding) --- ---_Can only be used if this is LuaTableStyle_ ---@field top_cell_padding int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.top_margin) ---@field top_margin int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.top_padding) ---@field top_padding int ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.use_header_filler) --- ---_Can only be used if this is LuaFrameStyle_ ---@field use_header_filler boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.valid) ---@field valid boolean ---[RW] ---Vertical align of the inner content of the widget, possible values are "top", "center" or "bottom" --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.vertical_align) ---@field vertical_align string ---[RW] ---Vertical space between individual cells. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.vertical_spacing) --- ---_Can only be used if this is LuaTableStyle, LuaFlowStyle, LuaVerticalFlowStyle or LuaTabbedPaneStyle_ ---@field vertical_spacing int ---[RW] ---If the GUI element can be squashed (by maximal height of some parent element) vertically. This is mainly meant to be used for scroll-pane The default (parent) value for scroll pane is true, false otherwise. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.vertically_squashable) ---@field vertically_squashable boolean ---[RW] ---If the GUI element stretches its size vertically to other elements. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.vertically_stretchable) ---@field vertically_stretchable boolean ---[W] ---Sets both minimal and maximal width to the given value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.width) ---@field width int local LuaStyle={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.help) ---@return string help=function()end, } ---A "domain" of the world. Surfaces can only be created and deleted through the API. Surfaces are uniquely identified by their name. Every game contains at least the surface "nauvis". --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html) ---@class LuaSurface ---[RW] ---When set to true, the sun will always shine. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.always_day) ---@field always_day boolean ---[RW] ---Defines how surface daytime brightness influences each color channel of the current color lookup table (LUT). ---The LUT is multiplied by `((1 - weight) + brightness * weight)` and result is clamped to range [0, 1]. ---Default is `{0, 0, 0}`, which means no influence. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.brightness_visual_weights) --- ---### Example ---Makes night on the surface pitch black, assuming [LuaSurface::min_brightness](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.min_brightness) being set to default value `0.15`. ---``` ---game.surfaces[1].brightness_visual_weights = { 1 / 0.85, 1 / 0.85, 1 / 0.85 } ---``` ---@field brightness_visual_weights ColorModifier ---[R] ---Amount of darkness at the current time. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.darkness) ---@field darkness float ---[RW] ---The daytime when dawn starts. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.dawn) ---@field dawn double ---[RW] ---Current time of day, as a number in range [0, 1). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.daytime) ---@field daytime float ---[RW] ---The daytime when dusk starts. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.dusk) ---@field dusk double ---[RW] ---The daytime when evening starts. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.evening) ---@field evening double ---[RW] ---True if daytime is currently frozen. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.freeze_daytime) ---@field freeze_daytime boolean ---[RW] ---When set to true, new chunks will be generated with lab tiles, instead of using the surface's map generation settings. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.generate_with_lab_tiles) ---@field generate_with_lab_tiles boolean ---[R] ---Unique ID associated with this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.index) ---@field index uint ---[RW] ---The generation settings for the surface. ---can be used to adjust the surface after changing generation settings. --- ---**Note:** When changing settings runtime the game will not retroactively change anything. --- ---**Note:** [LuaSurface::regenerate_entity](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.regenerate_entity), [LuaSurface::regenerate_decorative](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.regenerate_decorative), and [LuaSurface::delete_chunk](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.delete_chunk) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.map_gen_settings) ---@field map_gen_settings MapGenSettings ---[RW] ---The minimal brightness during the night. Default is `0.15`. The value has an effect on the game simalution only, it doesn't have any effect on rendering. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.min_brightness) ---@field min_brightness double ---[RW] ---The daytime when morning starts. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.morning) ---@field morning double ---[RW] ---The name of this surface. Names are unique among surfaces. --- ---**Note:** the default surface can't be renamed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.object_name) ---@field object_name string ---[RW] ---Is peaceful mode enabled on this surface? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.peaceful_mode) ---@field peaceful_mode boolean ---[RW] ---If clouds are shown on this surface. --- ---**Note:** If false, clouds are never shown. If true the player must also have clouds enabled in graphics settings for them to be shown. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.show_clouds) ---@field show_clouds boolean ---[RW] ---The multiplier of solar power on this surface. Cannot be less than 0. --- ---**Note:** Solar equipment is still limited to its maximum power output. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.solar_power_multiplier) ---@field solar_power_multiplier double ---[RW] ---The number of ticks per day for this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.ticks_per_day) ---@field ticks_per_day uint ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.valid) ---@field valid boolean ---[RW] ---Current wind direction. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.wind_orientation) ---@field wind_orientation RealOrientation ---[RW] ---Change in wind orientation per tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.wind_orientation_change) ---@field wind_orientation_change double ---[RW] ---Current wind speed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.wind_speed) ---@field wind_speed double local LuaSurface={ ---Adds the given script area. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.add_script_area) ---@param area ScriptArea ---@return uint@The id of the created area. add_script_area=function(area)end, ---Adds the given script position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.add_script_position) ---@param area ScriptPosition ---@return uint@The id of the created position. add_script_position=function(area)end, ---Sets the given area to the checkerboard lab tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.build_checkerboard) ---@param area BoundingBox>@The tile area. build_checkerboard=function(area)end, ---Send a group to build a new base. --- ---**Note:** The specified force must be AI-controlled; i.e. `force.ai_controllable` must be `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.build_enemy_base) ---@param position Position@Location of the new base. ---@param unit_count uint@Number of biters to send for the base-building task. ---@param force?ForceIdentification@Force the new base will belong to. Defaults to enemy. build_enemy_base=function(position,unit_count,force)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.calculate_tile_properties) ---@param property_names string[]@Names of properties (e.g. "elevation") to calculate ---@param positions Position[]@Positions for which to calculate property values ---@return table@Table of property value lists, keyed by property name calculate_tile_properties=function(property_names,positions)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_fast_replace) ---@class LuaSurface.can_fast_replace_param ---Name of the entity to check --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_fast_replace) ---@field name string ---Where the entity would be placed --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_fast_replace) ---@field position Position ---Direction the entity would be placed --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_fast_replace) ---@field direction defines.direction|nil ---The force that would place the entity. If not specified, the enemy force is assumed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_fast_replace) ---@field force ForceIdentification|nil ---If there exists an entity at the given location that can be fast-replaced with the given entity parameters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_fast_replace) ---@param param LuaSurface.can_fast_replace_param ---@return boolean can_fast_replace=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_place_entity) ---@class LuaSurface.can_place_entity_param ---Name of the entity prototype to check. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_place_entity) ---@field name string ---Where the entity would be placed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_place_entity) ---@field position Position ---Direction of the placed entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_place_entity) ---@field direction defines.direction|nil ---The force that would place the entity. If not specified, the enemy force is assumed. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_place_entity) ---@field force ForceIdentification|nil ---Which type of check should be carried out. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_place_entity) ---@field build_check_type defines.build_check_type|nil ---This parameter is only used if `build_check_type` is either `manual_ghost`, `script_ghost` or `blueprint_ghost`. If `forced` is `true`, entities that can be marked for deconstruction are ignored. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_place_entity) ---@field forced boolean|nil ---Check for collisions with terrain or other entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_place_entity) ---@param param LuaSurface.can_place_entity_param ---@return boolean can_place_entity=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_deconstruct_area) ---@class LuaSurface.cancel_deconstruct_area_param ---The area to cancel deconstruction orders in. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_deconstruct_area) ---@field area BoundingBox> ---The force whose deconstruction orders to cancel. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_deconstruct_area) ---@field force ForceIdentification ---The player to set the last_user to if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_deconstruct_area) ---@field player PlayerIdentification|nil ---If chunks covered by fog-of-war are skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_deconstruct_area) ---@field skip_fog_of_war boolean|nil ---The deconstruction item to use if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_deconstruct_area) ---@field item LuaItemStack|nil ---Cancel a deconstruction order. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_deconstruct_area) ---@param param LuaSurface.cancel_deconstruct_area_param cancel_deconstruct_area=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_upgrade_area) ---@class LuaSurface.cancel_upgrade_area_param ---The area to cancel upgrade orders in. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_upgrade_area) ---@field area BoundingBox> ---The force whose upgrade orders to cancel. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_upgrade_area) ---@field force ForceIdentification ---The player to set the last_user to if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_upgrade_area) ---@field player PlayerIdentification|nil ---If chunks covered by fog-of-war are skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_upgrade_area) ---@field skip_fog_of_war boolean|nil ---The upgrade item to use if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_upgrade_area) ---@field item LuaItemStack|nil ---Cancel a upgrade order. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.cancel_upgrade_area) ---@param param LuaSurface.cancel_upgrade_area_param cancel_upgrade_area=function(param)end, ---Clears this surface deleting all entities and chunks on it. --- ---**Note:** This won't clear the surface immediately. It will be cleared at the end of the current tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clear) ---@param ignore_characters?boolean@Whether characters on this surface that are connected to or associated with players should be ignored (not destroyed). clear=function(ignore_characters)end, ---Clears all pollution on this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clear_pollution) clear_pollution=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@class LuaSurface.clone_area_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field source_area BoundingBox> ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field destination_area BoundingBox> ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field destination_surface SurfaceIdentification|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field destination_force LuaForce|string|nil ---If tiles should be cloned --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field clone_tiles boolean|nil ---If entities should be cloned --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field clone_entities boolean|nil ---If decoratives should be cloned --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field clone_decoratives boolean|nil ---If the destination entities should be cleared --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field clear_destination_entities boolean|nil ---If the destination decoratives should be cleared --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field clear_destination_decoratives boolean|nil ---If the destination surface should be expanded when destination_area is outside current bounds. Default false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field expand_map boolean|nil ---If true, the building effect smoke will be shown around the new entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@field create_build_effect_smoke boolean|nil ---Clones the given area. --- ---**Note:** [defines.events.on_entity_cloned](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_cloned) is raised for each entity, and then [defines.events.on_area_cloned](https://lua-api.factorio.com/latest/defines.html#defines.events.on_area_cloned) is raised. --- ---**Note:** Entities are cloned in an order such that they can always be created, eg rails before trains. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_area) ---@param param LuaSurface.clone_area_param clone_area=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@class LuaSurface.clone_brush_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field source_offset TilePosition ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field destination_offset TilePosition ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field source_positions TilePosition[] ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field destination_surface SurfaceIdentification|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field destination_force LuaForce|string|nil ---If tiles should be cloned --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field clone_tiles boolean|nil ---If entities should be cloned --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field clone_entities boolean|nil ---If decoratives should be cloned --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field clone_decoratives boolean|nil ---If the destination entities should be cleared --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field clear_destination_entities boolean|nil ---If the destination decoratives should be cleared --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field clear_destination_decoratives boolean|nil ---If the destination surface should be expanded when destination_area is outside current bounds. Default false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field expand_map boolean|nil ---If manual-style collision checks should be done. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field manual_collision_mode boolean|nil ---If true, the building effect smoke will be shown around the new entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@field create_build_effect_smoke boolean|nil ---Clones the given area. --- ---**Note:** [defines.events.on_entity_cloned](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_cloned) is raised for each entity, and then [defines.events.on_area_cloned](https://lua-api.factorio.com/latest/defines.html#defines.events.on_area_cloned) is raised. --- ---**Note:** Entities are cloned in an order such that they can always be created, eg rails before trains. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_brush) ---@param param LuaSurface.clone_brush_param clone_brush=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_entities) ---@class LuaSurface.clone_entities_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_entities) ---@field entities LuaEntity[] ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_entities) ---@field destination_offset Vector ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_entities) ---@field destination_surface SurfaceIdentification|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_entities) ---@field destination_force ForceIdentification|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_entities) ---@field snap_to_grid boolean|nil ---If true, the building effect smoke will be shown around the new entities. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_entities) ---@field create_build_effect_smoke boolean|nil ---Clones the given entities. --- ---**Note:** [defines.events.on_entity_cloned](https://lua-api.factorio.com/latest/defines.html#defines.events.on_entity_cloned) is raised for each entity. --- ---**Note:** Entities are cloned in an order such that they can always be created, eg rails before trains. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.clone_entities) ---@param param LuaSurface.clone_entities_param clone_entities=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@class LuaSurface.count_entities_filtered_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field area BoundingBox>|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field position Position|nil ---If given with position, will count all entities within the radius of the position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field radius double|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field name string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field type string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field ghost_name string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field ghost_type string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field direction defines.direction|defines.direction[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field collision_mask CollisionMaskLayer|CollisionMaskLayer[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field force ForceIdentification|ForceIdentification[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field to_be_deconstructed boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field to_be_upgraded boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field limit uint|nil ---If the filters should be inverted. These filters are: name, type, ghost_name, ghost_type, direction, collision_mask, force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@field invert boolean|nil ---Count entities of given type or name in a given area. Works just like [LuaSurface::find_entities_filtered](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered), except this only returns the count. As it doesn't construct all the wrapper objects, this is more efficient if one is only interested in the number of entities. ---If no area or position are given, then the entire surface is searched. If position is given, returns entities colliding with that position (i.e the given position is within the entity's collision box). If position and radius are given, returns entities in that radius of the position. If area is specified, returns entities colliding with that area. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_entities_filtered) ---@param param LuaSurface.count_entities_filtered_param ---@return uint count_entities_filtered=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_tiles_filtered) ---@class LuaSurface.count_tiles_filtered_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_tiles_filtered) ---@field area BoundingBox>|nil ---Ignored if not given with radius. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_tiles_filtered) ---@field position Position|nil ---If given with position, will return all entities within the radius of the position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_tiles_filtered) ---@field radius double|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_tiles_filtered) ---@field name string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_tiles_filtered) ---@field limit uint|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_tiles_filtered) ---@field has_hidden_tile boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_tiles_filtered) ---@field collision_mask CollisionMaskLayer|CollisionMaskLayer[]|nil ---Count tiles of a given name in a given area. Works just like [LuaSurface::find_tiles_filtered](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered), except this only returns the count. As it doesn't construct all the wrapper objects, this is more efficient if one is only interested in the number of tiles. ---If no area or position and radius is given, then the entire surface is searched. If position and radius are given, only tiles within the radius of the position are included. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.count_tiles_filtered) ---@param param LuaSurface.count_tiles_filtered_param ---@return uint count_tiles_filtered=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_decoratives) ---@class LuaSurface.create_decoratives_param ---If collision should be checked against entities/tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_decoratives) ---@field check_collision boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_decoratives) ---@field decoratives Decorative[] ---Adds the given decoratives to the surface. --- ---**Note:** This will merge decoratives of the same type that already exist effectively increasing the "amount" field. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_decoratives) ---@param param LuaSurface.create_decoratives_param create_decoratives=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@class LuaSurface.create_entity_param ---The entity prototype name to create. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field name string ---Where to create the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field position Position ---Desired orientation of the entity after creation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field direction defines.direction|nil ---Force of the entity, default is enemy. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field force ForceIdentification|nil ---Entity with health for the new entity to target. --- ---Applies to **"item-request-proxy"**: (required) ---The target items are to be delivered to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field target LuaEntity|nil ---Source entity. Used for beams and highlight-boxes. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field source LuaEntity|nil ---If true, building will attempt to simulate fast-replace building. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field fast_replace boolean|nil ---If given set the last_user to this player. If fast_replace is true simulate fast replace using this player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field player PlayerIdentification|nil ---If false while fast_replace is true and player is nil any items from fast-replacing will be deleted instead of dropped on the ground. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field spill boolean|nil ---If true; [defines.events.script_raised_built](https://lua-api.factorio.com/latest/defines.html#defines.events.script_raised_built) will be fired on successful entity creation. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field raise_built boolean|nil ---If false, the building effect smoke will not be shown around the new entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field create_build_effect_smoke boolean|nil ---If true, entity types that have spawn_decorations property will apply triggers defined in the property. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field spawn_decorations boolean|nil ---If true, any characters that are in the way of the entity are teleported out of the way. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field move_stuck_players boolean|nil ---If provided, the entity will attempt to pull stored values from this item (for example; creating a spidertron from a previously named and mined spidertron) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field item LuaItemStack|nil ---Applies to **"assembling-machine"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field recipe string|nil ---Applies to **"beam"**: (optional) ---Absolute target position that can be used instead of target entity (entity has precedence if both entity and position are defined). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field target_position Position|nil ---Applies to **"beam"**: (optional) ---Absolute source position that can be used instead of source entity (entity has precedence if both entity and position are defined). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field source_position Position|nil ---Applies to **"beam"**: (optional) ---If set, beam will be destroyed when distance between source and target is greater than this value. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field max_length uint|nil ---Applies to **"beam"**: (optional) ---If set, beam will be destroyed after this value of ticks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field duration uint|nil ---Applies to **"beam"**: (optional) ---Source position will be offset by this value when rendering the beam. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field source_offset Vector|nil ---Applies to **"container"**: (optional) ---Inventory index where the red limiting bar should be set. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field bar uint|nil ---Applies to **"cliff"**: (optional) ---If not specified, `direction` will be used instead. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field cliff_orientation CliffOrientation|nil ---Applies to **"flying-text"**: (required) ---The string to show. --- ---Applies to **"speech-bubble"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field text LocalisedString ---Applies to **"flying-text"**: (optional) ---Color of the displayed text. --- ---Applies to **"rolling-stock"**: (optional) ---The color of this rolling stock, if it supports colors. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field color Color|nil ---Applies to **"flying-text"**: (optional) --- ---Applies to **"highlight-box"**: (optional) ---The player to render the highlight box for. If not provided, it will be rendered for all players. --- ---Applies to **"simple-entity-with-owner"**: (optional) --- ---Applies to **"simple-entity-with-force"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field render_player_index uint|nil ---Applies to **"entity-ghost"**: (required) ---The prototype name of the entity contained in the ghost. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field inner_name string ---Applies to **"entity-ghost"**: (optional) ---If `false` the ghost entity will not expire. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field expires boolean|nil ---Applies to **"fire"**: (optional) ---With how many small flames should the fire on ground be created. Defaults to the initial flame count of the prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field initial_ground_flame_count uint8|nil ---Applies to **"inserter"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field conditions InserterCircuitConditions ---Applies to **"inserter"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field filters InventoryFilter[] ---Applies to **"item-entity"**: (required) ---The stack of items to create. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field stack SimpleItemStack ---Applies to **"item-request-proxy"**: (required) ---The stacks of items to be delivered to target entity from logistic network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field modules table ---Applies to **"rolling-stock"**: (optional) ---The orientation of this rolling stock. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field orientation RealOrientation|nil ---Applies to **"locomotive"**: (optional) ---Whether the locomotive should snap to an adjacent train stop. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field snap_to_train_stop boolean|nil ---Applies to **"logistic-container"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field request_filters InventoryFilter[]|nil ---Applies to **"particle"**: (required) --- ---Applies to **"artillery-flare"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field movement Vector ---Applies to **"particle"**: (required) --- ---Applies to **"artillery-flare"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field height float ---Applies to **"particle"**: (required) --- ---Applies to **"artillery-flare"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field vertical_speed float ---Applies to **"particle"**: (required) --- ---Applies to **"artillery-flare"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field frame_speed float ---Applies to **"projectile"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field speed double ---Applies to **"projectile"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field max_range double ---Applies to **"resource"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field amount uint ---Applies to **"resource"**: (optional) ---If colliding trees are removed normally for this resource entity based off the prototype tree removal values. Default is true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field enable_tree_removal boolean|nil ---Applies to **"resource"**: (optional) ---If colliding cliffs are removed. Default is true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field enable_cliff_removal boolean|nil ---Applies to **"resource"**: (optional) ---If true, the resource entity will be placed to center of a tile as map generator would place it, otherwise standard non-resource grid alignment rules will apply. Default is true. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field snap_to_tile_center boolean|nil ---Applies to **"underground-belt"**: (optional) ---`"output"` or `"input"`; default is `"input"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field type string|nil ---Applies to **"programmable-speaker"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field parameters ProgrammableSpeakerParameters|nil ---Applies to **"programmable-speaker"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field alert_parameters ProgrammableSpeakerAlertParameters|nil ---Applies to **"character-corpse"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field inventory_size uint|nil ---Applies to **"character-corpse"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field player_index uint|nil ---Applies to **"highlight-box"**: (optional) ---The bounding box defining the highlight box using absolute map coordinates. If specified, the `position` parameter is ignored, but needs to be present anyways. If not specified, the game falls back to the `source` parameter first, then the `target` parameter second. One of these three parameters need to be specified. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field bounding_box BoundingBox>|nil ---Applies to **"highlight-box"**: (optional) ---Specifies the graphical appearance (color) of the highlight box. Defaults to `"electricity"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field box_type CursorBoxRenderType|nil ---Applies to **"highlight-box"**: (optional) ---The blink interval for this highlight box. Makes it be shown every `blink_interval` ticks. Defaults to `0` (constantly shown). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field blink_interval uint|nil ---Applies to **"highlight-box"**: (optional) ---The amount of time in ticks that the highlight box will exist for. Defaults to existing forever. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field time_to_live uint|nil ---Applies to **"speech-bubble"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) ---@field lifetime uint|nil ---Create an entity on this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity) --- ---### Example ---``` ---asm = game.surfaces[1].create_entity{name = "assembling-machine-1", position = {15, 3}, force = game.forces.player, recipe = "iron-stick"} ---``` --- ---### Example ---Creates a filter inserter with circuit conditions and a filter ---``` ---game.surfaces[1].create_entity{ --- name = "filter-inserter", position = {20, 15}, force = game.player.force, --- conditions = {red = {name = "wood", count = 3, operator = ">"}, --- green = {name = "iron-ore", count = 1, operator = "<"}, --- logistics = {name = "wood", count = 3, operator = "="}}, --- filters = {{index = 1, name = "iron-ore"}} ---} ---``` --- ---### Example ---Creates a requester chest already set to request 128 iron plates. ---``` ---game.surfaces[1].create_entity{ --- name = "logistic-chest-requester", position = {game.player.position.x+3, game.player.position.y}, --- force = game.player.force, request_filters = {{index = 1, name = "iron-plate", count = 128}} ---} ---``` --- ---### Example ---``` ---game.surfaces[1].create_entity{name = "big-biter", position = {15, 3}, force = game.forces.player} -- Friendly biter ---game.surfaces[1].create_entity{name = "medium-biter", position = {15, 3}, force = game.forces.enemy} -- Enemy biter ---``` --- ---### Example ---Creates a basic inserter at the player's location facing north ---``` ---game.surfaces[1].create_entity{name = "inserter", position = game.player.position, direction = defines.direction.north} ---``` ---@param param LuaSurface.create_entity_param ---@return LuaEntity@The created entity or `nil` if the creation failed. create_entity=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_particle) ---@class LuaSurface.create_particle_param ---The particle name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_particle) ---@field name string ---Where to create the particle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_particle) ---@field position Position ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_particle) ---@field movement Vector ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_particle) ---@field height float ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_particle) ---@field vertical_speed float ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_particle) ---@field frame_speed float ---Creates a particle at the given location --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_particle) ---@param param LuaSurface.create_particle_param create_particle=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_trivial_smoke) ---@class LuaSurface.create_trivial_smoke_param ---The smoke prototype name to create. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_trivial_smoke) ---@field name string ---Where to create the smoke. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_trivial_smoke) ---@field position Position ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_trivial_smoke) ---@param param LuaSurface.create_trivial_smoke_param create_trivial_smoke=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_unit_group) ---@class LuaSurface.create_unit_group_param ---Initial position of the new unit group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_unit_group) ---@field position Position ---Force of the new unit group. Defaults to `"enemy"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_unit_group) ---@field force ForceIdentification|nil ---Create a new unit group at a given position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_unit_group) ---@param param LuaSurface.create_unit_group_param ---@return LuaUnitGroup create_unit_group=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.deconstruct_area) ---@class LuaSurface.deconstruct_area_param ---The area to mark for deconstruction. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.deconstruct_area) ---@field area BoundingBox> ---The force whose bots should perform the deconstruction. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.deconstruct_area) ---@field force ForceIdentification ---The player to set the last_user to if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.deconstruct_area) ---@field player PlayerIdentification|nil ---If chunks covered by fog-of-war are skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.deconstruct_area) ---@field skip_fog_of_war boolean|nil ---The deconstruction item to use if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.deconstruct_area) ---@field item LuaItemStack|nil ---Place a deconstruction request. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.deconstruct_area) ---@param param LuaSurface.deconstruct_area_param deconstruct_area=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.decorative_prototype_collides) ---@param prototype string@The decorative prototype to check ---@param position Position@The position to check decorative_prototype_collides=function(prototype,position)end, ---**Note:** This won't delete the chunk immediately. Chunks are deleted at the end of the current tick. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.delete_chunk) ---@param position ChunkPosition@The chunk position to delete delete_chunk=function(position)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.destroy_decoratives) ---@class LuaSurface.destroy_decoratives_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.destroy_decoratives) ---@field area BoundingBox>|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.destroy_decoratives) ---@field position TilePosition|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.destroy_decoratives) ---@field name string|string[]|LuaDecorativePrototype|LuaDecorativePrototype[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.destroy_decoratives) ---@field limit uint|nil ---If the filters should be inverted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.destroy_decoratives) ---@field invert boolean|nil ---Removes all decoratives from the given area. If no area and no position are given, then the entire surface is searched. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.destroy_decoratives) ---@param param LuaSurface.destroy_decoratives_param destroy_decoratives=function(param)end, ---Sets the given script area to the new values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.edit_script_area) ---@param id uint@The area to edit. ---@param area ScriptArea edit_script_area=function(id,area)end, ---Sets the given script position to the new values. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.edit_script_position) ---@param id uint@The position to edit. ---@param area ScriptPosition edit_script_position=function(id,area)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.entity_prototype_collides) ---@param prototype EntityPrototypeIdentification@The entity prototype to check ---@param position Position@The position to check ---@param use_map_generation_bounding_box boolean@If the map generation bounding box should be used instead of the collision bounding box ---@param direction?defines.direction entity_prototype_collides=function(prototype,position,use_map_generation_bounding_box,direction)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_decoratives_filtered) ---@class LuaSurface.find_decoratives_filtered_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_decoratives_filtered) ---@field area BoundingBox>|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_decoratives_filtered) ---@field position TilePosition|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_decoratives_filtered) ---@field name string|string[]|LuaDecorativePrototype|LuaDecorativePrototype[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_decoratives_filtered) ---@field limit uint|nil ---If the filters should be inverted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_decoratives_filtered) ---@field invert boolean|nil ---Find decoratives of a given name in a given area. ---If no filters are given, returns all decoratives in the search area. If multiple filters are specified, returns only decoratives matching every given filter. If no area and no position are given, the entire surface is searched. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_decoratives_filtered) --- ---### Example ---``` ---game.surfaces[1].find_decoratives_filtered{area = {{-10, -10}, {10, 10}}, name = "sand-decal"} -- gets all sand-decals in the rectangle ---game.surfaces[1].find_decoratives_filtered{area = {{-10, -10}, {10, 10}}, limit = 5} -- gets the first 5 decoratives in the rectangle ---``` ---@param param LuaSurface.find_decoratives_filtered_param ---@return DecorativeResult[] find_decoratives_filtered=function(param)end, ---Find enemy units (entities with type "unit") of a given force within an area. --- ---**Note:** This is more efficient than [LuaSurface::find_entities](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_enemy_units) --- ---### Example ---Find all units who would be interested to attack the player, within 100-tile area. ---``` ---local enemies = game.player.surface.find_enemy_units(game.player.position, 100) ---``` ---@param center Position@Center of the search area ---@param radius double@Radius of the circular search area ---@param force?LuaForce|string@Force to find enemies of. If not given, uses the player force. ---@return LuaEntity[] find_enemy_units=function(center,radius,force)end, ---Find entities in a given area. ---If no area is given all entities on the surface are returned. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities) --- ---### Example ---Will evaluate to a list of all entities within given area. ---``` ---game.surfaces["nauvis"].find_entities({{-10, -10}, {10, 10}}) ---``` ---@param area?BoundingBox> ---@return LuaEntity[] find_entities=function(area)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@class LuaSurface.find_entities_filtered_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field area BoundingBox>|nil ---Has precedence over area field. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field position Position|nil ---If given with position, will return all entities within the radius of the position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field radius double|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field name string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field type string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field ghost_name string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field ghost_type string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field direction defines.direction|defines.direction[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field collision_mask CollisionMaskLayer|CollisionMaskLayer[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field force ForceIdentification|ForceIdentification[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field to_be_deconstructed boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field to_be_upgraded boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field limit uint|nil ---If the filters should be inverted. These filters are: name, type, ghost_name, ghost_type, direction, collision_mask, force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) ---@field invert boolean|nil ---Find entities of given type or name in a given area. ---If no filters (`name`, `type`, `force`, etc.) are given, returns all entities in the search area. If multiple filters are specified, returns only entities matching all given filters. ---If no area or position are given, then the entire surface is searched. If position is given, returns entities colliding with that position (i.e the given position is within the entity's collision box). If position and radius are given, returns entities in that radius of the position. If area is specified, returns entities colliding with that area. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered) --- ---### Example ---``` ---game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, type = "resource"} -- gets all resources in the rectangle ---game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, name = "iron-ore"} -- gets all iron ores in the rectangle ---game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, name = {"iron-ore", "copper-ore"}} -- gets all iron ore and copper ore in the rectangle ---game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, force = "player"} -- gets player owned entities in the rectangle ---game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, limit = 5} -- gets the first 5 entities in the rectangle ---game.surfaces[1].find_entities_filtered{position = {0, 0}, radius = 10} -- gets all entities within 10 tiles of the position [0,0]. ---``` ---@param param LuaSurface.find_entities_filtered_param ---@return LuaEntity[] find_entities_filtered=function(param)end, ---Find a specific entity at a specific position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entity) --- ---### Example ---``` ---game.player.selected.surface.find_entity('filter-inserter', {0,0}) ---``` ---@param entity string@Entity to look for ---@param position Position@Coordinates to look at ---@return LuaEntity@Will be `nil` if no such entity is found. find_entity=function(entity,position)end, ---Find the logistic network that covers a given position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_logistic_network_by_position) ---@param position Position ---@param force ForceIdentification@Force the logistic network should belong to. ---@return LuaLogisticNetwork@The found network or `nil` if no such network was found. find_logistic_network_by_position=function(position,force)end, ---Finds all of the logistics networks whose construction area intersects with the given position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_logistic_networks_by_construction_area) ---@param position Position ---@param force ForceIdentification@Force the logistic networks should belong to. ---@return LuaLogisticNetwork[] find_logistic_networks_by_construction_area=function(position,force)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_nearest_enemy) ---@class LuaSurface.find_nearest_enemy_param ---Center of the search area. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_nearest_enemy) ---@field position Position ---Radius of the circular search area. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_nearest_enemy) ---@field max_distance double ---The force the result will be an enemy of. Uses the player force if not specified. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_nearest_enemy) ---@field force ForceIdentification|nil ---Find the enemy entity-with-force ([military entity](https://wiki.factorio.com/Military_units_and_structures)) closest to the given position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_nearest_enemy) ---@param param LuaSurface.find_nearest_enemy_param ---@return LuaEntity@The nearest enemy entity-with-force or `nil` if no enemy could be found within the given area. find_nearest_enemy=function(param)end, ---Find a non-colliding position within a given radius. --- ---**Note:** Special care needs to be taken when using a radius of `0`. The game will not stop searching until it finds a suitable position, so it is important to make sure such a position exists. One particular case where it would not be able to find a solution is running it before any chunks have been generated. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_non_colliding_position) ---@param name string@Prototype name of the entity to find a position for. (The bounding box for the collision checking is taken from this prototype.) ---@param center Position@Center of the search area. ---@param radius double@Max distance from `center` to search in. A radius of `0` means an infinitely-large search area. ---@param precision double@The step length from the given position as it searches, in tiles. Minimum value is `0.01`. ---@param force_to_tile_center?boolean@Will only check tile centers. This can be useful when your intent is to place a building at the resulting position, as they must generally be placed at tile centers. Default false. ---@return Position@The non-colliding position. May be `nil` if no suitable position was found. find_non_colliding_position=function(name,center,radius,precision,force_to_tile_center)end, ---Find a non-colliding position within a given rectangle. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_non_colliding_position_in_box) ---@param name string@Prototype name of the entity to find a position for. (The bounding box for the collision checking is taken from this prototype.) ---@param search_space BoundingBox>@The rectangle to search inside. ---@param precision double@The step length from the given position as it searches, in tiles. Minimum value is 0.01. ---@param force_to_tile_center?boolean@Will only check tile centers. This can be useful when your intent is to place a building at the resulting position, as they must generally be placed at tile centers. Default false. ---@return Position@The non-colliding position. May be `nil` if no suitable position was found. find_non_colliding_position_in_box=function(name,search_space,precision,force_to_tile_center)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered) ---@class LuaSurface.find_tiles_filtered_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered) ---@field area BoundingBox>|nil ---Ignored if not given with radius. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered) ---@field position Position|nil ---If given with position, will return all entities within the radius of the position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered) ---@field radius double|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered) ---@field name string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered) ---@field limit uint|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered) ---@field has_hidden_tile boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered) ---@field collision_mask CollisionMaskLayer|CollisionMaskLayer[]|nil ---Find tiles of a given name in a given area. ---If no filters are given returns all tiles in the search area. ---If no area or position and radius is given, then the entire surface is searched. If position and radius are given, only tiles within the radius of the position are included. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_tiles_filtered) ---@param param LuaSurface.find_tiles_filtered_param ---@return LuaTile[] find_tiles_filtered=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_units) ---@class LuaSurface.find_units_param ---Box to find units within. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_units) ---@field area BoundingBox> ---Force performing the search. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_units) ---@field force LuaForce|string ---Only forces which meet the condition will be included in the search. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_units) ---@field condition ForceCondition ---Find units (entities with type "unit") of a given force and force condition within a given area. --- ---**Note:** This is more efficient than [LuaSurface::find_entities](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_units) --- ---### Example ---Find friendly units to "player" force ---``` ---local friendly_units = game.player.surface.find_units({area = {{-10, -10},{10, 10}}, force = "player", condition = "friend") ---``` --- ---### Example ---Find units of "player" force ---``` ---local units = game.player.surface.find_units({area = {{-10, -10},{10, 10}}, force = "player", condition = "same"}) ---``` ---@param param LuaSurface.find_units_param ---@return LuaEntity[] find_units=function(param)end, ---Blocks and generates all chunks that have been requested using all available threads. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.force_generate_chunk_requests) force_generate_chunk_requests=function()end, ---Get an iterator going over every chunk on this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_chunks) ---@return LuaChunkIterator get_chunks=function()end, ---Gets the closest entity in the list to this position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_closest) ---@param position Position ---@param entities LuaEntity[]@The Entities to check ---@return LuaEntity get_closest=function(position,entities)end, ---Gets all tiles of the given types that are connected horizontally or vertically to the given tile position including the given tile position. --- ---**Note:** This won't find tiles in non-generated chunks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_connected_tiles) ---@param position Position@The tile position to start at. ---@param tiles string[]@The tiles to search for. ---@return Position[]@The resulting set of tiles. get_connected_tiles=function(position,tiles)end, ---Returns all the entities with force on this chunk for the given force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_entities_with_force) ---@param position ChunkPosition@The chunk's position. ---@param force LuaForce|string@Entities of this force will be returned. ---@return LuaEntity[] get_entities_with_force=function(position,force)end, ---The hidden tile name or `nil` if there isn't one for the given position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_hidden_tile) ---@param position TilePosition@The tile position. ---@return string get_hidden_tile=function(position)end, ---Gets the map exchange string for the current map generation settings of this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_map_exchange_string) ---@return string get_map_exchange_string=function()end, ---Get the pollution for a given position. --- ---**Note:** Pollution is stored per chunk, so this will return the same value for all positions in one chunk. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_pollution) --- ---### Example ---``` ---game.surfaces[1].get_pollution({1,2}) ---``` ---@param position Position ---@return double get_pollution=function(position)end, ---Gets a random generated chunk position or 0,0 if no chunks have been generated on this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_random_chunk) ---@return ChunkPosition get_random_chunk=function()end, ---Gets the resource amount of all resources on this surface --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_resource_counts) ---@return table get_resource_counts=function()end, ---Gets the first script area by name or id. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_script_area) ---@param key?string|uint@The name or id of the area to get. ---@return ScriptArea get_script_area=function(key)end, ---Gets the script areas that match the given name or if no name is given all areas are returned. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_script_areas) ---@param name?string ---@return ScriptArea[] get_script_areas=function(name)end, ---Gets the first script position by name or id. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_script_position) ---@param key?string|uint@The name or id of the position to get. ---@return ScriptPosition get_script_position=function(key)end, ---Gets the script positions that match the given name or if no name is given all positions are returned. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_script_positions) ---@param name?string ---@return ScriptPosition[] get_script_positions=function(name)end, ---Gets the starting area radius of this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_starting_area_radius) ---@return double get_starting_area_radius=function()end, ---Get the tile at a given position. --- ---**Note:** The input position params can also be a single tile position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_tile) ---@param x int ---@param y int ---@return LuaTile get_tile=function(x,y)end, ---Gets the total amount of pollution on the surface by iterating over all of the chunks containing pollution. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_total_pollution) ---@return double get_total_pollution=function()end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_train_stops) ---@class LuaSurface.get_train_stops_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_train_stops) ---@field name string|string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_train_stops) ---@field force ForceIdentification|nil ---Gets train stops matching the given filters. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_train_stops) ---@param param?LuaSurface.get_train_stops_param ---@return LuaEntity[] get_train_stops=function(param)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_trains) ---@param force?ForceIdentification@If given only trains matching this force are returned. ---@return LuaTrain[] get_trains=function(force)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.help) ---@return string help=function()end, ---Is a given chunk generated? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.is_chunk_generated) ---@param position ChunkPosition@The chunk's position. ---@return boolean is_chunk_generated=function(position)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.play_sound) ---@class LuaSurface.play_sound_param ---The sound to play. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.play_sound) ---@field path SoundPath ---Where the sound should be played. If not given, it's played at the current position of each player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.play_sound) ---@field position Position|nil ---The volume of the sound to play. Must be between 0 and 1 inclusive. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.play_sound) ---@field volume_modifier double|nil ---The volume mixer to play the sound through. Defaults to the default mixer for the given sound type. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.play_sound) ---@field override_sound_type SoundType|nil ---Play a sound for every player on this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.play_sound) ---@param param LuaSurface.play_sound_param play_sound=function(param)end, ---Spawn pollution at the given position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.pollute) ---@param source Position@Where to spawn the pollution. ---@param amount double@How much pollution to add. pollute=function(source,amount)end, ---Print text to the chat console of all players on this surface. --- ---**Note:** Messages that are identical to a message sent in the last 60 ticks are not printed again. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.print) ---@param message LocalisedString ---@param color?Color print=function(message,color)end, ---Regenerate autoplacement of some decoratives on this surface. This can be used to autoplace newly-added decoratives. --- ---**Note:** All specified decorative prototypes must be autoplacable. If nothing is given all decoratives are generated on all chunks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.regenerate_decorative) ---@param decoratives?string|string[]@Prototype names of decorative or decoratives to autoplace. When `nil` all decoratives with an autoplace are used. ---@param chunks?ChunkPosition[]@The chunk positions to regenerate the entities on. If not given all chunks are regenerated. Note chunks with status < entities are ignored. regenerate_decorative=function(decoratives,chunks)end, ---Regenerate autoplacement of some entities on this surface. This can be used to autoplace newly-added entities. --- ---**Note:** All specified entity prototypes must be autoplacable. If nothing is given all entities are generated on all chunks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.regenerate_entity) ---@param entities?string|string[]@Prototype names of entity or entities to autoplace. When `nil` all entities with an autoplace are used. ---@param chunks?ChunkPosition[]@The chunk positions to regenerate the entities on. If not given all chunks are regenerated. Note chunks with status < entities are ignored. regenerate_entity=function(entities,chunks)end, ---Removes the given script area. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.remove_script_area) ---@param id uint ---@return boolean@If the area was actually removed. False when it didn't exist. remove_script_area=function(id)end, ---Removes the given script position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.remove_script_position) ---@param id uint ---@return boolean@If the position was actually removed. False when it didn't exist. remove_script_position=function(id)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@class LuaSurface.request_path_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field bounding_box BoundingBox> ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field collision_mask CollisionMask|string[] ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field start Position ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field goal Position ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field force LuaForce|string ---How close we need to get to the goal. Default 1. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field radius double|nil ---Flags to affect the pathfinder. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field pathfind_flags PathfinderFlags|nil ---If the path request can open gates. Default false. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field can_open_gates boolean|nil ---The resolution modifier of the pathing. Defaults to 0. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field path_resolution_modifier int|nil ---If given, the pathfind will ignore collisions with this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@field entity_to_ignore LuaEntity|nil ---Starts a path find request without actually ordering a unit to move. Result is ultimately returned asynchronously via [on_script_path_request_finished](https://lua-api.factorio.com/latest/events.html#on_script_path_request_finished). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_path) ---@param param LuaSurface.request_path_param ---@return uint@A unique handle to identify this call when [on_script_path_request_finished](https://lua-api.factorio.com/latest/events.html#on_script_path_request_finished) fires. request_path=function(param)end, ---Request that the game's map generator generate chunks at the given position for the given radius on this surface. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.request_to_generate_chunks) ---@param position Position@Where to generate the new chunks. ---@param radius uint@The chunk radius from `position` to generate new chunks in. request_to_generate_chunks=function(position,radius)end, ---Set generated status of a chunk. Useful when copying chunks. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_chunk_generated_status) ---@param position ChunkPosition@The chunk's position. ---@param status defines.chunk_generated_status@The chunk's new status. set_chunk_generated_status=function(position,status)end, ---Set the hidden tile for the specified position. While during normal gameplay only [non-mineable](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.mineable_properties) tiles can become hidden, this method allows any kind of tile to be set as the hidden one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_hidden_tile) ---@param position TilePosition@The tile position. ---@param tile string|LuaTilePrototype@The new hidden tile or `nil` to clear the hidden tile. set_hidden_tile=function(position,tile)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_multi_command) ---@class LuaSurface.set_multi_command_param ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_multi_command) ---@field command Command ---Number of units to give the command to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_multi_command) ---@field unit_count uint ---Force of the units this command is to be given to. If not specified, uses the enemy force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_multi_command) ---@field force ForceIdentification|nil ---Radius to search for units. The search area is centered on the destination of the command. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_multi_command) ---@field unit_search_distance uint|nil ---Give a command to multiple units. This will automatically select suitable units for the task. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_multi_command) ---@param param LuaSurface.set_multi_command_param ---@return uint@Number of units actually sent. May be less than `count` if not enough units were available. set_multi_command=function(param)end, ---Set tiles at specified locations. Can automatically correct the edges around modified tiles. ---Placing a [mineable](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.mineable_properties) tile on top of a non-mineable one will turn the latter into the [LuaTile::hidden_tile](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.hidden_tile) for that tile. Placing a mineable tile on a mineable one or a non-mineable tile on a non-mineable one will not modify the hidden tile. This restriction can however be circumvented by using [LuaSurface::set_hidden_tile](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_hidden_tile). --- ---**Note:** It is recommended to call this method once for all the tiles you want to change rather than calling it individually for every tile. As the tile correction is used after every step, calling it one by one could cause the tile correction logic to redo some of the changes. Also, many small API calls are generally more performance intensive than one big one. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_tiles) ---@param tiles Tile[] ---@param correct_tiles?boolean@If `false`, the correction logic is not applied to the changed tiles. Defaults to `true`. ---@param remove_colliding_entities?boolean|string@`true`, `false`, or `abort_on_collision`. Defaults to `true`. ---@param remove_colliding_decoratives?boolean@`true` or `false`. Defaults to `true`. ---@param raise_event?boolean@`true` or `false`. Defaults to `false`. set_tiles=function(tiles,correct_tiles,remove_colliding_entities,remove_colliding_decoratives,raise_event)end, ---Spill items on the ground centered at a given location. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.spill_item_stack) ---@param position Position@Center of the spillage ---@param items ItemStackIdentification@Items to spill ---@param enable_looted?boolean@When true, each created item will be flagged with the [LuaEntity::to_be_looted](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.to_be_looted) flag. ---@param force?LuaForce|string@When provided (and not `nil`) the items will be marked for deconstruction by this force. ---@param allow_belts?boolean@Whether items can be spilled onto belts. Defaults to `true`. ---@return LuaEntity[]@The created item-on-ground entities. spill_item_stack=function(position,items,enable_looted,force,allow_belts)end, ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.upgrade_area) ---@class LuaSurface.upgrade_area_param ---The area to mark for upgrade. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.upgrade_area) ---@field area BoundingBox> ---The force whose bots should perform the upgrade. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.upgrade_area) ---@field force ForceIdentification ---The player to set the last_user to if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.upgrade_area) ---@field player PlayerIdentification|nil ---If chunks covered by fog-of-war are skipped. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.upgrade_area) ---@field skip_fog_of_war boolean|nil ---The upgrade item to use. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.upgrade_area) ---@field item LuaItemStack ---Place an upgrade request. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.upgrade_area) ---@param param LuaSurface.upgrade_area_param upgrade_area=function(param)end, } ---One research item. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html) ---@class LuaTechnology ---[R] ---Effects applied when this technology is researched. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.effects) ---@field effects TechnologyModifier[] ---[RW] ---Can this technology be researched? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.enabled) ---@field enabled boolean ---[R] ---The force this technology belongs to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.force) ---@field force LuaForce ---[RW] ---The current level of this technology. For level-based technology writing to this is the same as researching the technology to the *previous* level. Writing the level will set [LuaTechnology::enabled](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.enabled) to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.level) ---@field level uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.localised_description) ---@field localised_description LocalisedString ---[R] ---Localised name of this technology. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this technology. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.object_name) ---@field object_name string ---[R] ---Order string for this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.order) ---@field order string ---[R] ---Prerequisites of this technology. The result maps technology name to the [LuaTechnology](https://lua-api.factorio.com/latest/LuaTechnology.html) object. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.prerequisites) ---@field prerequisites table ---[R] ---The prototype of this technology. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.prototype) ---@field prototype LuaTechnologyPrototype ---[R] ---Number of research units required for this technology. --- ---**Note:** This is multiplied by the current research cost multiplier, unless [LuaTechnologyPrototype::ignore_tech_cost_multiplier](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.ignore_tech_cost_multiplier) is `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.research_unit_count) --- ---### See also ---- [LuaTechnology::research_unit_ingredients](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.research_unit_ingredients) ---@field research_unit_count uint ---[R] ---The count formula used for this infinite research or nil if this isn't an infinite research. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.research_unit_count_formula) --- ---### See also ---- [LuaGameScript::evaluate_expression](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.evaluate_expression) ---@field research_unit_count_formula string ---[R] ---Amount of energy required to finish a unit of research. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.research_unit_energy) ---@field research_unit_energy double ---[R] ---Ingredients labs will require to research this technology. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.research_unit_ingredients) --- ---### See also ---- [LuaTechnology::research_unit_count](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.research_unit_count) ---@field research_unit_ingredients Ingredient[] ---[RW] ---Has this technology been researched? Switching from `false` to `true` will trigger the technology advancement perks; switching from `true` to `false` will reverse them. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.researched) ---@field researched boolean ---[R] ---Is this an upgrade-type research? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.upgrade) ---@field upgrade boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.valid) ---@field valid boolean ---[RW] ---If this technology will be visible in the research GUI even though it is disabled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.visible_when_disabled) ---@field visible_when_disabled boolean local LuaTechnology={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.help) ---@return string help=function()end, ---Reload this technology from its prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.reload) reload=function()end, } ---A Technology prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html) ---@class LuaTechnologyPrototype ---[R] ---Effects applied when this technology is researched. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.effects) ---@field effects TechnologyModifier[] ---[R] ---If this technology prototype is enabled by default (enabled at the beginning of a game). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.enabled) ---@field enabled boolean ---[R] ---If this technology prototype is hidden. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.hidden) ---@field hidden boolean ---[R] ---If this technology ignores the technology cost multiplier setting. --- ---**Note:** [LuaTechnologyPrototype::research_unit_count](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_count) will already take this setting into account. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.ignore_tech_cost_multiplier) ---@field ignore_tech_cost_multiplier boolean ---[R] ---The level of this research. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.level) ---@field level uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.localised_description) ---@field localised_description LocalisedString ---[R] ---Localised name of this technology. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---The max level of this research. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.max_level) ---@field max_level uint ---[R] ---Name of this technology. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.object_name) ---@field object_name string ---[R] ---Order string for this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.order) ---@field order string ---[R] ---Prerequisites of this technology. The result maps technology name to the [LuaTechnologyPrototype](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html) object. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.prerequisites) ---@field prerequisites table ---[R] ---Number of research units required for this technology. --- ---**Note:** This is multiplied by the current research cost multiplier, unless [LuaTechnologyPrototype::ignore_tech_cost_multiplier](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.ignore_tech_cost_multiplier) is `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_count) --- ---### See also ---- [LuaTechnologyPrototype::research_unit_ingredients](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_ingredients) ---@field research_unit_count uint ---[R] ---The count formula used for this infinite research or nil if this isn't an infinite research. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_count_formula) --- ---### See also ---- [LuaGameScript::evaluate_expression](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.evaluate_expression) ---@field research_unit_count_formula string ---[R] ---Amount of energy required to finish a unit of research. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_energy) ---@field research_unit_energy double ---[R] ---Ingredients labs will require to research this technology. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_ingredients) --- ---### See also ---- [LuaTechnologyPrototype::research_unit_count](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_count) ---@field research_unit_ingredients Ingredient[] ---[R] ---If the is technology prototype is an upgrade to some other technology. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.upgrade) ---@field upgrade boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.valid) ---@field valid boolean ---[R] ---If this technology will be visible in the research GUI even though it is disabled. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.visible_when_disabled) ---@field visible_when_disabled boolean local LuaTechnologyPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.help) ---@return string help=function()end, } ---A single "square" on the map. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html) ---@class LuaTile ---[R] ---The name of the [LuaTilePrototype](https://lua-api.factorio.com/latest/LuaTilePrototype.html) hidden under this tile or `nil` if there is no hidden tile. During normal gameplay, only [non-mineable](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.mineable_properties) tiles can become hidden. This can however be circumvented with [LuaSurface::set_hidden_tile](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.set_hidden_tile). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.hidden_tile) ---@field hidden_tile string ---[R] ---Prototype name of this tile. E.g. `"sand-3"` or `"grass-2"`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.object_name) ---@field object_name string ---[R] ---The position this tile references. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.position) ---@field position Position ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.prototype) ---@field prototype LuaTilePrototype ---[R] ---The surface this tile is on. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.surface) ---@field surface LuaSurface ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.valid) ---@field valid boolean local LuaTile={ ---Cancels deconstruction if it is scheduled, does nothing otherwise. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.cancel_deconstruction) ---@param force ForceIdentification@The force who did the deconstruction order. ---@param player?PlayerIdentification@The player to set the last_user to if any. cancel_deconstruction=function(force,player)end, ---What type of things can collide with this tile? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.collides_with) --- ---### Example ---Check if the character would collide with a tile ---``` ---game.player.print(tostring(game.player.surface.get_tile(1, 1).collides_with("player-layer"))) ---``` ---@param layer CollisionMaskLayer ---@return boolean collides_with=function(layer)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.help) ---@return string help=function()end, ---Orders deconstruction of this tile by the given force. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.order_deconstruction) ---@param force ForceIdentification@The force whose robots are supposed to do the deconstruction. ---@param player?PlayerIdentification@The player to set the last_user to if any. ---@return LuaEntity@The deconstructible tile proxy created if any or `nil`. order_deconstruction=function(force,player)end, ---Is this tile marked for deconstruction? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.to_be_deconstructed) ---@return boolean to_be_deconstructed=function()end, } ---Prototype of a tile. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html) ---@class LuaTilePrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.allowed_neighbors) ---@field allowed_neighbors table ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.automatic_neighbors) ---@field automatic_neighbors boolean ---[R] ---Autoplace specification for this prototype. `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.autoplace_specification) ---@field autoplace_specification AutoplaceSpecification ---[R] ---False if this tile is not allowed in blueprints regardless of the ability to build it. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.can_be_part_of_blueprint) ---@field can_be_part_of_blueprint boolean ---[R] ---The collision mask this tile uses --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.collision_mask) ---@field collision_mask CollisionMask ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.collision_mask_with_flags) ---@field collision_mask_with_flags CollisionMaskWithFlags ---[R] ---The probability that decorative entities will be removed from on top of this tile when this tile is generated. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.decorative_removal_probability) ---@field decorative_removal_probability float ---[R] ---Amount of pollution emissions per second this tile will absorb. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.emissions_per_second) ---@field emissions_per_second double ---[R] ---Items that when placed will produce this tile. It is a dictionary indexed by the item prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.items_to_place_this) ---@field items_to_place_this SimpleItemStack[] ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.layer) ---@field layer uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.localised_name) ---@field localised_name LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.map_color) ---@field map_color Color ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.mineable_properties) ---@field mineable_properties LuaTilePrototype.mineable_properties ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.name) ---@field name string ---[R] ---If this tile needs correction logic applied when it's generated in the world.. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.needs_correction) ---@field needs_correction boolean ---[R] ---The next direction of this tile or `nil` - used when a tile has multiple directions (such as hazard concrete) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.next_direction) ---@field next_direction LuaTilePrototype ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.order) ---@field order string ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.valid) ---@field valid boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.vehicle_friction_modifier) ---@field vehicle_friction_modifier float ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.walking_speed_modifier) ---@field walking_speed_modifier float local LuaTilePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.help) ---@return string help=function()end, } ---A train. Trains are a sequence of connected rolling stocks -- locomotives and wagons. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html) ---@class LuaTrain ---[R] ---The rail at the back end of the train, possibly `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.back_rail) ---@field back_rail LuaEntity ---[R] ---The back stock of this train or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.back_stock) ---@field back_stock LuaEntity ---[R] ---The cargo carriages the train contains. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.cargo_wagons) ---@field cargo_wagons LuaEntity[] ---[R] ---Rolling stocks the train is composed of. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.carriages) ---@field carriages LuaEntity[] ---[R] ---The fluid carriages the train contains. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.fluid_wagons) ---@field fluid_wagons LuaEntity[] ---[R] ---The rail at the front end of the train, possibly `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.front_rail) ---@field front_rail LuaEntity ---[R] ---The front stock of this train or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.front_stock) ---@field front_stock LuaEntity ---[R] ---If this train has a path. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.has_path) ---@field has_path boolean ---[R] ---The unique train ID. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.id) ---@field id uint ---[R] ---The total number of kills by this train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.kill_count) ---@field kill_count uint ---[R] ---The players killed by this train. ---The keys are the player indexes, the values are how often this train killed that player. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.killed_players) ---@field killed_players table ---[R] ---Arrays of locomotives. The result is two arrays, indexed by `"front_movers"` and `"back_movers"` containing the locomotives. E.g. `{front_movers={loco1, loco2}, back_movers={loco3}}`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.locomotives) ---@field locomotives table ---[RW] ---When `true`, the train is explicitly controlled by the player or script. When `false`, the train moves autonomously according to its schedule. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.manual_mode) ---@field manual_mode boolean ---[R] ---Current max speed when moving backwards, depends on locomotive prototype and fuel. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.max_backward_speed) ---@field max_backward_speed double ---[R] ---Current max speed when moving forward, depends on locomotive prototype and fuel. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.max_forward_speed) ---@field max_forward_speed double ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.object_name) ---@field object_name string ---[R] ---The player passengers on the train --- ---**Note:** This does *not* index using player index. See [LuaPlayer::index](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.index) on each player instance for the player index. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.passengers) ---@field passengers LuaPlayer[] ---[R] ---The path this train is using or `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.path) ---@field path LuaRailPath ---[R] ---The destination rail this train is currently pathing to or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.path_end_rail) ---@field path_end_rail LuaEntity ---[R] ---The destination train stop this train is currently pathing to or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.path_end_stop) ---@field path_end_stop LuaEntity ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.rail_direction_from_back_rail) ---@field rail_direction_from_back_rail defines.rail_direction ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.rail_direction_from_front_rail) ---@field rail_direction_from_front_rail defines.rail_direction ---[R] ---The riding state of this train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.riding_state) ---@field riding_state RidingState ---[RW] ---The trains current schedule or `nil` if empty. Set to `nil` to clear. --- ---**Note:** The schedule can't be changed by modifying the returned table. Instead, changes must be made by assigning a new table to this attribute. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.schedule) ---@field schedule TrainSchedule ---[R] ---The signal this train is arriving or waiting at or `nil` if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.signal) ---@field signal LuaEntity ---[RW] ---Current speed. --- ---**Note:** Changing the speed of the train is potentially an unsafe operation because train uses the speed for its internal calculations of break distances, etc. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.speed) ---@field speed double ---[R] ---This train's current state. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.state) ---@field state defines.train_state ---[R] ---The train stop this train is stopped at or `nil`. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.station) ---@field station LuaEntity ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.valid) ---@field valid boolean ---[R] ---The weight of this train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.weight) ---@field weight double local LuaTrain={ ---Clears all fluids in this train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.clear_fluids_inside) clear_fluids_inside=function()end, ---Clear all items in this train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.clear_items_inside) clear_items_inside=function()end, ---Get a mapping of the train's inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.get_contents) ---@return table@The counts, indexed by item names. get_contents=function()end, ---Gets a mapping of the train's fluid inventory. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.get_fluid_contents) ---@return table@The counts, indexed by fluid names. get_fluid_contents=function()end, ---Get the amount of a particular fluid stored in the train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.get_fluid_count) ---@param fluid?string@Fluid name to count. If not given, counts all fluids. ---@return double get_fluid_count=function(fluid)end, ---Get the amount of a particular item stored in the train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.get_item_count) ---@param item?string@Item name to count. If not given, counts all items. ---@return uint get_item_count=function(item)end, ---Gets all rails under the train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.get_rails) ---@return LuaEntity[] get_rails=function()end, ---Go to the station specified by the index in the train's schedule. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.go_to_station) ---@param index uint go_to_station=function(index)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.help) ---@return string help=function()end, ---Insert a stack into the train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.insert) ---@param stack ItemStackIdentification insert=function(stack)end, ---Inserts the given fluid into the first available location in this train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.insert_fluid) ---@param fluid Fluid ---@return double@The amount inserted. insert_fluid=function(fluid)end, ---Checks if the path is invalid and tries to re-path if it isn't. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.recalculate_path) ---@param force?boolean@Forces the train to re-path regardless of the current path being valid or not. ---@return boolean@If the train has a path after the repath attempt. recalculate_path=function(force)end, ---Remove some fluid from the train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.remove_fluid) ---@param fluid Fluid ---@return double@The amount of fluid actually removed. remove_fluid=function(fluid)end, ---Remove some items from the train. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.remove_item) ---@param stack ItemStackIdentification@The amount and type of items to remove ---@return uint@Number of items actually removed. remove_item=function(stack)end, } ---Control behavior for train stops. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html) ---@class LuaTrainStopControlBehavior:LuaGenericOnOffControlBehavior ---[RW] ---`true` if the train stop is enabled/disabled through the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.enable_disable) ---@field enable_disable boolean ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.object_name) ---@field object_name string ---[RW] ---`true` if the train stop should send the train contents to the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.read_from_train) ---@field read_from_train boolean ---[RW] ---`true` if the train stop should send the stopped train id to the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.read_stopped_train) ---@field read_stopped_train boolean ---[RW] ---`true` if the train stop should send amount of incoming trains to the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.read_trains_count) ---@field read_trains_count boolean ---[RW] ---`true` if the train stop should send the circuit network contents to the train to use. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.send_to_train) ---@field send_to_train boolean ---[RW] ---`true` if the trains_limit_signal is used to set a limit of trains incoming for train stop. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.set_trains_limit) ---@field set_trains_limit boolean ---[RW] ---The signal that will be sent when using the send-train-id option. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.stopped_train_signal) ---@field stopped_train_signal SignalID ---[RW] ---The signal that will be sent when using the read-trains-count option. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.trains_count_signal) ---@field trains_count_signal SignalID ---[RW] ---The signal to be used by set-trains-limit to limit amount of incoming trains --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.trains_limit_signal) ---@field trains_limit_signal SignalID ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.valid) ---@field valid boolean local LuaTrainStopControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrainStopControlBehavior.html#LuaTrainStopControlBehavior.help) ---@return string help=function()end, } ---Control behavior for transport belts. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportBeltControlBehavior.html) ---@class LuaTransportBeltControlBehavior:LuaGenericOnOffControlBehavior ---[RW] ---If the belt will be enabled/disabled based off the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportBeltControlBehavior.html#LuaTransportBeltControlBehavior.enable_disable) ---@field enable_disable boolean ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportBeltControlBehavior.html#LuaTransportBeltControlBehavior.object_name) ---@field object_name string ---[RW] ---If the belt will read the contents and send them to the circuit network. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportBeltControlBehavior.html#LuaTransportBeltControlBehavior.read_contents) ---@field read_contents boolean ---[RW] ---The read mode for the belt. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportBeltControlBehavior.html#LuaTransportBeltControlBehavior.read_contents_mode) ---@field read_contents_mode defines.control_behavior.transport_belt.content_read_mode ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportBeltControlBehavior.html#LuaTransportBeltControlBehavior.valid) ---@field valid boolean local LuaTransportBeltControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportBeltControlBehavior.html#LuaTransportBeltControlBehavior.help) ---@return string help=function()end, } ---One line on a transport belt. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html) ---@class LuaTransportLine ---[R] ---The transport lines that this transport line is fed by or an empty table if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.input_lines) ---@field input_lines LuaTransportLine[] ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.object_name) ---@field object_name string ---[R] ---The transport lines that this transport line outputs items to or an empty table if none. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.output_lines) ---@field output_lines LuaTransportLine[] ---[R] ---The entity this transport line belongs to. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.owner) ---@field owner LuaEntity ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.valid) ---@field valid boolean ---[R] ---The indexing operator. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.operator%20[]) ---@field __index LuaItemStack ---[R] ---Get the number of items on this transport line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.operator%20#) ---@field __len uint local LuaTransportLine={ ---Can an item be inserted at a given position? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.can_insert_at) ---@param position float@Where to insert an item. ---@return boolean can_insert_at=function(position)end, ---Can an item be inserted at the back of this line? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.can_insert_at_back) ---@return boolean can_insert_at_back=function()end, ---Remove all items from this transport line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.clear) clear=function()end, ---Get counts of all items on this line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.get_contents) --- ---### See also ---- [LuaInventory::get_contents](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_contents) ---@return table@The counts, indexed by item names. get_contents=function()end, ---Count some or all items on this line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.get_item_count) --- ---### See also ---- [LuaInventory::get_item_count](https://lua-api.factorio.com/latest/LuaInventory.html#LuaInventory.get_item_count) ---@param item?string@Prototype name of the item to count. If not specified, count all items. ---@return uint get_item_count=function(item)end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.help) ---@return string help=function()end, ---Insert items at a given position. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.insert_at) ---@param position float@Where on the line to insert the items. ---@param items ItemStackIdentification@Items to insert. ---@return boolean@Were the items inserted successfully? insert_at=function(position,items)end, ---Insert items at the back of this line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.insert_at_back) ---@param items ItemStackIdentification ---@return boolean@Were the items inserted successfully? insert_at_back=function(items)end, ---Returns whether the associated internal transport line of this line is the same as the others associated internal transport line. --- ---**Note:** This can return true even when the [LuaTransportLine::owner](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.owner)s are different (so `this == other` is false), because the internal transport lines can span multiple tiles. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.line_equals) ---@param other LuaTransportLine ---@return boolean line_equals=function(other)end, ---Remove some items from this line. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTransportLine.html#LuaTransportLine.remove_item) ---@param items ItemStackIdentification@Items to remove. ---@return uint@Number of items actually removed. remove_item=function(items)end, } ---Prototype of a trivial smoke. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html) ---@class LuaTrivialSmokePrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.affected_by_wind) ---@field affected_by_wind boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.color) ---@field color Color ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.cyclic) ---@field cyclic boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.duration) ---@field duration uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.end_scale) ---@field end_scale double ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.fade_away_duration) ---@field fade_away_duration uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.fade_in_duration) ---@field fade_in_duration uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.glow_animation) ---@field glow_animation boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.glow_fade_away_duration) ---@field glow_fade_away_duration uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.localised_name) ---@field localised_name LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.movement_slow_down_factor) ---@field movement_slow_down_factor double ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.order) ---@field order string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.render_layer) ---@field render_layer RenderLayer ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.show_when_smoke_off) ---@field show_when_smoke_off boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.spread_duration) ---@field spread_duration uint ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.start_scale) ---@field start_scale double ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.valid) ---@field valid boolean local LuaTrivialSmokePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTrivialSmokePrototype.html#LuaTrivialSmokePrototype.help) ---@return string help=function()end, } ---A collection of units moving and attacking together. The engine creates autonomous unit groups to attack polluted areas. The script can create and control such groups as well. Groups can accept commands in the same manner as regular units. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html) ---@class LuaUnitGroup ---[R] ---The command given to this group or `nil` is the group has no command. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.command) ---@field command Command ---[R] ---The distraction command given to this group or `nil` is the group currently isn't distracted. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.distraction_command) ---@field distraction_command Command ---[R] ---The force of this unit group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.force) ---@field force LuaForce ---[R] ---The group number for this unit group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.group_number) ---@field group_number uint ---[R] ---Whether this unit group is controlled by a script or by the game engine. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.is_script_driven) --- ---### See also ---- [LuaUnitGroup::set_autonomous](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.set_autonomous) ---@field is_script_driven boolean ---[R] ---Members of this group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.members) ---@field members LuaEntity[] ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.object_name) ---@field object_name string ---[R] ---Group position. This can have different meanings depending on the group state. When the group is gathering, the position is the place of gathering. When the group is moving, the position is the expected position of its members along the path. When the group is attacking, it is the average position of its members. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.position) ---@field position Position ---[R] ---Whether this group is gathering, moving or attacking. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.state) ---@field state defines.group_state ---[R] ---The surface of this unit group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.surface) ---@field surface LuaSurface ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.valid) ---@field valid boolean local LuaUnitGroup={ ---Make a unit a member of this group. Has the same effect as giving a `group_command` with this group to the unit. --- ---**Note:** The member must have the same force as the unit group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.add_member) ---@param unit LuaEntity add_member=function(unit)end, ---Dissolve this group. Its members won't be destroyed, they will be merely unlinked from this group. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.destroy) destroy=function()end, ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.help) ---@return string help=function()end, ---Make this group autonomous. Autonomous groups will automatically attack polluted areas. Autonomous groups aren't considered to be script driven --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.set_autonomous) --- ---### See also ---- [LuaUnitGroup::is_script_driven](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.is_script_driven) set_autonomous=function()end, ---Give this group a command. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.set_command) --- ---### See also ---- [LuaEntity::set_command](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_command) ---@param command Command set_command=function(command)end, ---Make the group start moving even if some of its members haven't yet arrived. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaUnitGroup.html#LuaUnitGroup.start_moving) start_moving=function()end, } ---Prototype of a virtual signal. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html) ---@class LuaVirtualSignalPrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.localised_description) ---@field localised_description LocalisedString ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.localised_name) ---@field localised_name LocalisedString ---[R] ---Name of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.name) ---@field name string ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.object_name) ---@field object_name string ---[R] ---Order string of this prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.order) ---@field order string ---[R] ---If this is a special signal --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.special) ---@field special boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.subgroup) ---@field subgroup LuaGroup ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.valid) ---@field valid boolean local LuaVirtualSignalPrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVirtualSignalPrototype.html#LuaVirtualSignalPrototype.help) ---@return string help=function()end, } ---Prototype of a void energy source. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVoidEnergySourcePrototype.html) ---@class LuaVoidEnergySourcePrototype ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVoidEnergySourcePrototype.html#LuaVoidEnergySourcePrototype.emissions) ---@field emissions double ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVoidEnergySourcePrototype.html#LuaVoidEnergySourcePrototype.object_name) ---@field object_name string ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVoidEnergySourcePrototype.html#LuaVoidEnergySourcePrototype.render_no_network_icon) ---@field render_no_network_icon boolean ---[R] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVoidEnergySourcePrototype.html#LuaVoidEnergySourcePrototype.render_no_power_icon) ---@field render_no_power_icon boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVoidEnergySourcePrototype.html#LuaVoidEnergySourcePrototype.valid) ---@field valid boolean local LuaVoidEnergySourcePrototype={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaVoidEnergySourcePrototype.html#LuaVoidEnergySourcePrototype.help) ---@return string help=function()end, } ---Control behavior for walls. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaWallControlBehavior.html) ---@class LuaWallControlBehavior:LuaControlBehavior ---[RW] ---The circuit condition. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaWallControlBehavior.html#LuaWallControlBehavior.circuit_condition) ---@field circuit_condition CircuitConditionDefinition ---[R] ---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaWallControlBehavior.html#LuaWallControlBehavior.object_name) ---@field object_name string ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaWallControlBehavior.html#LuaWallControlBehavior.open_gate) ---@field open_gate boolean ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaWallControlBehavior.html#LuaWallControlBehavior.output_signal) ---@field output_signal SignalID ---[RW] --- ---[View documentation](https://lua-api.factorio.com/latest/LuaWallControlBehavior.html#LuaWallControlBehavior.read_sensor) ---@field read_sensor boolean ---[R] ---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaWallControlBehavior.html#LuaWallControlBehavior.valid) ---@field valid boolean local LuaWallControlBehavior={ ---All methods and properties that this object supports. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaWallControlBehavior.html#LuaWallControlBehavior.help) ---@return string help=function()end, } ---@alias LuaObject LuaAISettings|LuaAccumulatorControlBehavior|LuaAchievementPrototype|LuaAmmoCategoryPrototype|LuaArithmeticCombinatorControlBehavior|LuaAutoplaceControlPrototype|LuaBootstrap|LuaBurner|LuaBurnerPrototype|LuaChunkIterator|LuaCircuitNetwork|LuaCombinatorControlBehavior|LuaCommandProcessor|LuaConstantCombinatorControlBehavior|LuaContainerControlBehavior|LuaControl|LuaControlBehavior|LuaCustomChartTag|LuaCustomInputPrototype|LuaCustomTable|LuaDamagePrototype|LuaDeciderCombinatorControlBehavior|LuaDecorativePrototype|LuaElectricEnergySourcePrototype|LuaEntity|LuaEntityPrototype|LuaEquipment|LuaEquipmentCategoryPrototype|LuaEquipmentGrid|LuaEquipmentGridPrototype|LuaEquipmentPrototype|LuaFlowStatistics|LuaFluidBox|LuaFluidBoxPrototype|LuaFluidEnergySourcePrototype|LuaFluidPrototype|LuaFontPrototype|LuaForce|LuaFuelCategoryPrototype|LuaGameScript|LuaGenericOnOffControlBehavior|LuaGroup|LuaGui|LuaGuiElement|LuaHeatEnergySourcePrototype|LuaInserterControlBehavior|LuaInventory|LuaItemPrototype|LuaItemStack|LuaLampControlBehavior|LuaLazyLoadedValue|LuaLogisticCell|LuaLogisticContainerControlBehavior|LuaLogisticNetwork|LuaLogisticPoint|LuaMiningDrillControlBehavior|LuaModSettingPrototype|LuaModuleCategoryPrototype|LuaNamedNoiseExpression|LuaNoiseLayerPrototype|LuaParticlePrototype|LuaPermissionGroup|LuaPermissionGroups|LuaPlayer|LuaProfiler|LuaProgrammableSpeakerControlBehavior|LuaRCON|LuaRailChainSignalControlBehavior|LuaRailPath|LuaRailSignalControlBehavior|LuaRandomGenerator|LuaRecipe|LuaRecipeCategoryPrototype|LuaRecipePrototype|LuaRemote|LuaRendering|LuaResourceCategoryPrototype|LuaRoboportControlBehavior|LuaSettings|LuaShortcutPrototype|LuaStorageTankControlBehavior|LuaStyle|LuaSurface|LuaTechnology|LuaTechnologyPrototype|LuaTile|LuaTilePrototype|LuaTrain|LuaTrainStopControlBehavior|LuaTransportBeltControlBehavior|LuaTransportLine|LuaTrivialSmokePrototype|LuaUnitGroup|LuaVirtualSignalPrototype|LuaVoidEnergySourcePrototype|LuaWallControlBehavior ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AchievementPrototypeFilter) ---@class AchievementPrototypeFilter ---The condition to filter on. One of `"allowed-without-fight"`, `"type"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AchievementPrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AchievementPrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AchievementPrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AchievementPrototypeFilter) ---@field type string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Alert) ---@class Alert ---The tick this alert was created. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Alert) ---@field tick uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Alert) ---@field target LuaEntity|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Alert) ---@field prototype LuaEntityPrototype|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Alert) ---@field position Position|nil ---The SignalID used for a custom alert. Only present for custom alerts. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Alert) ---@field icon SignalID|nil ---The message for a custom alert. Only present for custom alerts. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Alert) ---@field message LocalisedString|nil ---A [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) that specifies where a gui element should be.Possible values are: ---- "top-left" ---- "middle-left" ---- "left" - The same as `"middle-left"` ---- "bottom-left" ---- "top-center" ---- "middle-center" ---- "center" - The same as `"middle-center"` ---- "bottom-center" ---- "top-right" ---- "right" - The same as `"middle-right"` ---- "bottom-right" --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Alignment) ---@class Alignment ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AmmoType) ---@class AmmoType ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AmmoType) ---@field action TriggerItem[]|nil ---One of `"entity"` (fires at an entity), `"position"` (fires directly at a position), or `"direction"` (fires in a direction). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AmmoType) ---@field target_type string ---When `true`, the gun will be able to shoot even when the target is out of range. Only applies when `target_type` is `position`. The gun will fire at the maximum range in the direction of the target position. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AmmoType) ---@field clamp_position boolean|nil ---Ammo category of this ammo. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AmmoType) ---@field category string ---Energy consumption of a single shot, if applicable. Defaults to `0`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AmmoType) ---@field energy_consumption double|nil ---Any basic type (string, number, boolean), table, or LuaObject. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Any) ---@class Any ---Any basic type (string, number, boolean) or table. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AnyBasic) ---@class AnyBasic ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ArithmeticCombinatorParameters) ---@class ArithmeticCombinatorParameters ---First signal to use in an operation. If not specified, the second argument will be the value of `first_constant`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ArithmeticCombinatorParameters) ---@field first_signal SignalID|nil ---Second signal to use in an operation. If not specified, the second argument will be the value of `second_constant`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ArithmeticCombinatorParameters) ---@field second_signal SignalID|nil ---Constant to use as the first argument of the operation. Has no effect when `first_signal` is set. Defaults to `0`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ArithmeticCombinatorParameters) ---@field first_constant int|nil ---Constant to use as the second argument of the operation. Has no effect when `second_signal` is set. Defaults to `0`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ArithmeticCombinatorParameters) ---@field second_constant int|nil ---Must be one of `"*"`, `"/"`, `"+"`, `"-"`, `"%"`, `"^"`, `"<<"`, `">>"`, `"AND"`, `"OR"`, `"XOR"`. When not specified, defaults to `"*"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ArithmeticCombinatorParameters) ---@field operation string|nil ---Specifies the signal to output. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ArithmeticCombinatorParameters) ---@field output_signal SignalID|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameterFluid) ---@class AttackParameterFluid ---Name of the [LuaFluidPrototype](https://lua-api.factorio.com/latest/LuaFluidPrototype.html). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameterFluid) ---@field type string ---Multiplier applied to the damage of an attack. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameterFluid) ---@field damage_modifier double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@class AttackParameters ---The type of AttackParameter. One of `'projectile'`, `'stream'` or `'beam'`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field type string ---Maximum range of attack. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field range float ---Minimum range of attack. Used with flamethrower turrets to prevent self-immolation. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field min_range float ---Defines how the range is determined. Either `'center-to-center'` or `'bounding-box-to-bounding-box'`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field range_mode string ---When searching for the nearest enemy to attack, `fire_penalty` is added to the enemy's distance if they are on fire. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field fire_penalty float ---When searching for an enemy to attack, a higher `rotate_penalty` will discourage targeting enemies that would take longer to turn to face. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field rotate_penalty float ---When searching for an enemy to attack, a higher `health_penalty` will discourage targeting enemies with high health. A negative penalty will do the opposite. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field health_penalty float ---If less than `range`, the entity will choose a random distance between `range` and `min_attack_distance` and attack from that distance. Used for spitters. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field min_attack_distance float ---The arc that the entity can attack in as a fraction of a circle. A value of `1` means the full 360 degrees. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field turn_range float ---Multiplier applied to the damage of an attack. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field damage_modifier float ---Multiplier applied to the ammo consumption of an attack. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field ammo_consumption_modifier float ---Minimum amount of ticks between shots. If this is less than `1`, multiple shots can be performed per tick. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field cooldown float ---Number of ticks it takes for the weapon to actually shoot after it has been ordered to do so. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field warmup uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field movement_slow_down_factor double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field movement_slow_down_cooldown float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field ammo_type AmmoType|nil ---List of the names of compatible [LuaAmmoCategoryPrototypes](https://lua-api.factorio.com/latest/LuaAmmoCategoryPrototype.html). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field ammo_categories string[]|nil ---Applies to **"projectile"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field projectile_center Vector ---Applies to **"projectile"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field projectile_creation_distance float ---Applies to **"projectile"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field projectile_orientation_offset float ---Applies to **"projectile"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field shell_particle CircularParticleCreationSpecification|nil ---Applies to **"projectile"**: (optional) --- ---Applies to **"stream"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field projectile_creation_parameters CircularProjectileCreationSpecification[]|nil ---Applies to **"stream"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field gun_barrel_length float ---Applies to **"stream"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field gun_center_shift table ---Applies to **"stream"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field fluid_consumption float ---Applies to **"stream"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AttackParameters) ---@field fluids AttackParameterFluid[]|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceControl) ---@class AutoplaceControl ---For things that are placed as spots such as ores and enemy bases, frequency is generally proportional to number of spots placed per unit area. For continuous features such as forests, frequency is how compressed the probability function is over distance, i.e. the inverse of 'scale' (similar to terrain_segmentation). When the [LuaAutoplaceControlPrototype](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html) is of the category `"terrain"`, then scale is shown in the map generator GUI instead of frequency. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceControl) ---@field frequency MapGenSize ---For things that are placed as spots, size is proportional to the area of each spot. For continuous features, size affects how much of the map is covered with the thing, and is called 'coverage' in the GUI. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceControl) ---@field size MapGenSize ---Has different effects for different things, but generally affects the 'health' or density of a thing that is placed without affecting where it is placed. For trees, richness affects tree health. For ores, richness multiplies the amount of ore at any given tile in a patch. Metadata about autoplace controls (such as whether or not 'richness' does anything for them) can be found in the [LuaAutoplaceControlPrototype](https://lua-api.factorio.com/latest/LuaAutoplaceControlPrototype.html) by looking up `game.autoplace_control_prototypes[(control prototype name)]`, e.g. `game.autoplace_control_prototypes["enemy-base"].richness` is false, because enemy base autoplacement doesn't use richness. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceControl) ---@field richness MapGenSize ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSetting) ---@class AutoplaceSetting ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSetting) ---@field frequency MapGenSize ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSetting) ---@field size MapGenSize ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSetting) ---@field richness MapGenSize ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSettings) ---@class AutoplaceSettings ---Whether missing autoplace names for this type should be default enabled. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSettings) ---@field treat_missing_as_default boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSettings) ---@field settings table ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@class AutoplaceSpecification ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field probability_expression NoiseExpression ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field richness_expression NoiseExpression ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field coverage double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field sharpness double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field max_probability double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field placement_density uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field richness_base double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field richness_multiplier double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field richness_multiplier_distance_bonus double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field starting_area_size uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field order string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field default_enabled boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field peaks AutoplaceSpecificationPeak[]|nil ---Control prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field control string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field tile_restriction AutoplaceSpecificationRestriction[]|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field force string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification) ---@field random_probability_penalty double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@class AutoplaceSpecificationPeak ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field influence double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field max_influence double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field min_influence double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field richness_influence double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field noisePersistence double ---Prototype name of the noise layer. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field noise_layer string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field noise_octaves_difference double ---`d` is the dimension name; this attribute may occur multiple times, once for each dimension, every time with a different prefix. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field d_optimal double ---`d` is the dimension name. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field d_range double ---`d` is the dimension name. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field d_top_property_limit double ---`d` is the dimension name. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationPeak) ---@field d_max_range double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationRestriction) ---@class AutoplaceSpecificationRestriction ---Tile prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationRestriction) ---@field first string|nil ---Second prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecificationRestriction) ---@field second string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BeamTarget) ---@class BeamTarget ---The target entity. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BeamTarget) ---@field entity LuaEntity|nil ---The target position. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BeamTarget) ---@field position Position|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@class BlueprintEntity ---The entity's unique identifier in the blueprint. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field entity_number uint ---The prototype name of the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field name string ---The position of the entity. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field position Position ---The direction the entity is facing. Only present for entities that can face in different directions and when the entity is not facing north. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field direction defines.direction|nil ---The entity tags of the entity, if there are any. Only relevant for entity ghosts. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field tags Tags|nil ---The items that the entity will request when revived, if there are any. It's a mapping of prototype names to amounts. Only relevant for entity ghosts. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field items table|nil ---The circuit network connections of the entity, if there are any. Only relevant for entities that support circuit connections. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field connections BlueprintCircuitConnection|nil ---The control behavior of the entity, if it has one. The format of the control behavior depends on the entity's type. Only relevant for entities that support control behaviors. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field control_behavior BlueprintControlBehavior|nil ---The schedule of the entity, if it has one. Only relevant for locomotives. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field schedule TrainScheduleRecord[]|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field orientation number|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field recipe string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field inventory BlueprintEntity.inventory|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field bar number|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field filters InventoryFilter[]|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field type string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field input_priority string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field output_priority string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field filter string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field filter_mode string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field override_stack_size number|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field request_filters LogisticFilter[]|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field request_from_buffers boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field parameters ProgrammableSpeakerParameters|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field alert_parameters ProgrammableSpeakerAlertParameters|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field color Color|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field station string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintItemIcon) ---@class BlueprintItemIcon ---Name of the item prototype whose icon should be used. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintItemIcon) ---@field name string ---Index of the icon in the blueprint icons slots. Has to be an integer in the range [1, 4]. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintItemIcon) ---@field index uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintSignalIcon) ---@class BlueprintSignalIcon ---The icon to use. It can be any item icon as well as any virtual signal icon. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintSignalIcon) ---@field signal SignalID ---Index of the icon in the blueprint icons slots. Has to be an integer in the range [1, 4]. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintSignalIcon) ---@field index uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BoundingBox) ---@class BoundingBox ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BoundingBox) ---@field left_top Position ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BoundingBox) ---@field right_bottom Position ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BoundingBox) ---@field orientation RealOrientation|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CapsuleAction) ---@class CapsuleAction ---One of `"throw"`, `"equipment-remote"`, `"use-on-self"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CapsuleAction) ---@field type string ---Only present when `type` is `"throw"` or `"use-on-self"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CapsuleAction) ---@field attack_parameters AttackParameters|nil ---Only present when `type` is `"equipment-remote"`. It is the equipment prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CapsuleAction) ---@field equipment string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CapsuleAction) ---@field flare string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChartTagSpec) ---@class ChartTagSpec ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChartTagSpec) ---@field position Position ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChartTagSpec) ---@field icon SignalID|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChartTagSpec) ---@field text string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChartTagSpec) ---@field last_user PlayerIdentification|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChunkPosition) ---@class ChunkPosition ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChunkPosition) ---@field x int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChunkPosition) ---@field y int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChunkPositionAndArea) ---@class ChunkPositionAndArea ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChunkPositionAndArea) ---@field x int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChunkPositionAndArea) ---@field y int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ChunkPositionAndArea) ---@field area BoundingBox> ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitCondition) ---@class CircuitCondition ---Specifies how the inputs should be compared. If not specified, defaults to `"<"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitCondition) ---@field comparator ComparatorString|nil ---Defaults to blank --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitCondition) ---@field first_signal SignalID|nil ---What to compare `first_signal` to. If not specified, `first_signal` will be compared to `constant`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitCondition) ---@field second_signal SignalID|nil ---Constant to compare `first_signal` to. Has no effect when `second_signal` is set. When neither `second_signal` nor `constant` are specified, the effect is as though `constant` were specified with the value `0`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitCondition) ---@field constant int|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitConditionDefinition) ---@class CircuitConditionDefinition ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitConditionDefinition) ---@field condition CircuitCondition ---Whether the condition is currently fulfilled --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitConditionDefinition) ---@field fulfilled boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitConnectionDefinition) ---@class CircuitConnectionDefinition ---Wire color, either [defines.wire_type.red](https://lua-api.factorio.com/latest/defines.html#defines.wire_type.red) or [defines.wire_type.green](https://lua-api.factorio.com/latest/defines.html#defines.wire_type.green). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitConnectionDefinition) ---@field wire defines.wire_type ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitConnectionDefinition) ---@field target_entity LuaEntity ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitConnectionDefinition) ---@field source_circuit_id uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircuitConnectionDefinition) ---@field target_circuit_id uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@class CircularParticleCreationSpecification ---Name of the [LuaEntityPrototype](https://lua-api.factorio.com/latest/LuaEntityPrototype.html) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field direction float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field direction_deviation float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field speed float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field speed_deviation float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field starting_frame_speed float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field starting_frame_speed_deviation float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field height float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field height_deviation float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field vertical_speed float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field vertical_speed_deviation float ---This vector is a table with `x` and `y` keys instead of an array. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field center Vector ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field creation_distance double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field creation_distance_orientation double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularParticleCreationSpecification) ---@field use_source_position boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CircularProjectileCreationSpecification) ---@class CircularProjectileCreationSpecification ---Possible values are: ---- "west-to-east" ---- "north-to-south" ---- "east-to-west" ---- "south-to-north" ---- "west-to-north" ---- "north-to-east" ---- "east-to-south" ---- "south-to-west" ---- "west-to-south" ---- "north-to-west" ---- "east-to-north" ---- "south-to-east" ---- "west-to-none" ---- "none-to-east" ---- "east-to-none" ---- "none-to-west" ---- "north-to-none" ---- "none-to-south" ---- "south-to-none" ---- "none-to-north" --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CliffOrientation) ---@class CliffOrientation ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CliffPlacementSettings) ---@class CliffPlacementSettings ---Name of the cliff prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CliffPlacementSettings) ---@field name string ---Elevation at which the first row of cliffs is placed. The default is `10`, and this cannot be set from the map generation GUI. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CliffPlacementSettings) ---@field cliff_elevation_0 float ---Elevation difference between successive rows of cliffs. This is inversely proportional to 'frequency' in the map generation GUI. Specifically, when set from the GUI the value is `40 / frequency`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CliffPlacementSettings) ---@field cliff_elevation_interval float ---Corresponds to 'continuity' in the GUI. This value is not used directly, but is used by the 'cliffiness' noise expression, which in combination with elevation and the two cliff elevation properties drives cliff placement (cliffs are placed when elevation crosses the elevation contours defined by `cliff_elevation_0` and `cliff_elevation_interval` when 'cliffiness' is greater than `0.5`). The default 'cliffiness' expression interprets this value such that larger values result in longer unbroken walls of cliffs, and smaller values (between `0` and `1`) result in larger gaps in cliff walls. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CliffPlacementSettings) ---@field richness MapGenSize ---This is a set of masks given as a dictionary[[CollisionMaskLayer](https://lua-api.factorio.com/latest/Concepts.html#CollisionMaskLayer) → [boolean](https://lua-api.factorio.com/latest/Builtin-Types.html#boolean)]. Only set masks are present in the dictionary and they have the value `true`. Unset flags aren't present at all. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CollisionMask) ---@class CollisionMask ---A [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) specifying a collision mask layer. ---Additionally the values `"layer-13"` through `"layer-55"`. These layers are currently unused by the game but may change. If a mod is going to use one of the unused layers it's recommended to start at the higher layers because the base game will take from the lower ones. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CollisionMaskLayer) ---@class CollisionMaskLayer ---A [CollisionMask](https://lua-api.factorio.com/latest/Concepts.html#CollisionMask) but also includes any flags this mask has. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CollisionMaskWithFlags) ---@class CollisionMaskWithFlags ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Color) ---@class Color ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Color) ---@field r float|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Color) ---@field g float|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Color) ---@field b float|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Color) ---@field a float|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ColorModifier) ---@class ColorModifier ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ColorModifier) ---@field r float|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ColorModifier) ---@field g float|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ColorModifier) ---@field b float|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ColorModifier) ---@field a float|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@class Command ---Type of command. The remaining fields depend on the value of this field. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field type defines.command ---Applies to **"defines.command.attack"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field target LuaEntity ---Applies to **"defines.command.attack"**: (optional) ---Defaults to `defines.distraction.by_enemy`. --- ---Applies to **"defines.command.go_to_location"**: (optional) ---Defaults to `defines.distraction.by_enemy`. --- ---Applies to **"defines.command.group"**: (optional) ---Defaults to `defines.distraction.by_enemy`. --- ---Applies to **"defines.command.attack_area"**: (optional) ---Defaults to `defines.distraction.by_enemy`. --- ---Applies to **"defines.command.wander"**: (optional) ---Defaults to `defines.distraction.by_enemy`. --- ---Applies to **"defines.command.stop"**: (optional) ---Defaults to `defines.distraction.by_enemy`. --- ---Applies to **"defines.command.flee"**: (optional) ---Defaults to `defines.distraction.by_enemy`. --- ---Applies to **"defines.command.build_base"**: (optional) ---Defaults to `defines.distraction.by_enemy`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field distraction defines.distraction|nil ---Applies to **"defines.command.go_to_location"**: (optional) --- ---Applies to **"defines.command.attack_area"**: (required) ---Center of the attack area. --- ---Applies to **"defines.command.build_base"**: (required) ---Where to build the base. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field destination Position|nil ---Applies to **"defines.command.go_to_location"**: (optional) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field destination_entity LuaEntity|nil ---Applies to **"defines.command.go_to_location"**: (optional) ---Flags to affect the pathfinder. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field pathfind_flags PathfinderFlags|nil ---Applies to **"defines.command.go_to_location"**: (optional) ---Distance from the exact target that the unit will consider itself "arrived" at. Default is 3. --- ---Applies to **"defines.command.attack_area"**: (required) ---Radius of the attack area. --- ---Applies to **"defines.command.wander"**: (optional) ---Defaults to 10. Does not apply when `wander_in_group` is `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field radius double|nil ---Applies to **"defines.command.compound"**: (required) ---How the commands should be chained together. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field structure_type defines.compound_command ---Applies to **"defines.command.compound"**: (required) ---The sub-commands. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field commands Command[] ---Applies to **"defines.command.group"**: (required) ---The group whose command to follow. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field group LuaUnitGroup ---Applies to **"defines.command.group"**: (optional) ---Whether the unit will use the group distraction or the commands distraction. Defaults to true. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field use_group_distraction boolean|nil ---Applies to **"defines.command.wander"**: (optional) ---When commanding a group, defines how the group will wander. When `true`, the units in the group will wander around inside the group's radius, just like gathering biters. When `false`, the units will wander as a group, ie they will all walk together in the same random direction. Default is true for groups. Passing true for a single unit is an error. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field wander_in_group boolean|nil ---Applies to **"defines.command.wander"**: (optional) ---Ticks to wander before successfully completing the command. Default is max uint, which means wander forever. --- ---Applies to **"defines.command.stop"**: (optional) ---Ticks to wander before successfully completing the command. Default is max uint, which means stop forever. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field ticks_to_wait uint|nil ---Applies to **"defines.command.flee"**: (required) ---The entity to flee from --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field from LuaEntity ---Applies to **"defines.command.build_base"**: (optional) ---Whether the units should ignore expansion candidate chunks. When `false`, they will obey and not build a base in a non-candidate chunk. Defaults to `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Command) ---@field ignore_planner boolean|nil ---A [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) that specifies how the inputs should be compared.Possible values are: ---- "=" - "equal to" ---- ">" - "greater than" ---- "<" - "lesser than" ---- "≥" - "greater than or equal to" ---- ">=" - "greater than or equal to" ---- "≤" - "lesser than or equal to" ---- "<=" - "lesser than or equal to" ---- "≠" - "not equal to" ---- "!=" - "not equal to" --- ---**Note:** While the API accepts both versions for `"less/greater than or equal to"` and `"not equal"`, it'll always return `"≥"`, `"≤"` or `"≠"` respectively when reading them back. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ComparatorString) ---@class ComparatorString ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConfigurationChangedData) ---@class ConfigurationChangedData ---Old version of the map. Present only when loading map version other than the current version. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConfigurationChangedData) ---@field old_version string|nil ---New version of the map. Present only when loading map version other than the current version. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConfigurationChangedData) ---@field new_version string|nil ---Dictionary of mod changes. It is indexed by mod name. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConfigurationChangedData) ---@field mod_changes table ---`true` when mod startup settings have changed since the last time this save was loaded. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConfigurationChangedData) ---@field mod_startup_settings_changed boolean ---`true` when mod prototype migrations have been applied since the last time this save was loaded. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConfigurationChangedData) ---@field migration_applied boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConstantCombinatorParameters) ---@class ConstantCombinatorParameters ---Signal to emit. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConstantCombinatorParameters) ---@field signal SignalID ---Value of the signal to emit. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConstantCombinatorParameters) ---@field count int ---Index of the constant combinator's slot to set this signal to. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ConstantCombinatorParameters) ---@field index uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CraftingQueueItem) ---@class CraftingQueueItem ---The index of the item in the crafting queue. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CraftingQueueItem) ---@field index uint ---The recipe being crafted. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CraftingQueueItem) ---@field recipe string ---The amount of items being crafted. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CraftingQueueItem) ---@field count uint ---It is specified by [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string).Possible values are: ---- "entity" - Yellow box. ---- "not-allowed" - Red box. ---- "electricity" - Light blue box. ---- "pair" - Light blue box. ---- "copy" - Green box. ---- "train-visualization" - White box. ---- "logistics" - Light blue box. ---- "blueprint-snap-rectangle" - Green box. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CursorBoxRenderType) ---@class CursorBoxRenderType ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CustomCommandData) ---@class CustomCommandData ---The name of the command. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CustomCommandData) ---@field name string ---The tick the command was used in. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CustomCommandData) ---@field tick uint ---The player who issued the command, or `nil` if it was issued from the server console. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CustomCommandData) ---@field player_index uint|nil ---The parameter passed after the command, if there is one. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CustomCommandData) ---@field parameter string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CutsceneWaypoint) ---@class CutsceneWaypoint ---Position to pan the camera to. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CutsceneWaypoint) ---@field position Position|nil ---Entity or unit group to pan the camera to. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CutsceneWaypoint) ---@field target LuaEntity|LuaUnitGroup|nil ---How many ticks it will take to reach this waypoint from the previous one. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CutsceneWaypoint) ---@field transition_time uint ---Time in ticks to wait before moving to the next waypoint. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CutsceneWaypoint) ---@field time_to_wait uint ---Zoom level to be set when the waypoint is reached. When not specified, the previous waypoint's zoom is used. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#CutsceneWaypoint) ---@field zoom double|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DeciderCombinatorParameters) ---@class DeciderCombinatorParameters ---Defaults to blank. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DeciderCombinatorParameters) ---@field first_signal SignalID|nil ---Second signal to use in an operation, if any. If this is not specified, the second argument to a decider combinator's operation is assumed to be the value of `constant`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DeciderCombinatorParameters) ---@field second_signal SignalID|nil ---Constant to use as the second argument of operation. Defaults to `0`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DeciderCombinatorParameters) ---@field constant uint|nil ---Specifies how the inputs should be compared. If not specified, defaults to `"<"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DeciderCombinatorParameters) ---@field comparator ComparatorString|nil ---Defaults to blank. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DeciderCombinatorParameters) ---@field output_signal SignalID|nil ---Defaults to `true`. When `false`, will output a value of `1` for the given `output_signal`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DeciderCombinatorParameters) ---@field copy_count_from_input boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Decorative) ---@class Decorative ---The name of the decorative prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Decorative) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Decorative) ---@field position Position ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Decorative) ---@field amount uint8 ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativePrototypeFilter) ---@class DecorativePrototypeFilter ---The condition to filter on. One of `"decal"`, `"autoplace"`, `"collision-mask"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativePrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativePrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativePrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"collision-mask"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativePrototypeFilter) ---@field mask CollisionMask|CollisionMaskWithFlags ---Applies to filter **"collision-mask"**: (required) ---How to filter: `"collides"` or `"layers-equals"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativePrototypeFilter) ---@field mask_mode string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativeResult) ---@class DecorativeResult ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativeResult) ---@field position TilePosition ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativeResult) ---@field decorative LuaDecorativePrototype ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DecorativeResult) ---@field amount uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DifficultySettings) ---@class DifficultySettings ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DifficultySettings) ---@field recipe_difficulty defines.difficulty_settings.recipe_difficulty ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DifficultySettings) ---@field technology_difficulty defines.difficulty_settings.technology_difficulty ---A value in range [0.001, 1000]. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DifficultySettings) ---@field technology_price_multiplier double ---Either `"after-victory"`, `"always"` or `"never"`. Changing this to `"always"` or `"after-victory"` does not automatically unlock the research queue. See [LuaForce](https://lua-api.factorio.com/latest/LuaForce.html) for that. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DifficultySettings) ---@field research_queue_setting string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DisplayResolution) ---@class DisplayResolution ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DisplayResolution) ---@field width uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#DisplayResolution) ---@field height uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@class EntityPrototypeFilter ---The condition to filter on. One of `"flying-robot"`, `"robot-with-logistics-interface"`, `"rail"`, `"ghost"`, `"explosion"`, `"vehicle"`, `"crafting-machine"`, `"rolling-stock"`, `"turret"`, `"transport-belt-connectable"`, `"wall-connectable"`, `"buildable"`, `"placable-in-editor"`, `"clonable"`, `"selectable"`, `"hidden"`, `"entity-with-health"`, `"building"`, `"fast-replaceable"`, `"uses-direction"`, `"minable"`, `"circuit-connectable"`, `"autoplace"`, `"blueprintable"`, `"item-to-place"`, `"name"`, `"type"`, `"collision-mask"`, `"flag"`, `"build-base-evolution-requirement"`, `"selection-priority"`, `"emissions"`, `"crafting-category"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"name"**: (required) ---The prototype name, or list of acceptable names. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field name string|string[] ---Applies to filter **"type"**: (required) ---The prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field type string ---Applies to filter **"collision-mask"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field mask CollisionMask|CollisionMaskWithFlags ---Applies to filter **"collision-mask"**: (required) ---How to filter: `"collides"` or `"layers-equals"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field mask_mode string ---Applies to filter **"flag"**: (required) ---One of the values in [EntityPrototypeFlags](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field flag string ---Applies to filter **"build-base-evolution-requirement"**: (required) --- ---Applies to filter **"selection-priority"**: (required) --- ---Applies to filter **"emissions"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field comparison ComparatorString ---Applies to filter **"build-base-evolution-requirement"**: (required) ---The value to compare against. --- ---Applies to filter **"selection-priority"**: (required) ---The value to compare against. --- ---Applies to filter **"emissions"**: (required) ---The value to compare against. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field value double ---Applies to filter **"crafting-category"**: (required) ---Matches if the prototype is for a crafting machine with this crafting category. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFilter) ---@field crafting_category string ---This is a set of flags given as a dictionary[[string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) → [boolean](https://lua-api.factorio.com/latest/Builtin-Types.html#boolean)]. When a flag is set, it is present in the dictionary with the value `true`. Unset flags aren't present in the dictionary at all. So, the boolean value is meaningless and exists just for easy table lookup if a flag is set. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@class EntityPrototypeFlags ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field breaths-air boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field building-direction-8-way boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field fast-replaceable-no-build-while-moving boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field fast-replaceable-no-cross-type-while-moving boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field filter-directions boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field hidden boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field hide-alt-info boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field no-automated-item-insertion boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field no-automated-item-removal boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field no-copy-paste boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field no-gap-fill-while-building boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field not-blueprintable boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field not-deconstructable boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field not-flammable boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field not-on-map boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field not-repairable boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field not-rotatable boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field not-selectable-in-game boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field not-upgradable boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field placeable-enemy boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field placeable-neutral boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field placeable-off-grid boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field placeable-player boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) ---@field player-creation boolean|nil ---May be specified in one of the following ways: ---- [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html): The entity., ---- [LuaEntityPrototype](https://lua-api.factorio.com/latest/LuaEntityPrototype.html): The entity prototype., ---- [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string): The prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeIdentification) ---@class EntityPrototypeIdentification:LuaEntity,LuaEntityPrototype,string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EquipmentPoint) ---@class EquipmentPoint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EquipmentPoint) ---@field x uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EquipmentPoint) ---@field y uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EquipmentPrototypeFilter) ---@class EquipmentPrototypeFilter ---The condition to filter on. One of `"item-to-place"`, `"type"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EquipmentPrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EquipmentPrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EquipmentPrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EquipmentPrototypeFilter) ---@field type string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EventData) ---@class EventData ---The identifier of the event this handler was registered to. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EventData) ---@field name defines.events ---The tick during which the event happened. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EventData) ---@field tick uint ---The name of the mod that raised the event if it was raised using [LuaBootstrap::raise_event](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_event). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EventData) ---@field mod_name string|nil ---Used to filter out irrelevant event callbacks in a performant way. --- ---**Note:** Filters are always used as an array of filters of a specific type. Every filter can only be used with its corresponding event, and different types of event filters can not be mixed. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#EventFilter) ---@class EventFilter ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Fluid) ---@class Fluid ---Fluid prototype name of the fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Fluid) ---@field name string ---Amount of the fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Fluid) ---@field amount double ---The temperature. When reading from [LuaFluidBox](https://lua-api.factorio.com/latest/LuaFluidBox.html), this field will always be present. It is not necessary to specify it when writing, however. When not specified, the fluid will be set to the fluid's default temperature as specified in the fluid's prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Fluid) ---@field temperature double|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxConnection) ---@class FluidBoxConnection ---The connection type: "input", "output", or "input-output". --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxConnection) ---@field type string ---The 4 cardinal direction connection points for this pipe. This vector is a table with `x` and `y` keys instead of an array. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxConnection) ---@field positions Vector[] ---The maximum tile distance this underground connection can connect at if this is an underground pipe. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxConnection) ---@field max_underground_distance uint|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxFilter) ---@class FluidBoxFilter ---Fluid prototype name of the filtered fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxFilter) ---@field name string ---The minimum temperature allowed into the fluidbox. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxFilter) ---@field minimum_temperature double ---The maximum temperature allowed into the fluidbox. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxFilter) ---@field maximum_temperature double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxFilterSpec) ---@class FluidBoxFilterSpec ---Fluid prototype name of the filtered fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxFilterSpec) ---@field name string ---The minimum temperature allowed into the fluidbox. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxFilterSpec) ---@field minimum_temperature double|nil ---The maximum temperature allowed into the fluidbox. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxFilterSpec) ---@field maximum_temperature double|nil ---Force the filter to be set, regardless of current fluid content. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidBoxFilterSpec) ---@field force boolean|nil ---May be specified in one of the following ways: ---- [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string): The fluid name., ---- [LuaFluidPrototype](https://lua-api.factorio.com/latest/LuaFluidPrototype.html): The fluid prototype., ---- [Fluid](https://lua-api.factorio.com/latest/Concepts.html#Fluid): The fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidIdentification) ---@class FluidIdentification:string,LuaFluidPrototype,Fluid ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidPrototypeFilter) ---@class FluidPrototypeFilter ---The condition to filter on. One of `"hidden"`, `"name"`, `"subgroup"`, `"default-temperature"`, `"max-temperature"`, `"heat-capacity"`, `"fuel-value"`, `"emissions-multiplier"`, `"gas-temperature"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidPrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidPrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidPrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"name"**: (required) ---The prototype name, or list of acceptable names. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidPrototypeFilter) ---@field name string|string[] ---Applies to filter **"subgroup"**: (required) ---A [LuaGroup](https://lua-api.factorio.com/latest/LuaGroup.html) (subgroup) name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidPrototypeFilter) ---@field subgroup string ---Applies to filter **"default-temperature"**: (required) --- ---Applies to filter **"max-temperature"**: (required) --- ---Applies to filter **"heat-capacity"**: (required) --- ---Applies to filter **"fuel-value"**: (required) --- ---Applies to filter **"emissions-multiplier"**: (required) --- ---Applies to filter **"gas-temperature"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidPrototypeFilter) ---@field comparison ComparatorString ---Applies to filter **"default-temperature"**: (required) ---The value to compare against. --- ---Applies to filter **"max-temperature"**: (required) ---The value to compare against. --- ---Applies to filter **"heat-capacity"**: (required) ---The value to compare against. --- ---Applies to filter **"fuel-value"**: (required) ---The value to compare against. --- ---Applies to filter **"emissions-multiplier"**: (required) ---The value to compare against. --- ---Applies to filter **"gas-temperature"**: (required) ---The value to compare against. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#FluidPrototypeFilter) ---@field value double ---It is specified by [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string).Possible values are: ---- "all" - All forces pass. ---- "enemy" - Forces which will attack pass. ---- "ally" - Forces which won't attack pass. ---- "friend" - Forces which are friends pass. ---- "not-friend" - Forces which are not friends pass. ---- "same" - The same force pass. ---- "not-same" - The non-same forces pass. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ForceCondition) ---@class ForceCondition ---May be specified in one of the following ways: ---- [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string): The force name., ---- [LuaForce](https://lua-api.factorio.com/latest/LuaForce.html): A reference to [LuaForce](https://lua-api.factorio.com/latest/LuaForce.html) may be passed directly. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ForceIdentification) ---@class ForceIdentification:string,LuaForce ---Parameters that affect the look and control of the game. Updating any of the member attributes here will immediately take effect in the game engine. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings) ---@class GameViewSettings ---[RW] ---Show the flashing alert icons next to the player's toolbar. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_alert_gui) ---@field show_alert_gui boolean ---[RW] ---Show the controller GUI elements. This includes the toolbar, the selected tool slot, the armour slot, and the gun and ammunition slots. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_controller_gui) ---@field show_controller_gui boolean ---[RW] ---Show overlay icons on entities. Also known as "alt-mode". --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_entity_info) ---@field show_entity_info boolean ---[RW] ---Shows or hides the view options when map is opened. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_map_view_options) ---@field show_map_view_options boolean ---[RW] ---Show the chart in the upper right-hand corner of the screen. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_minimap) ---@field show_minimap boolean ---[RW] ---Shows or hides quickbar of shortcuts. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_quickbar) ---@field show_quickbar boolean ---[RW] ---When `true` (`false` is default), the rails will always show the rail block visualisation. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_rail_block_visualisation) ---@field show_rail_block_visualisation boolean ---[RW] ---Show research progress and name in the upper right-hand corner of the screen. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_research_info) ---@field show_research_info boolean ---[RW] ---Shows or hides the shortcut bar. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_shortcut_bar) ---@field show_shortcut_bar boolean ---[RW] ---Shows or hides the buttons row. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.show_side_menu) ---@field show_side_menu boolean ---[RW] ---When `true` (the default), mousing over an entity will select it. Otherwise, moving the mouse won't update entity selection. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings.update_entity_selection) ---@field update_entity_selection boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiAnchor) ---@class GuiAnchor ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiAnchor) ---@field gui defines.relative_gui_type ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiAnchor) ---@field position defines.relative_gui_position ---If provided, only anchors the GUI element when the opened things type matches the type. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiAnchor) ---@field type string|nil ---If provided, only anchors the GUI element when the opened thing matches the name. `name` takes precedence over `names`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiAnchor) ---@field name string|nil ---If provided, only anchors the GUI element when the opened thing matches one of the names. When reading an anchor, `names` is always populated. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiAnchor) ---@field names string[]|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiArrowSpecification) ---@class GuiArrowSpecification ---This determines which of the following fields will be required. Must be one of `"nowhere"` (will remove the arrow entirely), `"goal"` (will point to the current goal), `"entity_info"`, `"active_window"`, `"entity"`, `"position"`, `"crafting_queue"` or `"item_stack"` (will point to a given item stack in an inventory). Depending on this value, other fields may have to be specified. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiArrowSpecification) ---@field type string ---Applies to **"entity"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiArrowSpecification) ---@field entity LuaEntity ---Applies to **"position"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiArrowSpecification) ---@field position Position ---Applies to **"crafting_queue"**: (required) ---Index in the crafting queue to point to. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiArrowSpecification) ---@field crafting_queueindex uint ---Applies to **"item_stack"**: (required) ---Which inventory the stack is in. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiArrowSpecification) ---@field inventory_index defines.inventory ---Applies to **"item_stack"**: (required) ---Which stack to point to. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiArrowSpecification) ---@field item_stack_index uint ---Applies to **"item_stack"**: (required) ---Must be either `"player"`, `"target"`, `"player-quickbar"` or `"player-equipment-bar"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiArrowSpecification) ---@field source string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiLocation) ---@class GuiLocation ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiLocation) ---@field x int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#GuiLocation) ---@field y int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#HeatConnection) ---@class HeatConnection ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#HeatConnection) ---@field position Vector ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#HeatConnection) ---@field direction defines.direction ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#HeatSetting) ---@class HeatSetting ---The target temperature. Defaults to the minimum temperature of the heat buffer. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#HeatSetting) ---@field temperature double|nil ---`"at-least"`, `"at-most"`, `"exactly"`, `"add"`, or `"remove"`. Defaults to `"at-least"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#HeatSetting) ---@field mode string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityInventoryFilter) ---@class InfinityInventoryFilter ---Name of the item. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityInventoryFilter) ---@field name string ---The count of the filter. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityInventoryFilter) ---@field count uint|nil ---`"at-least"`, `"at-most"`, or `"exactly"`. Defaults to `"at-least"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityInventoryFilter) ---@field mode string|nil ---The index of this filter in the filters list. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityInventoryFilter) ---@field index uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityPipeFilter) ---@class InfinityPipeFilter ---Name of the fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityPipeFilter) ---@field name string ---The fill percentage the pipe (e.g. 0.5 for 50%). Can't be negative. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityPipeFilter) ---@field percentage double|nil ---The temperature of the fluid. Defaults to the default/minimum temperature of the fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityPipeFilter) ---@field temperature double|nil ---`"at-least"`, `"at-most"`, `"exactly"`, `"add"`, or `"remove"`. Defaults to `"at-least"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InfinityPipeFilter) ---@field mode string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Ingredient) ---@class Ingredient ---`"item"` or `"fluid"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Ingredient) ---@field type string ---Prototype name of the required item or fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Ingredient) ---@field name string ---Amount of the item or fluid. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Ingredient) ---@field amount double ---How much of this ingredient is a catalyst. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Ingredient) ---@field catalyst_amount uint|double|nil ---Applies to **"fluid"**: (optional) ---The minimum fluid temperature required. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Ingredient) ---@field minimum_temperature double|nil ---Applies to **"fluid"**: (optional) ---The maximum fluid temperature allowed. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Ingredient) ---@field maximum_temperature double|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InserterCircuitConditions) ---@class InserterCircuitConditions ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InserterCircuitConditions) ---@field circuit CircuitCondition|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InserterCircuitConditions) ---@field logistics CircuitCondition|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InventoryFilter) ---@class InventoryFilter ---Position of the corresponding filter slot. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InventoryFilter) ---@field index uint ---Item prototype name of the item to filter. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#InventoryFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@class ItemPrototypeFilter ---The condition to filter on. One of `"tool"`, `"mergeable"`, `"item-with-inventory"`, `"selection-tool"`, `"item-with-label"`, `"has-rocket-launch-products"`, `"fuel"`, `"place-result"`, `"burnt-result"`, `"place-as-tile"`, `"placed-as-equipment-result"`, `"name"`, `"type"`, `"flag"`, `"subgroup"`, `"fuel-category"`, `"stack-size"`, `"default-request-amount"`, `"wire-count"`, `"fuel-value"`, `"fuel-acceleration-multiplier"`, `"fuel-top-speed-multiplier"`, `"fuel-emissions-multiplier"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"place-result"**: (optional) ---Filters for the place result. --- ---Applies to filter **"burnt-result"**: (optional) ---Filters for the burnt result. --- ---Applies to filter **"place-as-tile"**: (optional) ---Filters for the placed tile. --- ---Applies to filter **"placed-as-equipment-result"**: (optional) ---Filters for the placed equipment. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field elem_filters EntityPrototypeFilter[]|nil ---Applies to filter **"name"**: (required) ---The prototype name, or list of acceptable names. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field name string|string[] ---Applies to filter **"type"**: (required) ---The prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field type string ---Applies to filter **"flag"**: (required) ---One of the values in [ItemPrototypeFlags](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field flag string ---Applies to filter **"subgroup"**: (required) ---A [LuaGroup](https://lua-api.factorio.com/latest/LuaGroup.html) (subgroup) name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field subgroup string ---Applies to filter **"fuel-category"**: (required) ---A [LuaFuelCategoryPrototype](https://lua-api.factorio.com/latest/LuaFuelCategoryPrototype.html) name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field fuel-category string ---Applies to filter **"stack-size"**: (required) --- ---Applies to filter **"default-request-amount"**: (required) --- ---Applies to filter **"wire-count"**: (required) --- ---Applies to filter **"fuel-value"**: (required) --- ---Applies to filter **"fuel-acceleration-multiplier"**: (required) --- ---Applies to filter **"fuel-top-speed-multiplier"**: (required) --- ---Applies to filter **"fuel-emissions-multiplier"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field comparison ComparatorString ---Applies to filter **"stack-size"**: (required) ---The value to compare against. --- ---Applies to filter **"default-request-amount"**: (required) ---The value to compare against. --- ---Applies to filter **"wire-count"**: (required) ---The value to compare against. --- ---Applies to filter **"fuel-value"**: (required) ---The value to compare against. --- ---Applies to filter **"fuel-acceleration-multiplier"**: (required) ---The value to compare against. --- ---Applies to filter **"fuel-top-speed-multiplier"**: (required) ---The value to compare against. --- ---Applies to filter **"fuel-emissions-multiplier"**: (required) ---The value to compare against. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFilter) ---@field value uint ---This is a set of flags given as dictionary[[string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) → [boolean](https://lua-api.factorio.com/latest/Builtin-Types.html#boolean)]. When a flag is set, it is present in the dictionary with the value `true`. Unset flags aren't present in the dictionary at all. So, the boolean value is meaningless and exists just for easy table lookup if a flag is set. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@class ItemPrototypeFlags ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field always-show boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field can-extend-inventory boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field draw-logistic-overlay boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field hidden boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field hide-from-bonus-gui boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field hide-from-fuel-tooltip boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field mod-openable boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field not-stackable boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field only-in-cursor boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags) ---@field primary-place-result boolean|nil ---May be specified in one of the following ways: ---- [LuaItemStack](https://lua-api.factorio.com/latest/LuaItemStack.html): The item., ---- [LuaItemPrototype](https://lua-api.factorio.com/latest/LuaItemPrototype.html): The item prototype., ---- [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string): The prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeIdentification) ---@class ItemPrototypeIdentification:LuaItemStack,LuaItemPrototype,string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackDefinition) ---@class ItemStackDefinition ---Prototype name of the item the stack holds. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackDefinition) ---@field name string ---Number of items the stack holds. If not specified, defaults to `1`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackDefinition) ---@field count uint|nil ---Health of the items in the stack. Defaults to `1.0`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackDefinition) ---@field health float|nil ---Durability of the tool items in the stack. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackDefinition) ---@field durability double|nil ---Amount of ammo in the ammo items in the stack. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackDefinition) ---@field ammo double|nil ---Tags of the items with tags in the stack. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackDefinition) ---@field tags string[]|nil ---May be specified in one of the following ways: ---- [SimpleItemStack](https://lua-api.factorio.com/latest/Concepts.html#SimpleItemStack), ---- [LuaItemStack](https://lua-api.factorio.com/latest/LuaItemStack.html) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackIdentification) ---@class ItemStackIdentification:SimpleItemStack,LuaItemStack ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackLocation) ---@class ItemStackLocation ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackLocation) ---@field inventory defines.inventory ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ItemStackLocation) ---@field slot uint ---Localised strings are a way to support translation of in-game text. It is an array where the first element is the key and the remaining elements are parameters that will be substituted for placeholders in the template designated by the key. ---The key identifies the string template. For example, `"gui-alert-tooltip.attack"` (for the template `"__1__ --- objects are being damaged"`; see the file `data/core/locale/en.cfg`). ---The template can contain placeholders such as `__1__` or `__2__`. These will be replaced by the respective parameter in the LocalisedString. The parameters themselves can be other localised strings, which will be processed recursively in the same fashion. Localised strings cannot be recursed deeper than 20 levels and cannot have more than 20 parameters. ---As a special case, when the key is just the empty string, all the parameters will be concatenated (after processing, if any are localised strings). If there is only one parameter, it will be used as is. ---Furthermore, when an API function expects a localised string, it will also accept a regular string (i.e. not a table) which will not be translated, or number which will be converted to its textual representation. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LocalisedString) --- ---### Example ---In the English translation, this will print `"No ammo"`; in the Czech translation, it will print `"Bez munice"`: ---``` ---game.player.print({"description.no-ammo"}) ---``` The `description.no-ammo` template contains no placeholders, so no further parameters are necessary. --- ---### Example ---In the English translation, this will print `"Durability: 5/9"`; in the Japanese one, it will print `"耐久度: 5/9"`: ---``` ---game.player.print({"description.durability", 5, 9}) ---``` --- ---### Example ---This will print `"hello"` in all translations: ---``` ---game.player.print({"", "hello"}) ---``` --- ---### Example ---This will print `"Iron plate: 60"` in the English translation and `"Eisenplatte: 60"` in the German translation. ---``` ---game.print({"", {"item-name.iron-plate"}, ": ", 60}) ---``` ---@class LocalisedString ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LogisticFilter) ---@class LogisticFilter ---The index this filter applies to. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LogisticFilter) ---@field index uint ---The item name for this filter. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LogisticFilter) ---@field name string ---The count for this filter. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LogisticFilter) ---@field count uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Loot) ---@class Loot ---Item prototype name of the result. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Loot) ---@field item string ---Probability that any loot at all will drop, as a number in range [0, 1]. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Loot) ---@field probability double ---Minimum amount of loot to drop. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Loot) ---@field count_min double ---Maximum amount of loot to drop. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Loot) ---@field count_max double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityClonedEventFilter) ---@class LuaEntityClonedEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityClonedEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityClonedEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityClonedEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityClonedEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityClonedEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDamagedEventFilter) ---@class LuaEntityDamagedEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"`, `"original-damage-amount"`, `"final-damage-amount"`, `"damage-type"`, `"final-health"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDamagedEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDamagedEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDamagedEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---Applies to filter **"damage-type"**: (required) ---A [LuaDamagePrototype](https://lua-api.factorio.com/latest/LuaDamagePrototype.html) name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDamagedEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDamagedEventFilter) ---@field name string ---Applies to filter **"original-damage-amount"**: (required) --- ---Applies to filter **"final-damage-amount"**: (required) --- ---Applies to filter **"final-health"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDamagedEventFilter) ---@field comparison ComparatorString ---Applies to filter **"original-damage-amount"**: (required) ---The value to compare against. --- ---Applies to filter **"final-damage-amount"**: (required) ---The value to compare against. --- ---Applies to filter **"final-health"**: (required) ---The value to compare against. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDamagedEventFilter) ---@field value float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDeconstructionCancelledEventFilter) ---@class LuaEntityDeconstructionCancelledEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDeconstructionCancelledEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDeconstructionCancelledEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDeconstructionCancelledEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDeconstructionCancelledEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDeconstructionCancelledEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDiedEventFilter) ---@class LuaEntityDiedEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDiedEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDiedEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDiedEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDiedEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityDiedEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForDeconstructionEventFilter) ---@class LuaEntityMarkedForDeconstructionEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForDeconstructionEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForDeconstructionEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForDeconstructionEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForDeconstructionEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForDeconstructionEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForUpgradeEventFilter) ---@class LuaEntityMarkedForUpgradeEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForUpgradeEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForUpgradeEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForUpgradeEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForUpgradeEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaEntityMarkedForUpgradeEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerBuiltEntityEventFilter) ---@class LuaPlayerBuiltEntityEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"`, `"force"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerBuiltEntityEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerBuiltEntityEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerBuiltEntityEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerBuiltEntityEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerBuiltEntityEventFilter) ---@field name string ---Applies to filter **"force"**: (required) ---The entity force --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerBuiltEntityEventFilter) ---@field force string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerMinedEntityEventFilter) ---@class LuaPlayerMinedEntityEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerMinedEntityEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerMinedEntityEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerMinedEntityEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerMinedEntityEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerMinedEntityEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerRepairedEntityEventFilter) ---@class LuaPlayerRepairedEntityEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerRepairedEntityEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerRepairedEntityEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerRepairedEntityEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerRepairedEntityEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPlayerRepairedEntityEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPostEntityDiedEventFilter) ---@class LuaPostEntityDiedEventFilter ---The condition to filter on. One of `"type"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPostEntityDiedEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPostEntityDiedEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPostEntityDiedEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPostEntityDiedEventFilter) ---@field type string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreGhostDeconstructedEventFilter) ---@class LuaPreGhostDeconstructedEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreGhostDeconstructedEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreGhostDeconstructedEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreGhostDeconstructedEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreGhostDeconstructedEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreGhostDeconstructedEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPrePlayerMinedEntityEventFilter) ---@class LuaPrePlayerMinedEntityEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPrePlayerMinedEntityEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPrePlayerMinedEntityEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPrePlayerMinedEntityEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPrePlayerMinedEntityEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPrePlayerMinedEntityEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreRobotMinedEntityEventFilter) ---@class LuaPreRobotMinedEntityEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreRobotMinedEntityEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreRobotMinedEntityEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreRobotMinedEntityEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreRobotMinedEntityEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaPreRobotMinedEntityEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotBuiltEntityEventFilter) ---@class LuaRobotBuiltEntityEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"`, `"force"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotBuiltEntityEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotBuiltEntityEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotBuiltEntityEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotBuiltEntityEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotBuiltEntityEventFilter) ---@field name string ---Applies to filter **"force"**: (required) ---The entity force --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotBuiltEntityEventFilter) ---@field force string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotMinedEntityEventFilter) ---@class LuaRobotMinedEntityEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotMinedEntityEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotMinedEntityEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotMinedEntityEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotMinedEntityEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaRobotMinedEntityEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedBuiltEventFilter) ---@class LuaScriptRaisedBuiltEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedBuiltEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedBuiltEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedBuiltEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedBuiltEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedBuiltEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedDestroyEventFilter) ---@class LuaScriptRaisedDestroyEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedDestroyEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedDestroyEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedDestroyEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedDestroyEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedDestroyEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedReviveEventFilter) ---@class LuaScriptRaisedReviveEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedReviveEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedReviveEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedReviveEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedReviveEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedReviveEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaSectorScannedEventFilter) ---@class LuaSectorScannedEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaSectorScannedEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaSectorScannedEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaSectorScannedEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaSectorScannedEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaSectorScannedEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaUpgradeCancelledEventFilter) ---@class LuaUpgradeCancelledEventFilter ---The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaUpgradeCancelledEventFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaUpgradeCancelledEventFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaUpgradeCancelledEventFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"ghost_type"**: (required) ---The ghost prototype type --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaUpgradeCancelledEventFilter) ---@field type string ---Applies to filter **"name"**: (required) ---The prototype name --- ---Applies to filter **"ghost_name"**: (required) ---The ghost prototype name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#LuaUpgradeCancelledEventFilter) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapExchangeStringData) ---@class MapExchangeStringData ---All the regular map settings plus an additional table called `difficulty_settings` that contains the [DifficultySettings](https://lua-api.factorio.com/latest/Concepts.html#DifficultySettings). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapExchangeStringData) ---@field map_settings MapSettings ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapExchangeStringData) ---@field map_gen_settings MapGenSettings ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@class MapGenSettings ---The inverse of 'water scale' in the map generator GUI. Lower `terrain_segmentation` increases the scale of elevation features (lakes, continents, etc). This behavior can be overridden with alternate elevation generators (see `property_expression_names`, below). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field terrain_segmentation MapGenSize ---The equivalent to 'water coverage' in the map generator GUI. Specifically, when this value is non-zero, `water_level = 10 * log2` (the value of this field), and the elevation generator subtracts water level from elevation before adding starting lakes. If water is set to 'none', elevation is clamped to a small positive value before adding starting lakes. This behavior can be overridden with alternate elevation generators (see `property_expression_names`, below). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field water MapGenSize ---Indexed by autoplace control prototype name. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field autoplace_controls table ---Whether undefined `autoplace_controls` should fall back to the default controls or not. Defaults to `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field default_enable_all_autoplace_controls boolean ---Each setting in this dictionary maps the string type to the settings for that type. Valid types are `"entity"`, `"tile"` and `"decorative"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field autoplace_settings table ---Map generation settings for entities of the type "cliff". --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field cliff_settings CliffPlacementSettings ---The random seed used to generated this map. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field seed uint ---Width in tiles. If `0`, the map has infinite width. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field width uint ---Height in tiles. If `0`, the map has infinite height. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field height uint ---Size of the starting area. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field starting_area MapGenSize ---Positions of the starting areas. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field starting_points Position[] ---Whether peaceful mode is enabled for this map. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field peaceful_mode boolean ---Overrides for tile property value generators. Values either name a NamedNoiseExpression or can be literal numbers, stored as strings (e.g. `"5"`). All other controls can be overridden by a property expression names. Notable properties: Climate controls ('Moisture' and 'Terrain type' at the bottom of the Terrain tab in the map generator GUI) don't have their own dedicated structures in MapGenSettings. Instead, their values are stored as property expression overrides with long names: All other MapGenSettings feed into named noise expressions, and therefore placement can be overridden by including the name of a property in this dictionary. The probability and richness functions for placing specific tiles, entities, and decoratives can be overridden by including an entry named `{tile|entity|decorative}:(prototype name):{probability|richness}`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings) ---@field property_expression_names table ---A floating point number specifying an amount. ---For backwards compatibility, MapGenSizes can also be specified as one of the following strings, which will be converted to a number (when queried, a number will always be returned): --- ---**Note:** The map generation algorithm officially supports the range of values the in-game map generation screen shows (specifically `0` and values from `1/6` to `6`). Values outside this range are not guaranteed to work as expected. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapGenSize) ---@class MapGenSize ---Various game-related settings. See `data/base/prototypes/map-settings.lua` for a description of all attributes. Updating any of the attributes will immediately take effect in the game engine. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapSettings) --- ---### Example ---Increase the number of short paths the pathfinder can cache. ---``` ---game.map_settings.path_finder.short_cache_size = 15 ---``` ---@class MapSettings ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapViewSettings) ---@class MapViewSettings ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapViewSettings) ---@field show-logistic-network boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapViewSettings) ---@field show-electric-network boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapViewSettings) ---@field show-turret-range boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapViewSettings) ---@field show-pollution boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapViewSettings) ---@field show-train-station-names boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapViewSettings) ---@field show-player-names boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapViewSettings) ---@field show-networkless-logistic-members boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MapViewSettings) ---@field show-non-standard-map-info boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModChangeData) ---@class ModChangeData ---Old version of the mod. May be `nil` if the mod wasn't previously present (i.e. it was just added). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModChangeData) ---@field old_version string ---New version of the mod. May be `nil` if the mod is no longer present (i.e. it was just removed). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModChangeData) ---@field new_version string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModSetting) ---@class ModSetting ---The value of the mod setting. The type depends on the setting. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModSetting) ---@field value uint|double|boolean|string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModSettingPrototypeFilter) ---@class ModSettingPrototypeFilter ---The condition to filter on. One of `"type"`, `"mod"`, `"setting-type"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModSettingPrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModSettingPrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModSettingPrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"type"**: (required) ---The prototype type --- ---Applies to filter **"setting-type"**: (required) ---The setting scope type (startup, runtime-global, or runtime-per-user) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModSettingPrototypeFilter) ---@field type string ---Applies to filter **"mod"**: (required) ---The mod name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModSettingPrototypeFilter) ---@field mod string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModuleEffectValue) ---@class ModuleEffectValue ---The percentual increase of the attribute. A value of `0.6` means a 60% increase. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModuleEffectValue) ---@field bonus float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModuleEffects) ---@class ModuleEffects ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModuleEffects) ---@field consumption ModuleEffectValue|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModuleEffects) ---@field speed ModuleEffectValue|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModuleEffects) ---@field productivity ModuleEffectValue|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ModuleEffects) ---@field pollution ModuleEffectValue|nil ---This is a set of flags given as a dictionary[[string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) → [boolean](https://lua-api.factorio.com/latest/Builtin-Types.html#boolean)]. When a flag is set, it is present in the dictionary with the value `true`. Unset flags aren't present in the dictionary at all. ---To write to this, use an array[[string](https://lua-api.factorio.com/latest/Builtin-Types.html#string)] of the mouse buttons that should be possible to use with on button. ---When setting flags, the flag `"left-and-right"` can also be set which will set `"left"` and `"right"` true. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#MouseButtonFlags) ---@class MouseButtonFlags ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#NoiseExpression) ---@class NoiseExpression ---Names the type of the expression and determines what other fields are required. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#NoiseExpression) ---@field type string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#NthTickEventData) ---@class NthTickEventData ---The tick during which the event happened. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#NthTickEventData) ---@field tick uint ---The nth tick this handler was registered to. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#NthTickEventData) ---@field nth_tick uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Offer) ---@class Offer ---List of prices. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Offer) ---@field price Ingredient[] ---The action that will take place when a player accepts the offer. Usually a `"give-item"` modifier. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Offer) ---@field offer TechnologyModifier ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#OldTileAndPosition) ---@class OldTileAndPosition ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#OldTileAndPosition) ---@field old_tile LuaTilePrototype ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#OldTileAndPosition) ---@field position TilePosition ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderFlags) ---@class PathfinderFlags ---Allows pathing through friendly entities. Default false. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderFlags) ---@field allow_destroy_friendly_entities boolean|nil ---Allows the pathfinder to path through entities of the same force. Default false. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderFlags) ---@field allow_paths_through_own_entities boolean|nil ---Enables path caching. This can be more efficient, but can fail to respond to changes in the environment. Default true. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderFlags) ---@field cache boolean|nil ---Tries to path in straight lines. Default false. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderFlags) ---@field prefer_straight_paths boolean|nil ---Sets lower priority on the path request, might mean it takes longer to find a path, at the expense of speeding up others. Default false. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderFlags) ---@field low_priority boolean|nil ---The pathfinder won't break in the middle of processing this pathfind, no matter how much work is needed. Default false. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderFlags) ---@field no_break boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderWaypoint) ---@class PathfinderWaypoint ---The position of the waypoint on its surface. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderWaypoint) ---@field position Position ---`true` if the path from the previous waypoint to this one goes through an entity that must be destroyed. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PathfinderWaypoint) ---@field needs_destroy_to_reach boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PersonalLogisticParameters) ---@class PersonalLogisticParameters ---The item. `nil` clears the filter. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PersonalLogisticParameters) ---@field name string|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PersonalLogisticParameters) ---@field min uint|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PersonalLogisticParameters) ---@field max uint|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PlaceAsTileResult) ---@class PlaceAsTileResult ---The tile prototype. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PlaceAsTileResult) ---@field result LuaTilePrototype ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PlaceAsTileResult) ---@field condition_size uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PlaceAsTileResult) ---@field condition table ---May be specified in one of the following ways: ---- [uint](https://lua-api.factorio.com/latest/Builtin-Types.html#uint): The player index., ---- [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string): The player name., ---- [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html): A reference to [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html) may be passed directly. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#PlayerIdentification) ---@class PlayerIdentification:uint,string,LuaPlayer ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Position) ---@class Position ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Position) ---@field x int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Position) ---@field y int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Product) ---@class Product ---`"item"` or `"fluid"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Product) ---@field type string ---Prototype name of the result. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Product) ---@field name string ---Amount of the item or fluid to give. If not specified, `amount_min`, `amount_max` and `probability` must all be specified. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Product) ---@field amount double|nil ---Minimal amount of the item or fluid to give. Has no effect when `amount` is specified. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Product) ---@field amount_min uint|double|nil ---Maximum amount of the item or fluid to give. Has no effect when `amount` is specified. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Product) ---@field amount_max uint|double|nil ---A value in range [0, 1]. Item or fluid is only given with this probability; otherwise no product is produced. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Product) ---@field probability double|nil ---How much of this product is a catalyst. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Product) ---@field catalyst_amount uint|double|nil ---Applies to **"fluid"**: (optional) ---The fluid temperature of this product. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Product) ---@field temperature double|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerAlertParameters) ---@class ProgrammableSpeakerAlertParameters ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerAlertParameters) ---@field show_alert boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerAlertParameters) ---@field show_on_map boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerAlertParameters) ---@field icon_signal_id SignalID ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerAlertParameters) ---@field alert_message string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerCircuitParameters) ---@class ProgrammableSpeakerCircuitParameters ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerCircuitParameters) ---@field signal_value_is_pitch boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerCircuitParameters) ---@field instrument_id uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerCircuitParameters) ---@field note_id uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerInstrument) ---@class ProgrammableSpeakerInstrument ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerInstrument) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerInstrument) ---@field notes string[] ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerParameters) ---@class ProgrammableSpeakerParameters ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerParameters) ---@field playback_volume double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerParameters) ---@field playback_globally boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ProgrammableSpeakerParameters) ---@field allow_polyphony boolean ---The smooth orientation. It is a [float](https://lua-api.factorio.com/latest/Builtin-Types.html#float) in the range `[0, 1)` that covers a full circle, starting at the top and going clockwise. This means a value of `0` indicates "north", a value of `0.5` indicates "south". ---For example then, a value of `0.625` would indicate "south-west", and a value of `0.875` would indicate "north-west". --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RealOrientation) ---@class RealOrientation ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RecipePrototypeFilter) ---@class RecipePrototypeFilter ---The condition to filter on. One of `"enabled"`, `"hidden"`, `"hidden-from-flow-stats"`, `"hidden-from-player-crafting"`, `"allow-as-intermediate"`, `"allow-intermediates"`, `"allow-decomposition"`, `"always-show-made-in"`, `"always-show-products"`, `"show-amount-in-title"`, `"has-ingredients"`, `"has-products"`, `"has-ingredient-item"`, `"has-ingredient-fluid"`, `"has-product-item"`, `"has-product-fluid"`, `"subgroup"`, `"category"`, `"energy"`, `"emissions-multiplier"`, `"request-paste-multiplier"`, `"overload-multiplier"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RecipePrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RecipePrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RecipePrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"has-ingredient-item"**: (optional) ---Matches if at least 1 ingredient is an item that matches these filters. --- ---Applies to filter **"has-ingredient-fluid"**: (optional) ---Matches if at least 1 ingredient is a fluid that matches these filters. --- ---Applies to filter **"has-product-item"**: (optional) ---Matches if at least 1 product is an item that matches these filters. --- ---Applies to filter **"has-product-fluid"**: (optional) ---Matches if at least 1 product is a fluid that matches these filters. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RecipePrototypeFilter) ---@field elem_filters ItemPrototypeFilter[]|nil ---Applies to filter **"subgroup"**: (required) ---A [LuaGroup](https://lua-api.factorio.com/latest/LuaGroup.html) (subgroup) name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RecipePrototypeFilter) ---@field subgroup string ---Applies to filter **"category"**: (required) ---A [LuaRecipeCategoryPrototype](https://lua-api.factorio.com/latest/LuaRecipeCategoryPrototype.html) name --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RecipePrototypeFilter) ---@field category string ---Applies to filter **"energy"**: (required) --- ---Applies to filter **"emissions-multiplier"**: (required) --- ---Applies to filter **"request-paste-multiplier"**: (required) --- ---Applies to filter **"overload-multiplier"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RecipePrototypeFilter) ---@field comparison ComparatorString ---Applies to filter **"energy"**: (required) ---The value to compare against. --- ---Applies to filter **"emissions-multiplier"**: (required) ---The value to compare against. --- ---Applies to filter **"request-paste-multiplier"**: (required) ---The value to compare against. --- ---Applies to filter **"overload-multiplier"**: (required) ---The value to compare against. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RecipePrototypeFilter) ---@field value double ---A value between 0 and 255 inclusive represented by one of the following named [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) or string version of the value (for example `"27"` and `"decals"` are both valid). Higher values are rendered on top of lower values. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RenderLayer) ---@class RenderLayer ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Resistance) ---@class Resistance ---Absolute damage decrease --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Resistance) ---@field decrease float ---Percentual damage decrease --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Resistance) ---@field percent float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RidingState) ---@class RidingState ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RidingState) ---@field acceleration defines.riding.acceleration ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#RidingState) ---@field direction defines.riding.direction ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptArea) ---@class ScriptArea ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptArea) ---@field area BoundingBox> ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptArea) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptArea) ---@field color Color ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptArea) ---@field id uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptPosition) ---@class ScriptPosition ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptPosition) ---@field position Position ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptPosition) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptPosition) ---@field color Color ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptPosition) ---@field id uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptRenderTarget) ---@class ScriptRenderTarget ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptRenderTarget) ---@field entity LuaEntity|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptRenderTarget) ---@field entity_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptRenderTarget) ---@field position Position|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptRenderVertexTarget) ---@class ScriptRenderVertexTarget ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptRenderVertexTarget) ---@field target Position|LuaEntity ---Only used if `target` is a LuaEntity. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#ScriptRenderVertexTarget) ---@field target_offset Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectedPrototypeData) ---@class SelectedPrototypeData ---E.g. `"entity"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectedPrototypeData) ---@field base_type string ---E.g. `"tree"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectedPrototypeData) ---@field derived_type string ---E.g. `"tree-05"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectedPrototypeData) ---@field name string ---This is a set of flags given as a dictionary[[string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) → [boolean](https://lua-api.factorio.com/latest/Builtin-Types.html#boolean)]. Set flags are present in the dictionary with the value `true`; unset flags aren't present at all. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@class SelectionModeFlags ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field any-entity boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field any-tile boolean|nil ---Entities that can be selected for blueprint. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field blueprint boolean|nil ---Buildable entities. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field buildable-type boolean|nil ---Entities that can be marked for deconstruction cancelling. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field cancel-deconstruct boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field cancel-upgrade boolean|nil ---Entities that can be marked for deconstruction. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field deconstruct boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field enemy boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field entity-with-force boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field entity-with-health boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field entity-with-owner boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field friend boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field items boolean|nil ---Entities that can be placed using an item. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field items-to-place boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field not-same-force boolean|nil ---Only select an area. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field nothing boolean|nil ---Entities with the same force as the selector. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field same-force boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field trees boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags) ---@field upgrade boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Signal) ---@class Signal ---ID of the signal. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Signal) ---@field signal SignalID ---Value of the signal. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Signal) ---@field count int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SignalID) ---@class SignalID ---`"item"`, `"fluid"`, or `"virtual"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SignalID) ---@field type string ---Name of the item, fluid or virtual signal. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SignalID) ---@field name string|nil ---May be specified in one of the following ways: ---- [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string): The name of the item, which represents a full stack of that item., ---- [ItemStackDefinition](https://lua-api.factorio.com/latest/Concepts.html#ItemStackDefinition): The detailed definition of an item stack. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SimpleItemStack) --- ---### Example ---Both of these lines specify an item stack of one iron plate: ---``` ---{name="iron-plate"} ---``` ---``` ---{name="iron-plate", count=1} ---``` --- ---### Example ---This is a stack of 47 copper plates: ---``` ---{name="copper-plate", count=47} ---``` --- ---### Example ---These are both full stacks of iron plates (for iron-plate, a full stack is 100 plates): ---``` ---"iron-plate" ---``` ---``` ---{name="iron-plate", count=100} ---``` ---@class SimpleItemStack:string,ItemStackDefinition ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@class SmokeSource ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field frequency double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field offset double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field position Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field north_position Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field east_position Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field south_position Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field west_position Vector|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field deviation Position|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field starting_frame_speed uint16 ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field starting_frame_speed_deviation double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field starting_frame uint16 ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field starting_frame_deviation double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field slow_down_factor uint8 ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field height float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field height_deviation float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field starting_vertical_speed float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field starting_vertical_speed_deviation float ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SmokeSource) ---@field vertical_speed_slowdown float ---A sound defined by a [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string). It can be either the name of a [sound prototype](https://wiki.factorio.com/Prototype/Sound) defined in the data stage or a path in the form `"type/name"`. The latter option can be sorted into three categories. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SoundPath) ---@class SoundPath ---Possible values are: ---- "game-effect" ---- "gui-effect" ---- "ambient" ---- "environment" ---- "walking" ---- "alert" ---- "wind" --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SoundType) ---@class SoundType ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SpawnPointDefinition) ---@class SpawnPointDefinition ---Evolution factor for which this weight applies. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SpawnPointDefinition) ---@field evolution_factor double ---Probability of spawning this unit at this evolution factor. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SpawnPointDefinition) ---@field weight double ---It is specified by [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string). It can be either the name of a [sprite prototype](https://wiki.factorio.com/Prototype/Sprite) defined in the data stage or a path in form "type/name". --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SpritePath) ---@class SpritePath ---May be specified in one of the following ways: ---- [uint](https://lua-api.factorio.com/latest/Builtin-Types.html#uint): It will be the index of the surface. `nauvis` has index `1`, the first surface-created surface will have index `2` and so on., ---- [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string): It will be the surface name. E.g. `"nauvis"`., ---- [LuaSurface](https://lua-api.factorio.com/latest/LuaSurface.html): A reference to [LuaSurface](https://lua-api.factorio.com/latest/LuaSurface.html) may be passed directly. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#SurfaceIdentification) ---@class SurfaceIdentification:uint,string,LuaSurface ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TabAndContent) ---@class TabAndContent ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TabAndContent) ---@field tab LuaGuiElement ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TabAndContent) ---@field content LuaGuiElement ---A dictionary of string to the four basic Lua types: `string`, `boolean`, `number`, `table`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Tags) --- ---### Example ---``` ---{a = 1, b = true, c = "three", d = {e = "f"}} ---``` ---@class Tags ---May be specified in one of the following ways: ---- [string](https://lua-api.factorio.com/latest/Builtin-Types.html#string): The technology name., ---- [LuaTechnology](https://lua-api.factorio.com/latest/LuaTechnology.html): A reference to [LuaTechnology](https://lua-api.factorio.com/latest/LuaTechnology.html) may be passed directly., ---- [LuaTechnologyPrototype](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html): A reference to [LuaTechnologyPrototype](https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html) may be passed directly. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyIdentification) ---@class TechnologyIdentification:string,LuaTechnology,LuaTechnologyPrototype ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyModifier) ---@class TechnologyModifier ---Modifier type. Specifies which of the other fields will be available. Possible values are: `"inserter-stack-size-bonus"`, `"stack-inserter-capacity-bonus"`, `"laboratory-speed"`, `"character-logistic-trash-slots"`, `"maximum-following-robots-count"`, `"worker-robot-speed"`, `"worker-robot-storage"`, `"ghost-time-to-live"`, `"turret-attack"`, `"ammo-damage"`, `"give-item"`, `"gun-speed"`, `"unlock-recipe"`, `"character-crafting-speed"`, `"character-mining-speed"`, `"character-running-speed"`, `"character-build-distance"`, `"character-item-drop-distance"`, `"character-reach-distance"`, `"character-resource-reach-distance"`, `"character-item-pickup-distance"`, `"character-loot-pickup-distance"`, `"character-inventory-slots-bonus"`, `"deconstruction-time-to-live"`, `"max-failed-attempts-per-tick-per-construction-queue"`, `"max-successful-attempts-per-tick-per-construction-queue"`, `"character-health-bonus"`, `"mining-drill-productivity-bonus"`, `"train-braking-force-bonus"`, `"zoom-to-world-enabled"`, `"zoom-to-world-ghost-building-enabled"`, `"zoom-to-world-blueprint-enabled"`, `"zoom-to-world-deconstruction-planner-enabled"`, `"zoom-to-world-upgrade-planner-enabled"`, `"zoom-to-world-selection-tool-enabled"`, `"worker-robot-battery"`, `"laboratory-productivity"`, `"follower-robot-lifetime"`, `"artillery-range"`, `"nothing"`, `"character-additional-mining-categories"`, `"character-logistic-requests"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyModifier) ---@field type string ---Applies to **"gun-speed"**: (required) ---Prototype name of the ammunition category that is affected --- ---Applies to **"ammo-damage"**: (required) ---Prototype name of the ammunition category that is affected --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyModifier) ---@field ammo_category string ---Applies to **"gun-speed"**: (required) ---Modification value. This will be added to the current gun speed modifier upon researching. --- ---Applies to **"ammo-damage"**: (required) ---Modification value. This will be added to the current ammo damage modifier upon researching. --- ---Applies to **"turret-attack"**: (required) ---Modification value. This will be added to the current turret damage modifier upon researching. --- ---Applies to **"Other types"**: (required) ---Modification value. This value will be added to the variable it modifies. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyModifier) ---@field modifier double ---Applies to **"give-item"**: (required) ---Item prototype name to give. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyModifier) ---@field item string ---Applies to **"give-item"**: (optional) ---Number of items to give. Defaults to `1`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyModifier) ---@field count uint|nil ---Applies to **"turret-attack"**: (required) ---Turret prototype name this modifier will affect. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyModifier) ---@field turret_id string ---Applies to **"unlock-recipe"**: (required) ---Recipe prototype name to unlock. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyModifier) ---@field recipe string ---Applies to **"nothing"**: (required) ---Description of this nothing modifier. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyModifier) ---@field effect_description LocalisedString ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyPrototypeFilter) ---@class TechnologyPrototypeFilter ---The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"level"`, `"max-level"`, `"time"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyPrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyPrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyPrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"research-unit-ingredient"**: (required) ---The research ingredient to check. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyPrototypeFilter) ---@field ingredient string ---Applies to filter **"level"**: (required) --- ---Applies to filter **"max-level"**: (required) --- ---Applies to filter **"time"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyPrototypeFilter) ---@field comparison ComparatorString ---Applies to filter **"level"**: (required) ---The value to compare against. --- ---Applies to filter **"max-level"**: (required) ---The value to compare against. --- ---Applies to filter **"time"**: (required) ---The value to compare against. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TechnologyPrototypeFilter) ---@field value uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Tile) ---@class Tile ---The position of the tile. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Tile) ---@field position Position ---The prototype name of the tile. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Tile) ---@field name string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePosition) ---@class TilePosition ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePosition) ---@field x int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePosition) ---@field y int ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePrototypeFilter) ---@class TilePrototypeFilter ---The condition to filter on. One of `"minable"`, `"autoplace"`, `"blueprintable"`, `"item-to-place"`, `"collision-mask"`, `"walking-speed-modifier"`, `"vehicle-friction-modifier"`, `"decorative-removal-probability"`, `"emissions"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePrototypeFilter) ---@field filter string ---How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePrototypeFilter) ---@field mode string|nil ---Inverts the condition. Default is `false`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePrototypeFilter) ---@field invert boolean|nil ---Applies to filter **"collision-mask"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePrototypeFilter) ---@field mask CollisionMask|CollisionMaskWithFlags ---Applies to filter **"collision-mask"**: (required) ---How to filter: `"collides"` or `"layers-equals"` --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePrototypeFilter) ---@field mask_mode string ---Applies to filter **"walking-speed-modifier"**: (required) --- ---Applies to filter **"vehicle-friction-modifier"**: (required) --- ---Applies to filter **"decorative-removal-probability"**: (required) --- ---Applies to filter **"emissions"**: (required) --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePrototypeFilter) ---@field comparison ComparatorString ---Applies to filter **"walking-speed-modifier"**: (required) ---The value to compare against. --- ---Applies to filter **"vehicle-friction-modifier"**: (required) ---The value to compare against. --- ---Applies to filter **"decorative-removal-probability"**: (required) ---The value to compare against. --- ---Applies to filter **"emissions"**: (required) ---The value to compare against. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TilePrototypeFilter) ---@field value double ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TrainSchedule) ---@class TrainSchedule ---Index of the currently active record --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TrainSchedule) ---@field current uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TrainSchedule) ---@field records TrainScheduleRecord[] ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TrainScheduleRecord) ---@class TrainScheduleRecord ---Name of the station. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TrainScheduleRecord) ---@field station string|nil ---Rail to path to. Ignored if `station` is present. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TrainScheduleRecord) ---@field rail LuaEntity|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TrainScheduleRecord) ---@field wait_conditions WaitCondition[] ---Only present when the station is temporary, the value is then always `true`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TrainScheduleRecord) ---@field temporary boolean|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerDelivery) ---@class TriggerDelivery ---One of `"instant"`, `"projectile"`, `"flame-thrower"`, `"beam"`, `"stream"`, `"artillery"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerDelivery) ---@field type string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerDelivery) ---@field source_effects TriggerEffectItem[] ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerDelivery) ---@field target_effects TriggerEffectItem[] ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerEffectItem) ---@class TriggerEffectItem ---One of`"damage"`, `"create-entity"`, `"create-explosion"`, `"create-fire"`, `"create-smoke"`, `"create-trivial-smoke"`, `"create-particle"`, `"create-sticker"`, `"nested-result"`, `"play-sound"`, `"push-back"`, `"destroy-cliffs"`, `"show-explosion-on-chart"`, `"insert-item"`, `"script"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerEffectItem) ---@field type string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerEffectItem) ---@field repeat_count uint ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerEffectItem) ---@field affects_target boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerEffectItem) ---@field show_in_tooltip boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerItem) ---@class TriggerItem ---One of `"direct"`, `"area"`, `"line"`, `"cluster"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerItem) ---@field type string ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerItem) ---@field action_delivery TriggerDelivery[]|nil ---The trigger will only affect entities that contain any of these flags. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerItem) ---@field entity_flags EntityPrototypeFlags|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerItem) ---@field ignore_collision_condition boolean ---The trigger will only affect entities that would collide with given collision mask. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerItem) ---@field collision_mask CollisionMask ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerItem) ---@field trigger_target_mask TriggerTargetMask ---If `"enemy"`, the trigger will only affect entities whose force is different from the attacker's and for which there is no cease-fire set. `"ally"` is the opposite of `"enemy"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerItem) ---@field force ForceCondition ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerItem) ---@field repeat_count uint ---This is a set of trigger target masks given as a dictionary[[string](https://lua-api.factorio.com/latest/Builtin-Types.html#string) → [boolean](https://lua-api.factorio.com/latest/Builtin-Types.html#boolean)]. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#TriggerTargetMask) ---@class TriggerTargetMask ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#UnitSpawnDefinition) ---@class UnitSpawnDefinition ---Prototype name of the unit that would be spawned. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#UnitSpawnDefinition) ---@field unit string ---The points at which to spawn the unit. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#UnitSpawnDefinition) ---@field spawn_points SpawnPointDefinition[] ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#UpgradeFilter) ---@class UpgradeFilter ---`"item"`, or `"entity"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#UpgradeFilter) ---@field type string ---Name of the item, or entity. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#UpgradeFilter) ---@field name string|nil ---A vector is a two-element array containing the `x` and `y` components. In some specific cases, the vector is a table with `x` and `y` keys instead, which the documentation will point out. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#Vector) --- ---### Example ---``` ---right = {1.0, 0.0} ---``` ---@class Vector ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#VehicleAutomaticTargetingParameters) ---@class VehicleAutomaticTargetingParameters ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#VehicleAutomaticTargetingParameters) ---@field auto_target_without_gunner boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#VehicleAutomaticTargetingParameters) ---@field auto_target_with_gunner boolean ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WaitCondition) ---@class WaitCondition ---One of `"time"`, `"inactivity"`, `"full"`, `"empty"`, `"item_count"`, `"circuit"`, `"robots_inactive"`, `"fluid_count"`, `"passenger_present"`, `"passenger_not_present"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WaitCondition) ---@field type string ---Either `"and"`, or `"or"`. Tells how this condition is to be compared with the preceding conditions in the corresponding `wait_conditions` array. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WaitCondition) ---@field compare_type string ---Number of ticks to wait or of inactivity. Only present when `type` is `"time"` or `"inactivity"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WaitCondition) ---@field ticks uint|nil ---Only present when `type` is `"item_count"`, `"circuit"` or `"fluid_count"`. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WaitCondition) ---@field condition CircuitCondition|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WireConnectionDefinition) ---@class WireConnectionDefinition ---Wire color, either [defines.wire_type.red](https://lua-api.factorio.com/latest/defines.html#defines.wire_type.red) or [defines.wire_type.green](https://lua-api.factorio.com/latest/defines.html#defines.wire_type.green). --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WireConnectionDefinition) ---@field wire defines.wire_type ---The entity to (dis)connect the source entity with. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WireConnectionDefinition) ---@field target_entity LuaEntity ---Mandatory if the source entity has more than one circuit connector and using circuit wire. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WireConnectionDefinition) ---@field source_circuit_id uint|nil ---Mandatory if the target entity has more than one circuit connector and using circuit wire. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WireConnectionDefinition) ---@field target_circuit_id uint|nil ---Mandatory if the source entity has more than one circuit connector and using circuit wire. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WireConnectionDefinition) ---@field source_wire_id uint|nil ---Mandatory if the target entity has more than one circuit connector and using circuit wire. --- ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#WireConnectionDefinition) ---@field target_wire_id uint|nil ---@class MapGenPreset ---@class PrototypeFilter ---@class BlueprintCircuitConnection ---@class BlueprintControlBehavior ---@field condition CircuitCondition|nil ---@field circuit_condition CircuitCondition|nil ---@field filters Signal[]|nil ---@field is_on boolean|nil ---@field arithmetic_conditions ArithmeticCombinatorParameters|nil ---@field decider_conditions DeciderCombinatorParameters|nil ---@field circuit_enable_disable boolean|nil ---@field circuit_read_resources boolean|nil ---@field circuit_resource_read_mode defines.control_behavior.mining_drill.resource_read_mode|nil ---@field read_stopped_train boolean|nil ---@field train_stopped_signal SignalID|nil ---@field read_from_train boolean|nil ---@field send_to_train boolean|nil ---@field circuit_mode_of_operation number|nil ---@field circuit_read_hand_contents boolean|nil ---@field circuit_hand_read_mode defines.control_behavior.inserter|nil ---@field circuit_set_stack_size boolean|nil ---@field stack_control_input_signal SignalID|nil ---@field use_colors boolean|nil ---@field read_robot_stats boolean|nil ---@field read_logistics boolean|nil ---@field available_logistic_output_signal boolean|nil ---@field total_logistic_output_signal boolean|nil ---@field available_construction_output_signal boolean|nil ---@field total_construction_output_signal boolean|nil ---@field circuit_contents_read_mode defines.control_behavior.transport_belt|nil ---@field output_signal SignalID|nil ---@field circuit_close_signal boolean|nil ---@field circuit_read_signal boolean|nil ---@field red_output_signal SignalID|nil ---@field orange_output_signal SignalID|nil ---@field green_output_signal SignalID|nil ---@field blue_output_signal SignalID|nil ---@field circuit_open_gate boolean|nil ---@field circuit_read_sensor boolean|nil ---@field circuit_parameters ProgrammableSpeakerCircuitParameters|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.level) ---@class LuaBootstrap.level ---Is this level a simulation? (The main menu and 'Tips and tricks' use simulations) --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.level) ---@field is_simulation boolean|nil ---Is this level a tutorial? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.level) ---@field is_tutorial boolean|nil ---The campaign name if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.level) ---@field campaign_name string|nil ---The level name. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.level) ---@field level_name string ---The mod name if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.level) ---@field mod_name string|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@class LuaBurnerPrototype.light_flicker ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@field minimum_intensity float ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@field maximum_intensity float ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@field derivation_change_frequency float ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@field derivation_change_deviation float ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@field border_fix_speed float ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@field minimum_light_size float ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@field light_intensity_to_size_coefficient float ---[View documentation](https://lua-api.factorio.com/latest/LuaBurnerPrototype.html#LuaBurnerPrototype.light_flicker) ---@field color Color ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.mining_state) ---@class LuaControl.mining_state ---Whether the player is mining at all --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.mining_state) ---@field mining boolean ---What tiles the player is mining; only used when the player is mining tiles (holding a tile in the cursor). --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.mining_state) ---@field position Position|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.repair_state) ---@class LuaControl.repair_state ---The current state --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.repair_state) ---@field repairing boolean ---The position being repaired --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.repair_state) ---@field position Position ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.shooting_state) ---@class LuaControl.shooting_state ---The current state --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.shooting_state) ---@field state defines.shooting ---The position being shot at --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.shooting_state) ---@field position Position ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.walking_state) ---@class LuaControl.walking_state ---If `false`, the player is currently not walking; otherwise it's going somewhere --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.walking_state) ---@field walking boolean ---Direction where the player is walking --- ---[View documentation](https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.walking_state) ---@field direction defines.direction ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.circuit_connected_entities) ---@class LuaEntity.circuit_connected_entities ---Entities connected via the red wire. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.circuit_connected_entities) ---@field red LuaEntity[] ---Entities connected via the green wire. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.circuit_connected_entities) ---@field green LuaEntity[] ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@class LuaEntityPrototype.created_smoke ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field smoke_name string ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field offsets Vector[] ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field offset_deviation BoundingBox> ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field initial_height float ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field max_radius float|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field speed Vector ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field speed_multiplier float ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field speed_multiplier_deviation float ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field starting_frame float ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field starting_frame_deviation float ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field starting_frame_speed float ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field starting_frame_speed_deviation float ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field speed_from_center float ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.created_smoke) ---@field speed_from_center_deviation float ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties) ---@class LuaEntityPrototype.mineable_properties ---Is this entity mineable at all? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties) ---@field minable boolean ---Energy required to mine an entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties) ---@field mining_time double ---Prototype name of the particle produced when mining this entity. Will only be present if this entity produces any particle during mining. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties) ---@field mining_particle string|nil ---Products obtained by mining this entity. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties) ---@field products Product[]|nil ---The required fluid amount if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties) ---@field fluid_amount double|nil ---The prototype name of the required fluid if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties) ---@field required_fluid string|nil ---The mining trigger if any. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.mineable_properties) ---@field mining_trigger TriggerItem[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.spawn_cooldown) ---@class LuaEntityPrototype.spawn_cooldown ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.spawn_cooldown) ---@field min double ---[View documentation](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.spawn_cooldown) ---@field max double ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.shape) ---@class LuaEquipment.shape ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.shape) ---@field width uint ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipment.html#LuaEquipment.shape) ---@field height uint ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@class LuaEquipmentPrototype.logistic_parameters ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field spawn_and_station_height float ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field spawn_and_station_shadow_height_offset float ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field charge_approach_distance float ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field logistic_radius float ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field construction_radius float ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field charging_station_count uint ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field charging_distance float ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field charging_station_shift Vector ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field charging_energy double ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field charging_threshold_distance float ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field robot_vertical_acceleration float ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field stationing_offset Vector ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field robot_limit uint ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field logistics_connection_distance float ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.logistic_parameters) ---@field robots_shrink_when_entering_and_exiting boolean ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.shape) ---@class LuaEquipmentPrototype.shape ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.shape) ---@field width uint ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.shape) ---@field height uint ---Only set when the shape is "manual" --- ---[View documentation](https://lua-api.factorio.com/latest/LuaEquipmentPrototype.html#LuaEquipmentPrototype.shape) ---@field points EquipmentPoint[]|nil ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.mineable_properties) ---@class LuaTilePrototype.mineable_properties ---Is this tile mineable at all? --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.mineable_properties) ---@field minable boolean ---Energy required to mine a tile. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.mineable_properties) ---@field miningtime double ---Prototype name of the particle produced when mining this tile. Will only be present if this tile produces any particle during mining. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.mineable_properties) ---@field miningparticle string|nil ---Products obtained by mining this tile. --- ---[View documentation](https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.mineable_properties) ---@field products Product[] ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@class BlueprintEntity.inventory ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field bar number|nil ---[View documentation](https://lua-api.factorio.com/latest/Concepts.html#BlueprintEntity) ---@field filters InventoryFilter[]|nil