A reference to a record in the blueprint library. Records in the "my blueprints" shelf are read-only, but records in the "game blueprints" shelf are read/write.
booleanunknownfalseIs this record valid for writing? A record is invalid for write if it is a BlueprintRecord preview or if it is in the "My blueprints" shelf.
"blueprint" | "blueprint-book" | "deconstruction-planner" | "upgrade-planner"unknownfalseThe type of this blueprint record.
Array<BlueprintSignalIcon>Array<BlueprintSignalIcon>falseThe preview icons for this record.
booleanunknownfalseChecks if this record is in a preview state.
booleanunknownfalseIs this blueprint record a preview? A preview record must be synced by the player before entity and tile data can be read. This property is deprecated in favor of LuaRecord::is_preview and should not be used.
TilePositionTilePositiontrueThe snapping grid size in this blueprint. nil if snapping is not enabled.
TilePositionTilePositiontrueThe offset from the absolute grid. nil if absolute snapping is not enabled.
booleanbooleanfalseIf absolute snapping is enabled on this blueprint.
stringstringfalseThe description for this blueprint or blueprint book.
ItemWithQualityCountsunknownfalseList of raw materials required to build this blueprint.
Array<BlueprintSignalIcon>unknownfalseThe default icons for a blueprint blueprint.
Dict<ItemStackIndex, LuaRecord>unknownfalseThe contents of this BlueprintBookRecord. This is sparse array - it may have gaps, so using # will not be reliable. Use LuaRecord::contents_size or pairs() to iterate this table.
ItemStackIndexunknownfalseThe highest populated index in the contents of this BlueprintBookRecord.
Array<ItemFilter>Array<ItemFilter>falseThe entity filters for this deconstruction planner. The attribute is a sparse array with the keys representing the index of the filter. All prototypes in this array must not have the "not-deconstructable" flag set and are either a cliff or marked as minable.
Array<TileID>Array<TileID>falseThe tile filters for this deconstruction planner. The attribute is a sparse array with the keys representing the index of the filter. Reading filters always returns an array of strings which are the tile prototype names.
defines.deconstruction_item.entity_filter_modedefines.deconstruction_item.entity_filter_modefalseThe blacklist/whitelist entity filter mode for this deconstruction planner.
defines.deconstruction_item.tile_filter_modedefines.deconstruction_item.tile_filter_modefalseThe blacklist/whitelist tile filter mode for this deconstruction planner.
defines.deconstruction_item.tile_selection_modedefines.deconstruction_item.tile_selection_modefalseThe tile selection mode for this deconstruction planner.
booleanbooleanfalseIf this deconstruction planner, is set to allow trees and rocks only.
uint32unknownfalseThe number of entity filters this deconstruction planner supports.
uint32unknownfalseThe number of tile filters this deconstruction planner supports.
uint32unknownfalseThe current count of mappers in the upgrade item.
booleanunknownfalseIs this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
stringunknownfalseThe class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
LuaRecord.export_record() -> string
record.export_record()
takes_table: falsetable_optional: falseExports this record to a string.
stringLuaRecord.clear_blueprint()
record.clear_blueprint()
takes_table: falsetable_optional: falseClears this blueprint.
LuaRecord.is_blueprint_setup() -> boolean
record.is_blueprint_setup()
takes_table: falsetable_optional: falseIs this blueprint setup? I.e. is it a non-empty blueprint?
booleanLuaRecord.build_blueprint{ surface: SurfaceIdentification, force: ForceID, position: MapPosition, direction?: defines.direction, build_mode?: defines.build_mode, skip_fog_of_war?: boolean, by_player?: PlayerIdentification, raise_built?: boolean } -> Array<LuaEntity>
record.build_blueprint{ surface=surface, force=force, position=position }
takes_table: truetable_optional: falseBuild this blueprint at the given location.
Built entities can be come invalid between the building of the blueprint and the function returning if by_player or raise_built is used and one of those events invalidates the entity.
surface: SurfaceIdentification — Surface to build onforce: ForceID — Force to use for the buildingposition: MapPosition — The position to build atdirection?: defines.direction — The direction to use when buildingbuild_mode?: defines.build_mode — If normal, blueprint will not be built if any one thing can't be built. If forced, anything that can be built is built and obstructing nature entities will be deconstructed. If superforced, all obstructions will be deconstructed and the blueprint will be built.skip_fog_of_war?: boolean — If chunks covered by fog-of-war are skipped.by_player?: PlayerIdentification — The player to use if any. If provided defines.events.on_built_entity will also be fired on successful entity creation.raise_built?: boolean — If true; defines.events.script_raised_built will be fired on successful entity creation. Note: this is ignored if by_player is provided.Array<LuaEntity> — Array of created ghostsLuaRecord.create_blueprint{ surface: SurfaceIdentification, force: ForceID, area: BoundingBox, always_include_tiles?: boolean, include_entities?: boolean, include_modules?: boolean, include_station_names?: boolean, include_trains?: boolean, include_fuel?: boolean } -> Dict<uint32, LuaEntity>
record.create_blueprint{ surface=surface, force=force, area=area }
takes_table: truetable_optional: falseSets up this blueprint using the found blueprintable entities/tiles on the surface.
surface: SurfaceIdentification — Surface to create fromforce: ForceID — Force to use for the creationarea: BoundingBox — The bounding boxalways_include_tiles?: boolean — When true, blueprintable tiles are always included in the blueprint. When false they're only included if no entities exist in the setup area. Defaults to false.include_entities?: boolean — When true, entities are included in the blueprint. Defaults to true.include_modules?: boolean — When true, modules are included in the blueprint. Defaults to true.include_station_names?: boolean — When true, station names are included in the blueprint. Defaults to false.include_trains?: boolean — When true, trains are included in the blueprint. Defaults to false.include_fuel?: boolean — When true, train fuel is included in the blueprint, Defaults to true.Dict<uint32, LuaEntity> — The blueprint entity index to source entity mapping.LuaRecord.get_blueprint_entity_tags(index: uint32) -> Tags
record.get_blueprint_entity_tags(index)
takes_table: falsetable_optional: falseGets the tags for the given blueprint entity index in this blueprint.
index: uint32TagsLuaRecord.set_blueprint_entity_tags(index: uint32, tags: Tags)
record.set_blueprint_entity_tags(index, tags)
takes_table: falsetable_optional: falseSets the tags on the given blueprint entity index in this blueprint.
index: uint32 — The entity indextags: TagsLuaRecord.get_blueprint_entity_tag(index: uint32, tag: string) -> AnyBasic?
record.get_blueprint_entity_tag(index, tag)
takes_table: falsetable_optional: falseGets the given tag on the given blueprint entity index in this blueprint.
index: uint32 — The entity index.tag: string — The tag to get.AnyBasic?LuaRecord.set_blueprint_entity_tag(index: uint32, tag: string, value: AnyBasic)
record.set_blueprint_entity_tag(index, tag, value)
takes_table: falsetable_optional: falseSets the given tag on the given blueprint entity index in this blueprint.
index: uint32 — The entity index.tag: string — The tag to set.value: AnyBasic — The tag value to set or nil to clear the tag.LuaRecord.get_blueprint_entities() -> Array<BlueprintEntity>?
record.get_blueprint_entities()
takes_table: falsetable_optional: falseThe entities in this blueprint.
Array<BlueprintEntity>?LuaRecord.set_blueprint_entities(entities: Array<BlueprintEntity>)
record.set_blueprint_entities(entities)
takes_table: falsetable_optional: falseSet new entities to be a part of this blueprint.
entities: Array<BlueprintEntity> — The new blueprint entities.LuaRecord.get_blueprint_tiles() -> Array<Tile>?
record.get_blueprint_tiles()
takes_table: falsetable_optional: falseA list of the tiles in this blueprint.
Array<Tile>?LuaRecord.set_blueprint_tiles(tiles: Array<Tile>)
record.set_blueprint_tiles(tiles)
takes_table: falsetable_optional: falseSet specific tiles in this blueprint.
tiles: Array<Tile> — Tiles to be a part of the blueprint.LuaRecord.get_blueprint_entity_count() -> uint32
record.get_blueprint_entity_count()
takes_table: falsetable_optional: falseGets the number of entities in this blueprint blueprint.
uint32LuaRecord.get_active_index(player: PlayerIdentification) -> uint32
record.get_active_index(player)
takes_table: falsetable_optional: falseThe active index of this BlueprintBookRecord. For records in "my blueprints", the result will be the same regardless of the player, but records in "game blueprints" may have different active indices per player.
player: PlayerIdentificationuint32LuaRecord.get_selected_record(player: PlayerIdentification) -> LuaRecord?
record.get_selected_record(player)
takes_table: falsetable_optional: falseGets the currently selected record of the book for the given player.
Note: this will return a record even if the book is in a preview state.
player: PlayerIdentificationLuaRecord?LuaRecord.get_entity_filter(index: uint32) -> ItemFilter?
record.get_entity_filter(index)
takes_table: falsetable_optional: falseGets the entity filter at the given index for this deconstruction planner.
index: uint32ItemFilter?LuaRecord.set_entity_filter(index: uint32, filter: ItemFilter | nil) -> boolean
record.set_entity_filter(index, filter)
takes_table: falsetable_optional: falseSets the entity filter at the given index for this deconstruction planner.
index: uint32filter: ItemFilter | nil — Writing nil removes the filter.boolean — Whether the new filter was successfully set (ie. was valid).LuaRecord.get_tile_filter(index: uint32) -> string?
record.get_tile_filter(index)
takes_table: falsetable_optional: falseGets the tile filter at the given index for this deconstruction planner.
index: uint32string?LuaRecord.set_tile_filter(index: uint32, filter: string | LuaTilePrototype | LuaTile) -> boolean
record.set_tile_filter(index, filter)
takes_table: falsetable_optional: falseSets the tile filter at the given index for this deconstruction planner.
index: uint32filter: string | LuaTilePrototype | LuaTile — Setting to nil erases the filter.boolean — Whether the new filter was successfully set (ie. was valid).LuaRecord.deconstruct_area{ surface: SurfaceIdentification, force: ForceID, area: BoundingBox, skip_fog_of_war?: boolean, by_player?: PlayerIdentification, super_forced?: boolean }
record.deconstruct_area{ surface=surface, force=force, area=area }
takes_table: truetable_optional: falseDeconstruct the given area with this deconstruction planner.
surface: SurfaceIdentification — Surface to deconstruct onforce: ForceID — Force to use for the deconstructionarea: BoundingBox — The area to deconstructskip_fog_of_war?: boolean — If chunks covered by fog-of-war are skipped. Defaults to false.by_player?: PlayerIdentification — The player to use if any.super_forced?: boolean — If the deconstruction is super-forced. Defaults to false.LuaRecord.cancel_deconstruct_area{ surface: SurfaceIdentification, force: ForceID, area: BoundingBox, skip_fog_of_war?: boolean, by_player?: PlayerIdentification, super_forced?: boolean }
record.cancel_deconstruct_area{ surface=surface, force=force, area=area }
takes_table: truetable_optional: falseCancel deconstruct the given area with this deconstruction planner.
surface: SurfaceIdentification — Surface to cancel deconstruct onforce: ForceID — Force to use for canceling deconstructionarea: BoundingBox — The area to deconstructskip_fog_of_war?: boolean — If chunks covered by fog-of-war are skipped. Defaults to false.by_player?: PlayerIdentification — The player to use if any.super_forced?: boolean — If the cancel deconstruction is super-forced. Defaults to false.LuaRecord.clear_deconstruction_data()
record.clear_deconstruction_data()
takes_table: falsetable_optional: falseClears all settings/filters on this deconstruction planner, resetting it to default values.
LuaRecord.clear_upgrade_data()
record.clear_upgrade_data()
takes_table: falsetable_optional: falseClears all settings/filters on this upgrade planner, resetting it to default values.
LuaRecord.get_mapper(index: uint32, type: "from" | "to") -> UpgradeMapperSource | UpgradeMapperDestination
record.get_mapper(index, type)
takes_table: falsetable_optional: falseGets the filter at the given index for this upgrade item. Note that sources ("from" type) that are undefined will read as {type = "item"}, while destinations ("to" type) that are undefined will read as nil.
In contrast to LuaRecord::set_mapper, indices past the upgrade item's current size are considered to be out of bounds.
index: uint32 — The index of the mapper to read.type: "from" | "to"UpgradeMapperSource | UpgradeMapperDestinationLuaRecord.set_mapper(index: uint32, type: "from" | "to", mapper: UpgradeMapperSource | UpgradeMapperDestination | nil)
record.set_mapper(index, type, mapper)
takes_table: falsetable_optional: falseSets the module filter at the given index for this upgrade item.
In contrast to LuaRecord::get_mapper, indices past the upgrade item's current size are valid and expand the list of mappings accordingly, if within reasonable bounds.
index: uint32 — The index of the mapper to set.type: "from" | "to"mapper: UpgradeMapperSource | UpgradeMapperDestination | nil — The mapper to set. Set nil to clear the mapper.