Files
project-cybersyn/.vscode/factorio/runtime-api-LuaGameScript.lua
Monica Moniot 30fe2946e6 updated api
2022-12-01 19:04:58 -05:00

1046 lines
59 KiB
Lua

---@meta
---@diagnostic disable
--$Factorio 1.1.72
--$Overlay 5
--$Section LuaGameScript
-- This file is automatically generated. Edits will be overwritten.
---**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:LuaObject
---[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<string,LuaAchievementPrototype>
---[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 {[string]: string}
---[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<string,LuaAmmoCategoryPrototype>
---[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<string,LuaAutoplaceControlPrototype>
---[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<uint,string>
---[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<string,LuaCustomInputPrototype>
---[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<string,LuaDamagePrototype>
---[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<string,LuaDecorativePrototype>
---[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<string,LuaEntityPrototype>
---[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<string,LuaEquipmentCategoryPrototype>
---[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<string,LuaEquipmentGridPrototype>
---[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<string,LuaEquipmentPrototype>
---[R]
---True while the victory screen is shown.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.finished)
---@field finished boolean
---[R]
---True after players finished the game and clicked "continue".
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.finished_but_continuing)
---@field finished_but_continuing 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<string,LuaFluidPrototype>
---[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<string,LuaFontPrototype>
---[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<uint|string,LuaForce>
---[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<string,LuaFuelCategoryPrototype>
---[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<string,LuaGroup>
---[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<string,LuaItemPrototype>
---[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<string,LuaGroup>
---[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<string,MapGenPreset>
---[R]
---The currently active set of map settings. Even though this property is marked as read-only, the members of the dictionary that is returned can be modified mid-game.
---
---**Note:** This does not contain difficulty settings, use [LuaGameScript::difficulty_settings](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.difficulty_settings) instead.
---
---[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<string,LuaModSettingPrototype>
---[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<string,LuaModuleCategoryPrototype>
---[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<string,LuaNamedNoiseExpression>
---[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<string,LuaNoiseLayerPrototype>
---[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<string,LuaParticlePrototype>
---[R]
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.permissions)
---@field permissions LuaPermissionGroups
---[R]
---This property is only populated inside [custom command](https://lua-api.factorio.com/latest/LuaCommandProcessor.html) handlers and when writing [Lua console commands](https://wiki.factorio.com/Console#Scripting_and_cheat_commands). Returns the player that is typing the command, `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.
---
---If only a single player is required, [LuaGameScript::get_player](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_player) should be used instead, as it avoids the unnecessary overhead of passing the whole table to Lua.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players)
---@field players LuaCustomTable<uint|string,LuaPlayer>
---[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<string,LuaRecipeCategoryPrototype>
---[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<string,LuaRecipePrototype>
---[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<string,LuaResourceCategoryPrototype>
---[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<string,LuaShortcutPrototype>
---[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<string,string>
---[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<uint|string,LuaSurface>
---[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<string,LuaTechnologyPrototype>
---[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<string,LuaTilePrototype>
---[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<string,LuaTrivialSmokePrototype>
---[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<string,LuaVirtualSignalPrototype>
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.
---
---**Events:**
--- * Will raise [on_console_command](https://lua-api.factorio.com/latest/events.html#on_console_command) instantly.
---
--- * Will raise [on_player_banned](https://lua-api.factorio.com/latest/events.html#on_player_banned) instantly.
---
---[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.
---
---**Events:**
--- * Will raise [on_force_created](https://lua-api.factorio.com/latest/events.html#on_force_created) instantly.
---
---[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 using [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.
---
---**Events:**
--- * Will raise [on_surface_created](https://lua-api.factorio.com/latest/events.html#on_surface_created) instantly.
---
---[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.
---
---**Events:**
--- * Will raise [on_pre_surface_deleted](https://lua-api.factorio.com/latest/events.html#on_pre_surface_deleted) in a future tick.
---
--- * Will raise [on_surface_deleted](https://lua-api.factorio.com/latest/events.html#on_surface_deleted) in a future tick.
---
---[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 {[string]: double}?@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 determine.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_active_entities_count)
---@param surface SurfaceIdentification?@If given, 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<string,LuaAchievementPrototype>
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<string,LuaDecorativePrototype>
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<string,LuaEntityPrototype>
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<string,LuaEquipmentPrototype>
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<string,LuaFluidPrototype>
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<string,LuaItemPrototype>
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<string,LuaModSettingPrototype>
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<string,LuaRecipePrototype>
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<string,LuaTechnologyPrototype>
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<string,LuaTilePrototype>
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.
---
---[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 {[string]: LuaInventory[]}@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
---The name(s) of the train stops. Not providing names will match any stop.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_train_stops)
---@field name? string|string[]
---The surface to search. Not providing a surface will match stops on any surface.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_train_stops)
---@field surface? SurfaceIdentification
---The force to search. Not providing a force will match stops in any force.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.get_train_stops)
---@field force? ForceIdentification
---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. 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 string 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.
---
---**Events:**
--- * Will raise [on_console_command](https://lua-api.factorio.com/latest/events.html#on_console_command) instantly.
---
--- * Will raise [on_player_kicked](https://lua-api.factorio.com/latest/events.html#on_player_kicked) instantly.
---
---[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 merged together. All players and entities in the source force will be reassigned to the target force. The source force will then be destroyed. Importantly, this does not merge technologies or bonuses, which are instead retained from the target force.
---
---**Note:** The three built-in forces (player, enemy and neutral) can't be destroyed, meaning they can't be used as the source argument to this function.
---
---**Note:** The source force is not removed 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) or [on_forces_merged](https://lua-api.factorio.com/latest/events.html#on_forces_merged) event, the end of the next tick.
---
---**Events:**
--- * Will raise [on_forces_merged](https://lua-api.factorio.com/latest/events.html#on_forces_merged) in a future tick.
---
--- * Will raise [on_forces_merging](https://lua-api.factorio.com/latest/events.html#on_forces_merging) in a future 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.
---
---**Events:**
--- * Will raise [on_console_command](https://lua-api.factorio.com/latest/events.html#on_console_command) instantly.
---
--- * Will raise [on_player_muted](https://lua-api.factorio.com/latest/events.html#on_player_muted) instantly.
---
---[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? MapPosition
---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
---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
---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.
---
---**Events:**
--- * Will raise [on_console_command](https://lua-api.factorio.com/latest/events.html#on_console_command) instantly.
---
---[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.
---
---**Events:**
--- * Will raise [on_player_removed](https://lua-api.factorio.com/latest/events.html#on_player_removed) instantly.
---
--- * Will raise [on_pre_player_removed](https://lua-api.factorio.com/latest/events.html#on_pre_player_removed) instantly.
---
---[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 a file or directory in the `script-output` folder, located in the game's [user data directory](https://wiki.factorio.com/User_data_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@The path to the file or directory to remove, relative to `script-output`.
remove_path=function(path)end,
---Reset scenario state (game_finished, player_won, etc.).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.reset_game_state)
reset_game_state=function()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. Any parameters not provided do not change the current 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
---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
---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
---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
---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
---The player to focus on. Defaults to the local player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field player? PlayerIdentification
---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
---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
---If defined, the screenshot will be centered on this position. Otherwise, the screenshot will center on `player`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field position? MapPosition
---The maximum allowed resolution is 16384x16384 (8192x8192 when `anti_alias` is `true`), but the maximum recommended resolution is 4096x4096 (resp. 2048x2048).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field resolution? TilePosition
---The map zoom to take the screenshot at. Defaults to `1`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field zoom? double
---The name of the image file. It should include a file extension indicating the desired format. Supports `.png`, `.jpg` /`.jpeg`, `.tga` and `.bmp`. Providing a directory path (ex. `"save/here/screenshot.png"`) will create the necessary folder structure in `script-output`. Defaults to `"screenshot.png"`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field path? string
---Whether to include GUIs in the screenshot or not. Defaults to `false`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field show_gui? boolean
---Whether to include entity info ("Alt mode") or not. Defaults to `false`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field show_entity_info? boolean
---When `true` and when `player` is specified, the building preview for the item in the player's cursor will also be rendered. Defaults to `false`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field show_cursor_building_preview? boolean
---Whether to render in double resolution and downscale the result (including GUI). Defaults to `false`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field anti_alias? boolean
---The `.jpg` render quality as a percentage (from 0% to 100% inclusive), if used. A lower value means a more compressed image. Defaults to `80`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field quality? int
---Whether to save the screenshot even during replay playback. Defaults to `false`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field allow_in_replay? boolean
---Overrides the current surface daytime for the duration of screenshot rendering.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field daytime? double
---Overrides the 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
---Screenshot requests are processed in between game update and render. The game may skip rendering (ie. drop frames) if the previous frame has not finished rendering or the game simulation starts to fall below 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. Defaults to `false`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot)
---@field force_render? boolean
---Take a screenshot of the game and save it to the `script-output` folder, located in the game's [user data directory](https://wiki.factorio.com/User_data_directory). The name of the image file can be specified via the `path` parameter.
---
---**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 whose technology to screenshot. 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
---The name of the image file. It should include a file extension indicating the desired format. Supports `.png`, `.jpg` /`.jpeg`, `.tga` and `.bmp`. Providing a directory path (ex. `"save/here/screenshot.png"`) will create the necessary folder structure in `script-output`. Defaults to `"technology-screenshot.png"`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot)
---@field path? string
---If given, 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
---The technology to highlight.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot)
---@field selected_technology? TechnologyIdentification
---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
---The `.jpg` render quality as a percentage (from 0% to 100% inclusive), if used. A lower value means a more compressed image. Defaults to `80`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot)
---@field quality? int
---Take a screenshot of the technology screen and save it to the `script-output` folder, located in the game's [user data directory](https://wiki.factorio.com/User_data_directory). The name of the image file can be specified via the `path` parameter.
---
---[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.
---
---**Events:**
--- * Will raise [on_console_command](https://lua-api.factorio.com/latest/events.html#on_console_command) instantly.
---
--- * Will raise [on_player_unbanned](https://lua-api.factorio.com/latest/events.html#on_player_unbanned) instantly.
---
---[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.
---
---**Events:**
--- * Will raise [on_console_command](https://lua-api.factorio.com/latest/events.html#on_console_command) instantly.
---
--- * Will raise [on_player_unmuted](https://lua-api.factorio.com/latest/events.html#on_player_unmuted) instantly.
---
---[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 file to the `script-output` folder, located in the game's [user data directory](https://wiki.factorio.com/User_data_directory). The name and file extension of the file can be specified via the `filename` parameter.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.write_file)
---@param filename string@The name of the file. Providing a directory path (ex. `"save/here/example.txt"`) will create the necessary folder structure in `script-output`.
---@param data LocalisedString@The content to write to the file.
---@param append boolean?@If `true`, `data` will be appended 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`. Providing `0` will only write to the server's output if present.
write_file=function(filename,data,append,for_player)end,
}