In other languages:

Blueprint string format: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(added item request object)
No edit summary
Line 141: Line 141:
|-
|-
| parameters
| parameters
| Used by [[Prototype/ProgrammableSpeaker]], optional. [[#Speaker parameter object]].
| Used by [[Programmable speaker]], optional. [[#Speaker parameter object]].
|-
|-
| alert_parameters
| alert_parameters
| Used by [[Prototype/ProgrammableSpeaker]], optional. [[#Speaker alert parameter object]]
| Used by [[Programmable speaker]], optional. [[#Speaker alert parameter object]]
|-
|-
| auto_launch
| auto_launch

Revision as of 17:20, 30 April 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 0.16) 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 inside another "wrapping" object, its key inside that object is 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 0-based value and a "blueprint" key with a #Blueprint object as the value.
active_index Index of the currently selected blueprint, 0-based.
version The map version of the map the blueprint was created in.

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.

Icon object

Key Description
index Index of the icon, 1-based.
signal The icon that is displayed, #SignalID object.

SignalID 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 Item requests by this entity, this is what defines the item-request-proxy when the blueprint is placed, optional. #Item request object
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 Programmable speaker, optional. #Speaker parameter object.
alert_parameters Used by Programmable speaker, 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 request object

1 or more instances of key/value pairs. Key is the name of the item, string. Value is the amount of items to be requested, Types/ItemCountType.

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 object

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, #SignalID object.
alert_message String, message of the alert.

Color object

Key Description
r red
g green
b blue
a transparency