In other languages:

Blueprint string format: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(More info, still WIP)
Line 41: Line 41:
| entities
| entities
| The actual content of the blueprint, array of [[#Entity object]]s
| The actual content of the blueprint, array of [[#Entity object]]s
|-
| tiles
| The tiles included in the blueprint, array of [[#Tile object]]s
|-
|-
| icons
| icons
Line 58: Line 61:
|-
|-
| signal
| signal
| Object with a type key/value ("item" or "virtual") pair and a name key/value pair.
| The icon that is displayed, [[#Signal object]].
|}
 
=== Signal object ===
{| class="wikitable"
! Key !! Description
|-
| name
| Name of the signal prototype this signal is set to.
|-
| type
| Type of the signal. Either "item", "fluid" or "virtual".
|}
|}


Line 67: Line 81:
|-
|-
| entity_number
| entity_number
| Index of the entity (starts with 1)
| Index of the entity, 1-based.
|-
|-
| name
| name
| Prototype name of the entity (e.g. "offshore-pump")
| Prototype name of the entity (e.g. "offshore-pump").
|-
|-
| position
| position
| Position of the entity within the blueprint. Object with a x key/value pair and a y key/value pair
| [[#Position object]], position of the entity within the blueprint.
|-
|-
| direction
| direction
| Direction of the entity, uint (optional)
| Direction of the entity, uint (optional).
|-
|-
| connections
| connections
| Circuit connection, object with keys starting from 1, values are [[#Connection object]]s (optional)
| Circuit connection, object with keys starting from 1, values are [[#Connection object]]s (optional).
|-
|-
| control_behaviour
| control_behaviour
Line 88: Line 102:
|-
|-
| recipe
| recipe
| Name of the recipe prototype this assembling machine is set to, optional, string.
|-
| bar
| Used by [[Prototype/Container]], optional. The index of the first inaccessible item slot due to limiting with the red "bar". 0-based [[Types/ItemStackIndex]].
|-
| infinity_settings
| Used by [[Prototype/InfinityContainer]], optional. [[#Infinity settings object]]
|-
| type
| Type of the underground belt or loader, optional. Either "input" or "output".
|-
| input_priority
| Input priority of the splitter, optional. Either "right" or "left", "none" is omitted.
|-
| output_priority
| Output priority of the splitter, optional. Either "right" or "left", "none" is omitted.
|-
| filter
| Filter of the splitter, optional. Name of the item prototype the filter is set to, string.
|-
| filters
| Filters of the filter inserter or loader, optional. Array of [[#Item filter object]]s.
|-
| override_stack_size
| The stack size the inserter is set to, optional. [[Types/uint8]].
|-
| drop_position
| The drop position the inserter is set to, optional. [[#Position object]].
|-
| pickup_position
| The pickup position the inserter is set to, optional. [[#Position object]].
|-
| request_filters
| Used by [[Prototype/LogisticContainer]], optional. [[#Logistic filter object]].
|-
| request_from_buffers
| Boolean. Whether this requester chest can request from buffer chests.
|-
| parameters
| Used by [[Prototype/ProgrammableSpeaker]], optional. [[#Speaker parameter object]].
|-
| alert_parameters
| Used by [[Prototype/ProgrammableSpeaker]], optional. [[#Speaker alert parameter object]]
|-
| auto_launch
| Used by the rocket silo, optional. Boolean, whether auto launch is enabled.
|-
| variation
| Used by [[Prototype/SimpleEntityWithForce]] or [[Prototype/SimpleEntityWithOwner]], optional. [[Types/GraphicsVariation]]
|-
| color
| Color of the [[Prototype/SimpleEntityWithForce]], [[Prototype/SimpleEntityWithOwner]], or train station, optional. [[#Color object]].
|-
| station
| The name of the train station, optional.
|}
=== Tile object ===
{| class="wikitable"
! Key !! Description
|-
| name
| Prototype name of the tile (e.g. "concrete")
|-
| position
| [[#Position object]], position of the entity within the blueprint.
|}
=== Position object ===
{| class="wikitable"
! Key !! Description
|-
| x
| X position within the blueprint, 0 is the center.
|-
| y
| Y position within the blueprint, 0 is the center.
|}
=== Connection object ===
=== Item filter object ===
{| class="wikitable"
! Key !! Description
|-
| name
| Name of the item prototype this filter is set to.
|-
| index
| Index of the filter, 1-based.
|}
=== Infinity settings object ===
{| class="wikitable"
! Key !! Description
|-
| remove_unfiltered_items
| Boolean. Whether the "remove unfiltered items" checkbox is checked.
|-
| filters
| Filters of the infinity container, optional. Array of [[#Infinity filter object]]s.
|}
=== Infinity filter objectt ===
{| class="wikitable"
! Key !! Description
|-
| name
| Name of the item prototype the filter is set to, string.
|-
| count
| Number the filter is set to, [[Types/ItemCountType]].
|-
| mode
| Mode of the filter. Either "at-least", "at-most", or "exactly".
|-
| index
| Index of the filter, 1-based.
|}
=== Logistic filter object ===
{| class="wikitable"
! Key !! Description
|-
| name
| Name of the item prototype this filter is set to.
|-
| index
| Index of the filter, 1-based.
|-
| count
| Number the filter is set to, [[Types/ItemCountType]]. Is 0 for storage chests.
|}
=== Speaker parameter object ===
{| class="wikitable"
! Key !! Description
|-
| playback_volume
| [[Types/double]]. Volume of the speaker.
|-
| playback_globally
| Boolean, whether global playback is enabled.
|-
| allow_polyphony
| Boolean, whether polyphony is allowed.
|}
=== Speaker alert parameter object ===
{| class="wikitable"
! Key !! Description
|-
| show_alert
| Boolean, whether an alert is shown.
|-
| show_on_map
| Boolean, whether an alert icon is shown on the map.
|-
| icon_signal_id
| The icon that is displayed with the alert, [[#Signal object]].
|-
| alert_message
| String, message of the alert.
|}
=== Color object ===
{| class="wikitable"
! Key !! Description
|-
| r
|
|-
| g
|
|-
| b
|
|-
| a
|
|
|}
|}

Revision as of 18:46, 27 March 2018

This is a technical description of the blueprint string format, used to share blueprints with other users.

A blueprint string is a json representation of the blueprint, encoded using base 64 with the version byte in front (0 in vanilla 0.15) and then compressed with zlib deflate. So to get the json representation of a blueprint from a blueprint string, skip the first byte, base64 decode the string, and finally decompress using zlib deflate.

Json representation of a blueprint/blueprint book

The json representation of a blueprint or blueprint book is one large object, named either blueprint or blueprint-book.

Blueprint book object

Key Description
item String, the name of the item that was saved ("blueprint-book" in vanilla)
label String, the name of the blueprint set by the user
blueprints The actual content of the blueprint book, array of objects containing an "index" key and value (starts with 0) and a "blueprint" key with a #Blueprint object as the value
active_index Index of the currently selected blueprint (starts with 0)
version The map version of the map the blueprint was created in (but converted to an uint, not sure how)

Blueprint object

Key Description
item String, the name of the item that was saved ("blueprint" in vanilla)
label String, the name of the blueprint set by the user
entities The actual content of the blueprint, array of #Entity objects
tiles The tiles included in the blueprint, array of #Tile objects
icons The icons of the blueprint set by the user, array of #Icon objects
version The map version of the map the blueprint was created in (but converted to an uint, not sure how)

Icon object

Key Description
index Index of the icon (starts with 1)
signal The icon that is displayed, #Signal object.

Signal object

Key Description
name Name of the signal prototype this signal is set to.
type Type of the signal. Either "item", "fluid" or "virtual".

Entity object

Key Description
entity_number Index of the entity, 1-based.
name Prototype name of the entity (e.g. "offshore-pump").
position #Position object, position of the entity within the blueprint.
direction Direction of the entity, uint (optional).
connections Circuit connection, object with keys starting from 1, values are #Connection objects (optional).
control_behaviour
items
recipe Name of the recipe prototype this assembling machine is set to, optional, string.
bar Used by Prototype/Container, optional. The index of the first inaccessible item slot due to limiting with the red "bar". 0-based Types/ItemStackIndex.
infinity_settings Used by Prototype/InfinityContainer, optional. #Infinity settings object
type Type of the underground belt or loader, optional. Either "input" or "output".
input_priority Input priority of the splitter, optional. Either "right" or "left", "none" is omitted.
output_priority Output priority of the splitter, optional. Either "right" or "left", "none" is omitted.
filter Filter of the splitter, optional. Name of the item prototype the filter is set to, string.
filters Filters of the filter inserter or loader, optional. Array of #Item filter objects.
override_stack_size The stack size the inserter is set to, optional. Types/uint8.
drop_position The drop position the inserter is set to, optional. #Position object.
pickup_position The pickup position the inserter is set to, optional. #Position object.
request_filters Used by Prototype/LogisticContainer, optional. #Logistic filter object.
request_from_buffers Boolean. Whether this requester chest can request from buffer chests.
parameters Used by Prototype/ProgrammableSpeaker, optional. #Speaker parameter object.
alert_parameters Used by Prototype/ProgrammableSpeaker, optional. #Speaker alert parameter object
auto_launch Used by the rocket silo, optional. Boolean, whether auto launch is enabled.
variation Used by Prototype/SimpleEntityWithForce or Prototype/SimpleEntityWithOwner, optional. Types/GraphicsVariation
color Color of the Prototype/SimpleEntityWithForce, Prototype/SimpleEntityWithOwner, or train station, optional. #Color object.
station The name of the train station, optional.

Tile object

Key Description
name Prototype name of the tile (e.g. "concrete")
position #Position object, position of the entity within the blueprint.

Position object

Key Description
x X position within the blueprint, 0 is the center.
y Y position within the blueprint, 0 is the center.

Connection object

Item filter object

Key Description
name Name of the item prototype this filter is set to.
index Index of the filter, 1-based.

Infinity settings object

Key Description
remove_unfiltered_items Boolean. Whether the "remove unfiltered items" checkbox is checked.
filters Filters of the infinity container, optional. Array of #Infinity filter objects.

Infinity filter objectt

Key Description
name Name of the item prototype the filter is set to, string.
count Number the filter is set to, Types/ItemCountType.
mode Mode of the filter. Either "at-least", "at-most", or "exactly".
index Index of the filter, 1-based.

Logistic filter object

Key Description
name Name of the item prototype this filter is set to.
index Index of the filter, 1-based.
count Number the filter is set to, Types/ItemCountType. Is 0 for storage chests.

Speaker parameter object

Key Description
playback_volume Types/double. Volume of the speaker.
playback_globally Boolean, whether global playback is enabled.
allow_polyphony Boolean, whether polyphony is allowed.

Speaker alert parameter object

Key Description
show_alert Boolean, whether an alert is shown.
show_on_map Boolean, whether an alert icon is shown on the map.
icon_signal_id The icon that is displayed with the alert, #Signal object.
alert_message String, message of the alert.

Color object

Key Description
r
g
b
a