### Server Settings Example JSON Fix Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Corrects a syntax error in the `server-settings.example.json` file by removing an extraneous comma at the end. This ensures the example file is valid JSON. ```json { "//": "Example server settings", "name": "My Server", "description": "A Factorio server", "max_players": 16, "//": "... other settings ..." } // Removed trailing comma from the end of the file. ``` -------------------------------- ### Configuration: Set Preferred Screen Index for Fullscreen Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Allows setting a preferred screen index in the `config.ini` file under the `[graphics]` section to specify which monitor to use for fullscreen games. This addresses issues with starting fullscreen games on non-primary displays. ```ini [graphics] preffered-screen-index=0 ``` -------------------------------- ### Bind IP Address for Hosting Games (Factorio Command Line) Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Command-line option for Factorio to specify the IP address on which to host a game. This allows users to control network binding for dedicated servers or multiplayer hosting. Example usage demonstrates specifying an IP address. ```bash factorio --bind 192.168.1.100 ``` -------------------------------- ### Server Configuration for Game Visibility (Factorio) Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Defines separate settings for public and LAN game visibility in Factorio. These settings can be toggled at runtime using the /config command. The example JSON shows the new format for specifying visibility. ```json { "public_visibility": true, "lan_visibility": false } ``` -------------------------------- ### Modding API: Attack Parameters Warmup (Lua) Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Adds a 'warmup' field to attack parameters. This defines a delay before the effects of an attack take place, while animation and sound effects can start immediately. This is currently used for spitter shooting animations. ```lua -- Example structure for attack parameters: attack_parameters = { type = "...", ammo_type = {...}, warmup = 1.5 -- Delay in seconds before effects trigger } ``` -------------------------------- ### Factorio Map Generation Settings (JSON) Source: https://context7.com/wube/factorio-data/llms.txt Specifies configuration settings for Factorio's map generation. This JSON object controls parameters like world dimensions, starting area, resource distribution, cliff settings, and enemy base placement. It allows for deep customization of new game worlds. ```json { "width": 0, "height": 0, "starting_area": 1, "peaceful_mode": false, "autoplace_controls": { "coal": {"frequency": 1, "size": 1, "richness": 1}, "stone": {"frequency": 1, "size": 1, "richness": 1}, "copper-ore": {"frequency": 1, "size": 1, "richness": 1}, "iron-ore": {"frequency": 1, "size": 1, "richness": 1}, "uranium-ore": {"frequency": 1, "size": 1, "richness": 1}, "crude-oil": {"frequency": 1, "size": 1, "richness": 1}, "water": {"frequency": 1, "size": 1}, "trees": {"frequency": 1, "size": 1}, "enemy-base": {"frequency": 1, "size": 1} }, "cliff_settings": { "name": "cliff", "cliff_elevation_0": 10, "cliff_elevation_interval": 40, "richness": 1 }, "property_expression_names": { "control:moisture:frequency": "1", "control:moisture:bias": "0" }, "starting_points": [{"x": 0, "y": 0}], "seed": null } ``` -------------------------------- ### Entity Prototype Collision Box Setup (Modding) Source: https://github.com/wube/factorio-data/blob/master/changelog.txt This snippet describes a new modding feature in Factorio. It allows entities with health to automatically use the collision box of their parent entity. The `auto_setup_collision_box` property on `LuaEntityPrototype` defaults to true, enabling this behavior. ```lua -- Corpses used by entities with health automatically use the collision box of the parent entity. -- Added LuaEntityPrototype::auto_setup_collision_box which defaults to true. ``` -------------------------------- ### Define Crafting Recipes in Lua Source: https://context7.com/wube/factorio-data/llms.txt Recipes specify how items and fluids are crafted, including ingredients, results, crafting time, and allowed machines. They can be enabled by default or unlocked via technology. This Lua example demonstrates defining two recipes: 'advanced-component' and 'advanced-oil-processing'. ```lua data:extend({ { type = "recipe", name = "advanced-component", enabled = false, ingredients = { {type = "item", name = "iron-plate", amount = 2}, {type = "item", name = "copper-cable", amount = 4}, {type = "item", name = "electronic-circuit", amount = 1} }, energy_required = 5, results = {{type = "item", name = "advanced-component", amount = 1}}, allow_productivity = true }, { type = "recipe", name = "advanced-oil-processing", category = "oil-processing", enabled = false, energy_required = 5, ingredients = { {type = "fluid", name = "water", amount = 50}, {type = "fluid", name = "crude-oil", amount = 100} }, results = { {type = "fluid", name = "heavy-oil", amount = 25}, {type = "fluid", name = "light-oil", amount = 45}, {type = "fluid", name = "petroleum-gas", amount = 55} }, allow_productivity = true, icon = "__base__/graphics/icons/fluid/advanced-oil-processing.png", subgroup = "fluid-recipes", order = "a[oil-processing]-b[advanced-oil-processing]" } }) ``` -------------------------------- ### Server Settings for Minimum Latency (Factorio) Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Configuration option for headless Factorio servers to set a minimum latency in ticks. This can help stabilize gameplay by preventing issues caused by very low latency. It can be set in server settings and in the config for GUI-based game starts. ```json { "minimum_latency_in_ticks": 10 } ``` -------------------------------- ### Bugfix: Biter Group Tolerance Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Corrects the tolerance for biters getting stuck when in groups. This aims to improve AI behavior and prevent unintended pathing issues. ```plaintext - Fixed that biters in groups had too low tolerance for getting stuck. ``` -------------------------------- ### Add --window-size launch option Source: https://github.com/wube/factorio-data/blob/master/changelog.txt This feature allows users to specify the game window dimensions directly from the command line. It's useful for setting up specific resolutions for testing or gameplay without needing to change in-game settings. The format is --window-size=WIDTHxHEIGHT. ```bash --window-size=1680x1050 ``` -------------------------------- ### Add LuaEquipmentGridPrototype and LuaEquipmentGrid::prototype read Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Introduces the LuaEquipmentGridPrototype and allows reading the prototype from LuaEquipmentGrid. This is part of the modding enhancements for equipment grids. ```lua Added LuaEquipmentGridPrototype Added LuaEquipmentGrid::prototype read. ``` -------------------------------- ### Define Technologies in Lua Source: https://context7.com/wube/factorio-data/llms.txt Technologies represent researchable advancements that unlock recipes, bonuses, and other capabilities. They define prerequisites, research cost, and effects. This Lua example shows two technology definitions: 'advanced-components' and 'physical-projectile-damage-1'. ```lua data:extend({ { type = "technology", name = "advanced-components", icon = "__my-mod__/graphics/technology/advanced-components.png", icon_size = 256, effects = { {type = "unlock-recipe", recipe = "advanced-component"}, {type = "unlock-recipe", recipe = "my-assembler"} }, prerequisites = {"electronics", "automation-science-pack"}, unit = { count = 100, ingredients = { {"automation-science-pack", 1}, {"logistic-science-pack", 1} }, time = 30 } }, { type = "technology", name = "physical-projectile-damage-1", icons = util.technology_icon_constant_damage("__base__/graphics/technology/physical-projectile-damage-1.png"), effects = { {type = "ammo-damage", ammo_category = "bullet", modifier = 0.1}, {type = "turret-attack", turret_id = "gun-turret", modifier = 0.1} }, prerequisites = {"military"}, unit = { count = 100, ingredients = {"automation-science-pack", 1}, time = 30 }, upgrade = true } }) ``` -------------------------------- ### Create Entity with Settings in Lua (Factorio Scripting) Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Demonstrates how to create an entity with specific settings in Factorio using Lua scripting. This allows for custom entity configurations at creation time, similar to blueprint entity settings. ```lua game.create_entity{name="wooden-chest", bar=5, position = {0, 0}} ``` -------------------------------- ### Define Fluids in Lua Source: https://context7.com/wube/factorio-data/llms.txt Fluids represent liquid and gaseous substances used in recipes and flowing through pipes. They have properties like temperature and color. This Lua example defines two fluids: 'coolant' and 'steam', specifying their characteristics. ```lua data:extend({ { type = "fluid", name = "coolant", subgroup = "fluid", default_temperature = 25, max_temperature = 200, heat_capacity = "1kJ", base_color = {r = 0.2, g = 0.6, b = 0.9}, flow_color = {r = 0.5, g = 0.8, b = 1.0}, icon = "__my-mod__/graphics/icons/fluid/coolant.png", order = "a[fluid]-c[coolant]" }, { type = "fluid", name = "steam", subgroup = "fluid", default_temperature = 15, max_temperature = 5000, heat_capacity = "0.2kJ", icon = "__base__/graphics/icons/fluid/steam.png", base_color = {0.5, 0.5, 0.5}, flow_color = {1.0, 1.0, 1.0}, order = "a[fluid]-a[water]-b[steam", gas_temperature = 15, auto_barrel = false } }) ``` -------------------------------- ### LuaItemStack Readability Source: https://github.com/wube/factorio-data/blob/master/changelog.txt LuaItemStack can now read any inventory slot, with `valid_for_read` check. ```APIDOC ## LuaItemStack Readability ### Description `LuaItemStack` can now be used to read any inventory slot, even if the item in the slot is invalid. Use `LuaItemStack::valid_for_read` before accessing normal properties and methods. ### Method `valid_for_read` (read) ### Endpoint `LuaItemStack` ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```lua local inventory_slot = ... -- Get an inventory slot as a LuaItemStack if inventory_slot.valid_for_read then print("Item name: " .. inventory_slot.name) else print("Slot is empty or invalid.") end ``` ### Response #### Success Response (200) - **valid_for_read**: (boolean) True if the item stack is valid for reading, false otherwise. #### Response Example ```json { "valid_for_read": true } ``` ``` -------------------------------- ### Scripting: LuaEquipmentPrototype::attack_parameters Read Access Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Read access has been added for `LuaEquipmentPrototype::attack_parameters`. This allows scripts to retrieve the attack parameters associated with equipment prototypes. ```lua -- Added LuaEquipmentPrototype::attack_parameters read. ``` -------------------------------- ### Bugfix: Chest Accessibility with Modded Collision Boxes Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Fixes a bug where a mod changing a chest's collision box could break PvP starting chest accessibility. This ensures consistent accessibility regardless of collision box modifications. ```plaintext - Fixed mod changing chest collision box could break PvP starting chest accessibility. ``` -------------------------------- ### Define Virtual Signals in Lua Source: https://context7.com/wube/factorio-data/llms.txt Virtual signals are circuit network signals not tied to physical items, used for logic and signaling. This Lua example defines three virtual signals: 'signal-custom', 'signal-red', and 'signal-everything', specifying their icons and order. ```lua data:extend({ { type = "virtual-signal", name = "signal-custom", icon = "__my-mod__/graphics/icons/signal/signal-custom.png", subgroup = "virtual-signal-special", order = "e[custom]-[1signal-custom]" }, { type = "virtual-signal", name = "signal-red", icon = "__base__/graphics/icons/signal/signal_red.png", subgroup = "virtual-signal-color", order = "d[colors]-[1red]" }, { type = "virtual-signal", name = "signal-everything", icon = "__base__/graphics/icons/signal/signal_everything.png", subgroup = "virtual-signal-special", order = "a[special]-[1everything]" } }) ``` -------------------------------- ### Add LuaSurface::min_brightness Read/Write Source: https://github.com/wube/factorio-data/blob/master/changelog.txt This snippet demonstrates the addition of read/write capabilities for the 'min_brightness' property on Lua surfaces. This allows for dynamic control over surface brightness through scripting. ```lua -- Read min_brightness local brightness = surface.min_brightness -- Write min_brightness surface.min_brightness = 0.5 ``` -------------------------------- ### Configure Factorio Server Settings (JSON) Source: https://context7.com/wube/factorio-data/llms.txt Defines configuration options for dedicated Factorio multiplayer servers, including visibility, player limits, authentication, and autosave behavior. This JSON object controls various server parameters. ```json { "name": "My Factorio Server", "description": "A friendly multiplayer server", "tags": ["vanilla", "friendly"], "max_players": 16, "visibility": { "public": true, "lan": true }, "username": "your_factorio_username", "password": "", "token": "", "game_password": "optional_server_password", "require_user_verification": true, "max_upload_in_kilobytes_per_second": 0, "max_upload_slots": 5, "minimum_latency_in_ticks": 0, "max_heartbeats_per_second": 60, "ignore_player_limit_for_returning_players": false, "allow_commands": "admins-only", "autosave_interval": 10, "autosave_slots": 5, "afk_autokick_interval": 0, "auto_pause": true, "only_admins_can_pause_the_game": true } ``` -------------------------------- ### LuaEntity::get_market_items Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Retrieves the offers from a Market entity. ```APIDOC ## LuaEntity::get_market_items ### Description Returns a table of offers that the Market entity is currently providing. ### Method `get_market_items()` ### Endpoint `LuaEntity` (Market entity) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```lua local market_entity = ... -- Get a Market entity local offers = market_entity.get_market_items() for _, offer in ipairs(offers) do print("Offer: " .. offer.item .. ", Price: " .. offer.price) end ``` ### Response #### Success Response (200) - **get_market_items**: (table) A table where each element represents an offer (e.g., {item="iron-plate", price=10}). #### Response Example ```json [ { "item": "iron-plate", "price": 10 }, { "item": "copper-plate", "price": 15 } ] ``` ``` -------------------------------- ### Optional Fields for ItemStack and Entity Creation Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Optional fields 'durability' and 'ammo' for SimpleItemStack, and 'return_item_request_proxy' for LuaEntity::revive. ```APIDOC ## Optional Fields for ItemStack and Entity Creation ### Description Adds optional parameters for defining item stacks and controlling the return value of entity revival. ### Method N/A (Parameters) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **SimpleItemStack**: Optional fields `durability` and `ammo` can now be specified. - **LuaEntity::revive(position, orientation, return_item_request_proxy)**: The `return_item_request_proxy` parameter, when true, will return the created item request proxy as the third value if one is created. ``` -------------------------------- ### LuaEquipmentGrid Additions Source: https://github.com/wube/factorio-data/blob/master/changelog.txt New methods and properties added to LuaEquipmentGrid for accessing shield information and contents. ```APIDOC ## LuaEquipmentGrid Additions ### Description Provides access to shield information and the contents of an equipment grid. ### Method N/A (Properties and Methods) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **get_contents** (table) - Returns the contents of the equipment grid. - **shield** (number) - Returns the current shield value. - **max_shield** (number) - Returns the maximum shield value. ``` -------------------------------- ### GUI Elements Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Documentation for sprite-button and sprite GUI elements, including custom sprite definitions. ```APIDOC ## GUI Elements ### Description Details the functionality of sprite-button and sprite GUI elements, including custom sprite definitions and sprite referencing. ### Sprite-Button GUI Element - Works similarly to a standard button. - Can have a sprite name assigned. ### Sprite GUI Element - Can have a sprite name assigned or changed. - Has no inherent interaction logic. ### Custom Sprites - Can be defined in Lua data definitions (type = sprite, followed by sprite definition). - Sprite identifiers can point to custom definitions or use the format `/`. - `` can be `item`, `entity`, `recipe`, or `technology`. - Example: `button.sprite = "item/iron-plate"` ``` -------------------------------- ### Train Pathfinder Penalty Calculation Source: https://github.com/wube/factorio-data/blob/master/changelog.txt This bug fix addresses inaccuracies in the train pathfinder's penalty calculations. It corrects the pathfinder to not count the penalty of an opposite train stop at the last segment and to only consider the part of the starting segment in front of the locomotive, rather than the whole segment. ```lua -- Fixed that train pathfinder was not counting penalty of opposite train stop at last segment. -- Fixed that train pathfinder was counting penalty of whole starting segment instead of only part in front of locomotive. -- https://forums.factorio.com/79951 ``` -------------------------------- ### Ghost Entity Prototype API Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Provides read and write access to ghost entity prototypes, including properties like time_to_live, direction, and recipe. Supports expanded methods for circuit conditions and orientations. ```APIDOC ## GET /wube/factorio-data/ghost_prototype ### Description Reads the ghost entity prototype. ### Method GET ### Endpoint /wube/factorio-data/ghost_prototype ### Parameters None ### Request Example None ### Response #### Success Response (200) - **ghost_prototype** (object) - The ghost entity prototype data. #### Response Example ```json { "ghost_prototype": { "name": "some-ghost-entity", "type": "ghost", "time_to_live": 3600, "direction": "north", "recipe": "some-recipe" } } ``` ## PUT /wube/factorio-data/ghost_prototype ### Description Writes to the ghost entity prototype, allowing modification of properties like time_to_live, direction, and recipe. ### Method PUT ### Endpoint /wube/factorio-data/ghost_prototype ### Parameters #### Request Body - **time_to_live** (integer) - Optional - The number of ticks until the ghost dies. - **direction** (string) - Optional - The direction of the ghost (e.g., "north", "east"). - **recipe** (string) - Optional - The name of the recipe associated with the ghost. ### Request Example ```json { "time_to_live": 7200, "direction": "south" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates success. #### Response Example ```json { "message": "Ghost prototype updated successfully." } ``` ## POST /wube/factorio-data/ghost_entity/connect_neighbour ### Description Connects a neighbour to the ghost entity. ### Method POST ### Endpoint /wube/factorio-data/ghost_entity/connect_neighbour ### Parameters #### Request Body - **entity_id** (string) - Required - The ID of the ghost entity. - **neighbour_id** (string) - Required - The ID of the neighbour entity. ### Request Example ```json { "entity_id": "ghost-123", "neighbour_id": "entity-456" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates success. #### Response Example ```json { "message": "Neighbour connected successfully." } ``` ## POST /wube/factorio-data/ghost_entity/disconnect_neighbour ### Description Disconnects a neighbour from the ghost entity. ### Method POST ### Endpoint /wube/factorio-data/ghost_entity/disconnect_neighbour ### Parameters #### Request Body - **entity_id** (string) - Required - The ID of the ghost entity. - **neighbour_id** (string) - Required - The ID of the neighbour entity. ### Request Example ```json { "entity_id": "ghost-123", "neighbour_id": "entity-456" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates success. #### Response Example ```json { "message": "Neighbour disconnected successfully." } ``` ## GET /wube/factorio-data/ghost_entity/direction ### Description Gets the direction of the ghost entity. ### Method GET ### Endpoint /wube/factorio-data/ghost_entity/direction ### Parameters #### Query Parameters - **entity_id** (string) - Required - The ID of the ghost entity. ### Request Example None ### Response #### Success Response (200) - **direction** (string) - The direction of the ghost entity. #### Response Example ```json { "direction": "north" } ``` ## POST /wube/factorio-data/ghost_entity/set_direction ### Description Sets the direction of the ghost entity. ### Method POST ### Endpoint /wube/factorio-data/ghost_entity/set_direction ### Parameters #### Request Body - **entity_id** (string) - Required - The ID of the ghost entity. - **direction** (string) - Required - The new direction for the ghost entity. ### Request Example ```json { "entity_id": "ghost-123", "direction": "east" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates success. #### Response Example ```json { "message": "Ghost direction updated successfully." } ``` ## GET /wube/factorio-data/ghost_entity/get_circuit_condition ### Description Gets the circuit condition of the ghost entity. ### Method GET ### Endpoint /wube/factorio-data/ghost_entity/get_circuit_condition ### Parameters #### Query Parameters - **entity_id** (string) - Required - The ID of the ghost entity. ### Request Example None ### Response #### Success Response (200) - **circuit_condition** (object) - The circuit condition details. #### Response Example ```json { "circuit_condition": { "circuit": 1, "operator": "=", "name": "copper-plate", "count": 100 } } ``` ## POST /wube/factorio-data/ghost_entity/set_circuit_condition ### Description Sets the circuit condition for the ghost entity. ### Method POST ### Endpoint /wube/factorio-data/ghost_entity/set_circuit_condition ### Parameters #### Request Body - **entity_id** (string) - Required - The ID of the ghost entity. - **circuit** (integer) - Required - The circuit index. - **operator** (string) - Required - The comparison operator (e.g., "=", ">", "<"). - **name** (string) - Required - The name of the item. - **count** (integer) - Required - The required count. ### Request Example ```json { "entity_id": "ghost-123", "circuit": 1, "operator": ">=", "name": "iron-plate", "count": 50 } ``` ### Response #### Success Response (200) - **message** (string) - Indicates success. #### Response Example ```json { "message": "Circuit condition set successfully." } ``` ## POST /wube/factorio-data/ghost_entity/clear_circuit_condition ### Description Clears the circuit condition for the ghost entity. ### Method POST ### Endpoint /wube/factorio-data/ghost_entity/clear_circuit_condition ### Parameters #### Request Body - **entity_id** (string) - Required - The ID of the ghost entity. ### Request Example ```json { "entity_id": "ghost-123" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates success. #### Response Example ```json { "message": "Circuit condition cleared successfully." } ``` ## GET /wube/factorio-data/ghost_entity/orientation ### Description Gets the orientation of the ghost entity. ### Method GET ### Endpoint /wube/factorio-data/ghost_entity/orientation ### Parameters #### Query Parameters - **entity_id** (string) - Required - The ID of the ghost entity. ### Request Example None ### Response #### Success Response (200) - **orientation** (string) - The orientation of the ghost entity. #### Response Example ```json { "orientation": "0-1" } ``` ## POST /wube/factorio-data/ghost_entity/set_orientation ### Description Sets the orientation of the ghost entity. ### Method POST ### Endpoint /wube/factorio-data/ghost_entity/set_orientation ### Parameters #### Request Body - **entity_id** (string) - Required - The ID of the ghost entity. - **orientation** (string) - Required - The new orientation for the ghost entity. ### Request Example ```json { "entity_id": "ghost-123", "orientation": "1-0" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates success. #### Response Example ```json { "message": "Ghost orientation updated successfully." } ``` ## GET /wube/factorio-data/ghost_entity/rotateable ### Description Checks if the ghost entity is rotateable. ### Method GET ### Endpoint /wube/factorio-data/ghost_entity/rotateable ### Parameters #### Query Parameters - **entity_id** (string) - Required - The ID of the ghost entity. ### Request Example None ### Response #### Success Response (200) - **rotateable** (boolean) - True if the ghost entity is rotateable, false otherwise. #### Response Example ```json { "rotateable": true } ``` ## GET /wube/factorio-data/ghost_entity/recipe ### Description Gets the recipe associated with the ghost entity. ### Method GET ### Endpoint /wube/factorio-data/ghost_entity/recipe ### Parameters #### Query Parameters - **entity_id** (string) - Required - The ID of the ghost entity. ### Request Example None ### Response #### Success Response (200) - **recipe** (string) - The name of the recipe. #### Response Example ```json { "recipe": "some-recipe" } ``` ## POST /wube/factorio-data/ghost_entity/set_recipe ### Description Sets the recipe for the ghost entity. ### Method POST ### Endpoint /wube/factorio-data/ghost_entity/set_recipe ### Parameters #### Request Body - **entity_id** (string) - Required - The ID of the ghost entity. - **recipe_name** (string) - Required - The name of the recipe to set. ### Request Example ```json { "entity_id": "ghost-123", "recipe_name": "advanced-circuit" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates success. #### Response Example ```json { "message": "Ghost recipe updated successfully." } ``` ## GET /wube/factorio-data/ghost_entity/backer_name ### Description Gets the backer name associated with the ghost entity. ### Method GET ### Endpoint /wube/factorio-data/ghost_entity/backer_name ### Parameters #### Query Parameters - **entity_id** (string) - Required - The ID of the ghost entity. ### Request Example None ### Response #### Success Response (200) - **backer_name** (string) - The backer name. #### Response Example ```json { "backer_name": "ExampleBacker" } ``` ``` -------------------------------- ### Scripting: Get Chunks and Check Chunk Status Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Introduces new scripting methods for interacting with game chunks. `game.get_chunks()` provides an iterator for chunks, `game.is_chunk_generated(...)` checks if a chunk is generated, and `game.player.force.is_chunk_charted()` verifies if a player's force has charted a chunk. These are useful for modding and custom game logic. ```lua game.get_chunks() game.is_chunk_generated(...) game.player.force.is_chunk_charted() ``` -------------------------------- ### LuaForce Methods and Properties Source: https://github.com/wube/factorio-data/blob/master/changelog.txt This section details new and modified methods and properties for the LuaForce object, related to space exploration, surface visibility, and bonuses. ```APIDIDOC ## LuaForce Methods and Properties ### Description Details new and modified methods and properties for the LuaForce object, related to space exploration, surface visibility, and bonuses. ### Methods #### `unlock_space_location(location)` - **location** (string) - The space location to unlock. #### `lock_space_location(location)` - **location** (string) - The space location to lock. #### `is_space_location_unlocked(location)` - **location** (string) - The space location to check. - Returns: (boolean) True if the space location is unlocked. #### `create_space_platform(name, position)` - **name** (string) - The name of the space platform. - **position** (table) - The position of the space platform. #### `unlock_space_platforms()` Unlocks all space platforms. #### `lock_space_platforms()` Locks all space platforms. #### `is_space_platforms_unlocked()` - Returns: (boolean) True if all space platforms are unlocked. #### `set_surface_hidden(surface, hidden)` - **surface** (LuaSurface) - The surface to modify. - **hidden** (boolean) - Whether to hide the surface. #### `get_surface_hidden(surface)` - **surface** (LuaSurface) - The surface to check. - Returns: (boolean) True if the surface is hidden. #### `unlock_quality()` Unlocks quality for the force. #### `lock_quality()` Locks quality for the force. #### `is_quality_unlocked()` - Returns: (boolean) True if quality is unlocked. #### `copy_from(force, ...)` - **force** (LuaForce) - The force to copy from. - **...** (arguments) - Additional arguments for copying. #### `copy_chart(force)` - **force** (LuaForce) - The force to copy the chart from. ### Properties #### `platforms` (table) - Read A table of space platforms associated with the force. #### `beacon_distribution_modifier` (number) - Read/Write Modifier for beacon distribution. #### `belt_stack_size_bonus` (number) - Read/Write Bonus to belt stack size. ``` -------------------------------- ### Removed LuaEntity::get_upgrade_direction() Source: https://github.com/wube/factorio-data/blob/master/changelog.txt The `LuaEntity::get_upgrade_direction()` method has been removed. ```APIDOC ## Removed LuaEntity::get_upgrade_direction() ### Description The `LuaEntity::get_upgrade_direction()` method is no longer available. ### Method N/A (Method removal) ### Endpoint N/A ### Parameters N/A ### Request Example ```lua -- This call will now result in an error: -- local direction = entity.get_upgrade_direction() ``` ### Response N/A ``` -------------------------------- ### LuaBootstrap::on_event() Parameter Update Source: https://github.com/wube/factorio-data/blob/master/changelog.txt The `event` parameter in `LuaBootstrap::on_event()` now accepts event names (strings) for built-in events, in addition to custom events. ```APIDOC ## LuaBootstrap::on_event() Parameter Update ### Description The `event` parameter for `LuaBootstrap::on_event()` has been updated to accept event names as strings for built-in events. Previously, this was only supported for custom events. This provides a more consistent way to register event handlers. ### Method N/A (Method parameter update) ### Endpoint N/A ### Parameters #### Method Parameters - **event** (string or number) - The name or numerical ID of the event to listen for. - **callback** (function) - The function to be called when the event occurs. ### Request Example ```lua local bootstrap = require("core.bootstrap") -- Listening to a built-in event using its name bootstrap.on_event("on_entity_died", function(event) print("An entity died: " .. event.entity.name) end) -- Listening to a custom event using its name bootstrap.on_event("my-custom-event", function(event) print("Custom event received: " .. serpent.block(event)) end) -- Listening to a built-in event using its ID bootstrap.on_event(defines.events.on_player_joined_game, function(event) print("Player joined: " .. event.player.name) end) ``` ### Response N/A ``` -------------------------------- ### LuaPlayer::cursor_stack Write Support Removal Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Removed write support for LuaPlayer::cursor_stack, use LuaItemStack::set_stack instead. ```APIDOC ## LuaPlayer::cursor_stack Write Support Removal ### Description Write support for `LuaPlayer::cursor_stack` has been removed. Use `LuaItemStack::set_stack()` on the cursor stack object instead. ### Method N/A (Write Support Removed) ### Endpoint `LuaPlayer` ### Parameters N/A ### Request Example ```lua -- Old way (removed): -- player.cursor_stack = ItemStack({name="copper-plate", count=50}) -- New way: local cursor_item = player.cursor_stack cursor_item.set_stack(ItemStack({name="copper-plate", count=50})) ``` ### Response N/A ``` -------------------------------- ### Add LuaEquipmentPrototype::equipment_categories read Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Enables reading equipment categories from LuaEquipmentPrototype. This change is related to the new equipment grid system that uses categories to define compatibility. ```lua Added LuaEquipmentPrototype::equipment_categories read. ``` -------------------------------- ### Text Box Shortcut and Keyboard Layout Handling Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Fixes issues where text boxes would not respect keyboard layouts for shortcuts like copy or paste, and where game shortcuts were blocked incorrectly when a text box had focus. This ensures consistent input behavior across different keyboard layouts. ```lua -- Fixed text boxes would not respect keyboard layout for shortcuts like copy or paste. -- Fixed blocking of game shortcuts when a text box has focus did not take into account keyboard layout settings. ``` -------------------------------- ### Scripting: LuaRendering::bring_to_front() Source: https://github.com/wube/factorio-data/blob/master/changelog.txt The `LuaRendering::bring_to_front()` function has been added. This function allows scripts to explicitly bring rendering elements to the front layer. ```lua -- Added LuaRendering::bring_to_front(). ``` -------------------------------- ### LuaItemStack Write Operations Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Provides write support for setting, and clearing specific item stacks. ```APIDOC ## LuaItemStack Write Operations ### Description Adds write support for `set_stack()`, `can_set_stack()`, and `clear()` methods to modify a specific item stack. ### Method `can_set_stack(item_stack)` `set_stack(item_stack)` `clear()` ### Endpoint `LuaItemStack` ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```lua local inventory_slot = ... -- Get an inventory slot as a LuaItemStack local new_item = ItemStack({name="steel-plate", count=20}) if inventory_slot.can_set_stack(new_item) then inventory_slot.set_stack(new_item) else print("Cannot set stack.") end -- To clear the slot: inventory_slot.clear() ``` ### Response #### Success Response (200) - **can_set_stack**: (boolean) Returns true if the stack can be set. - **set_stack**: Sets the item stack. - **clear**: Clears the item stack. #### Response Example N/A ``` -------------------------------- ### GUI API Source: https://github.com/wube/factorio-data/blob/master/changelog.txt This section details functionalities for interacting with and manipulating GUI elements, including buttons, sliders, and general GUI properties. ```APIDOC ## GUI API ### Description Provides methods for creating, modifying, and interacting with various GUI elements in Factorio. ### Methods & Properties - **style::width/height**: Set maximal/minimal value at the same time. - **style::align**: Set the align of inner elements. - **style::stretchable / squashable**: Properties for controlling element stretching and squashing. - **LuaGuiElement::hovered_sprite**: Read/write access to the hovered sprite for SpriteButton. - **LuaGuiElement::clicked_sprite**: Read/write access to the clicked sprite for SpriteButton. - **choose-elem-button**: Supports "fluid", and "recipe" types. - **LuaGuiElement::locked**: Read/write - when true, the choose-elem-button can only be changed through script. - **LuaGuiElement type "slider"**: New GUI element type for sliders. - **LuaGuiElement::focus()**: Focuses the GUI element. ``` -------------------------------- ### GUI Clicked Event - Mouse Info Source: https://github.com/wube/factorio-data/blob/master/changelog.txt The GUI clicked event now includes mouse information. ```APIDOC ## GUI Clicked Event - Mouse Info ### Description The event triggered when a GUI element is clicked now provides additional information about the mouse cursor's position and state. ### Method N/A (Event) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **mouse info** - Details about the mouse at the time of the click event. ``` -------------------------------- ### LuaPlayer::enable_flashlight Source: https://github.com/wube/factorio-data/blob/master/changelog.txt Enables the player's flashlight. ```APIDOC ## LuaPlayer::enable_flashlight ### Description Enables the player's flashlight, serving as the counterpart to `disable_flashlight()`. ### Method `enable_flashlight()` ### Endpoint `LuaPlayer` ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```lua local player = game.get_player(1) player.enable_flashlight() ``` ### Response #### Success Response (200) N/A (Procedural function) #### Response Example N/A ``` -------------------------------- ### LuaEntity Wire Connector Methods Source: https://github.com/wube/factorio-data/blob/master/changelog.txt New methods `get_wire_connector` and `get_wire_connectors` added to `LuaEntity` for accessing wire connection information. ```APIDOC ## LuaEntity Wire Connector Methods ### Description Two new methods, `get_wire_connector` and `get_wire_connectors`, have been added to the `LuaEntity` object. These methods allow retrieval of specific or all wire connection details associated with an entity. ### Method N/A (Method addition) ### Endpoint N/A ### Parameters #### Method Parameters - **get_wire_connector(wire_connector_id)** - **wire_connector_id** (defines.wire_connector_id or number) - The ID of the specific wire connector to retrieve. - **get_wire_connectors()** - No parameters. ### Request Example ```lua local entity = ... -- Get an entity with wire connections -- Get a specific wire connector (e.g., the first one) local first_connector = entity.get_wire_connector(defines.wire_connector_id.copper) if first_connector then print("Found a wire connector.") end -- Get all wire connectors local all_connectors = entity.get_wire_connectors() print("Number of wire connectors: " .. #all_connectors) ``` ### Response #### Success Response - **get_wire_connector**: Returns a `LuaWireConnector` object or nil if not found. - **get_wire_connectors**: Returns an array of `LuaWireConnector` objects. ``` -------------------------------- ### LuaEntity Methods and Properties Source: https://github.com/wube/factorio-data/blob/master/changelog.txt This section covers new and modified methods and properties for the LuaEntity object, including ordering, filtering, status, and color management. ```APIDOC ## LuaEntity Methods and Properties ### Description Covers new and modified methods and properties for the LuaEntity object, including ordering, filtering, status, and color management. ### Methods #### `order_upgrade(item_index, ...)` - **item_index** (number) - Optional - Index for the undo queue. - **...** (arguments) - Arguments for ordering upgrade. #### `order_deconstruction(item_index, ...)` - **item_index** (number) - Optional - Index for the undo queue. - **...** (arguments) - Arguments for ordering deconstruction. #### `set_recipe(quality, ...)` - **quality** (number) - The quality parameter for the recipe. - **...** (arguments) - Other arguments for setting the recipe. #### `get_priority_target()` - Returns: (LuaEntity) The entity's priority target. #### `set_priority_target(target)` - **target** (LuaEntity) - The entity to set as priority target. ### Properties #### `custom_status` (string) - Read/Write Custom status of the entity. #### `use_filters` (boolean) - Read/Write Indicates if the entity uses filters. #### `name_tag` (string) - Read/Write Name tag of the entity. #### `ignore_unprioritised_targets` (boolean) - Read/Write Indicates if the entity ignores unprioritised targets. #### `electric_output_flow_limit` (number) - Read Deprecated. Use `get_electric_output_flow_limit()` instead. #### `electric_input_flow_limit` (number) - Read Deprecated. Use `get_electric_input_flow_limit()` instead. #### `combinator_description` (string) - Read/Write Description for combinator entities. #### `mining_drill_filter_mode` (string) - Read/Write Filter mode for mining drills. #### `tick_grown` (number) - Read/Write Ticks since the entity has grown. #### `quality` (number) - Read The quality of the entity. #### `always_on` (boolean) - Read/Write Indicates if the entity is always on. #### `copy_color_from_train_stop` (boolean) - Read/Write Indicates if the entity should copy color from a train stop. #### `train_stop_priority` (number) - Read/Write Priority of the train stop. #### `rail_layer` (string) - Read The rail layer of the entity. #### `mirroring` (string) - Read/Write Mirroring state of the entity. #### `crane_grappler_destination_3d` (table) - Write 3D destination for crane grappler. #### `crane_destination` (table) - Read/Write Destination for crane. #### `crane_destination_3d` (table) - Read/Write 3D destination for crane. #### `artillery_auto_targeting` (boolean) - Read/Write Indicates if artillery has auto-targeting enabled. #### `robot_order_queue` (table) - Read The robot order queue. #### `max_health` (number) - Read The maximum health of the entity. ``` -------------------------------- ### Scripting: LuaPlayer Infinity Inventory Filters Source: https://github.com/wube/factorio-data/blob/master/changelog.txt New functions `LuaPlayer::get_infinity_inventory_filter()` and `set_infinity_inventory_filter()` have been added. Additionally, `LuaPlayer::remove_unfiltered_items` and `infinity_inventory_filters` (read/write) are now available for managing infinity inventory filters. ```lua -- Added LuaPlayer::get_infinity_inventory_filter(), set_infinity_inventory_filter() functions. -- Added LuaPlayer::remove_unfiltered_items, infinity_inventory_filters read/write. ``` -------------------------------- ### LuaGuiElement Methods Source: https://github.com/wube/factorio-data/blob/master/changelog.txt New methods added to LuaGuiElement for scrolling functionality. ```APIDOC ## LuaGuiElement Methods ### Description Provides new methods for controlling the scroll position of GUI elements. ### Method - `scroll_to_top()` - `scroll_to_bottom()` - `scroll_to_left()` - `scroll_to_right()` - `scroll_to_element(element)` ### Endpoint N/A (These are Lua methods) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```lua -- Example for scroll_to_top() gui_element.scroll_to_top() -- Example for scroll_to_element() local target_element = ... gui_element.scroll_to_element(target_element) ``` ### Response #### Success Response (200) N/A (These are Lua methods, no direct HTTP response) #### Response Example None ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.