Talk:Blueprint string format: Difference between revisions
(→v2.x introduced new "wires" array of uncertain structure: new section) |
Joelverhagen (talk | contribs) No edit summary |
||
Line 26: | Line 26: | ||
} | } | ||
} | } | ||
== v2.X SignalID has optional "type" now == | |||
Blueprint: | |||
<code>0eNqVkd1uhCAQhd9lrnGzWm2ir9JsDOLEnRQGC2hrDO9e0Dbbqza9Y5hzvvnbYdALzo44QLcDKcseupcdPE0sdf5jaRA6kN6jGTTxVBip7sRYVBAFEI/4AV0ZbwKQAwXCk3AEW8+LGdAlgfiVJGC2Ppkt55oZeL00Ajboni5NKuNQ0Zzd5CwXE0pXvN8RNXyn+rdF6lQwSdg6I3OGApqzGRp/jDI7Oy4q0JrkhUlvjcckpzqJuSdeU//Wbaf7EdUCfJDq9Zg4RvE3+mtN/4NfM/yWd5qNCfw4k4AVnT8W1TxXbd22TV3WVVWWMX4CClCeDw== | |||
</code> | |||
Beginning of JSON: | |||
{ | |||
"blueprint": { | |||
"icons": [ | |||
{ | |||
"signal": { | |||
"name": "assembling-machine-2" | |||
}, | |||
"index": 1 | |||
} | |||
], | |||
Notice there is no <code>"type": "item"</code> property. |
Revision as of 14:51, 26 October 2024
Decode snippets
Since there are some short snippets to decode blueprint strings to JSON / Lua tables I think it would make sense to also have snippets for the inverse operation. -- fgardt (talk) 03:35, 3 August 2024 (CEST)
v2.x introduced new "wires" array of uncertain structure
I am observing a new "wires" blueprint root entry - this is an example of two electric poles connected by copper, red, and green wires. The format of the "wires" seem to be a list of connections, with each sub-array always having 4 numbers:
- source entity_number
- color of the wire at the source
- destination entity_number
- color of the wire at the destination
I guess the developers were trying to allow color-changing in the wire, e.g. starts as green, but ends as red? For now, I only saw same color on both sides (2nd and 4th value is always the same). The color indexes are: 5 - copper, 1 - red, 2 - green.
{ "blueprint": { "icons": [{"signal": {"name": "big-electric-pole"}, "index": 1}], "entities": [ {"entity_number": 1, "name": "big-electric-pole", "position": {"x": 163, "y": -240}}, {"entity_number": 2, "name": "big-electric-pole", "position": {"x": 195, "y": -240}} ], "wires": [[1, 1, 2, 1], [1, 2, 2, 2], [1, 5, 2, 5]], "item": "blueprint", "version": 562949954076673 } }
v2.X SignalID has optional "type" now
Blueprint:
0eNqVkd1uhCAQhd9lrnGzWm2ir9JsDOLEnRQGC2hrDO9e0Dbbqza9Y5hzvvnbYdALzo44QLcDKcseupcdPE0sdf5jaRA6kN6jGTTxVBip7sRYVBAFEI/4AV0ZbwKQAwXCk3AEW8+LGdAlgfiVJGC2Ppkt55oZeL00Ajboni5NKuNQ0Zzd5CwXE0pXvN8RNXyn+rdF6lQwSdg6I3OGApqzGRp/jDI7Oy4q0JrkhUlvjcckpzqJuSdeU//Wbaf7EdUCfJDq9Zg4RvE3+mtN/4NfM/yWd5qNCfw4k4AVnT8W1TxXbd22TV3WVVWWMX4CClCeDw==
Beginning of JSON:
{ "blueprint": { "icons": [ { "signal": { "name": "assembling-machine-2" }, "index": 1 } ],
Notice there is no "type": "item"
property.