Page 1 of 1

[1.1.94] Blueprint string import requirement incongruencies

Posted: Sun Oct 29, 2023 10:25 am
by Qon
This blueprint works:

Code: Select all

{
  blueprint: {
    icons: [
      {
        signal: { type: 'item', name: 'constant-combinator' },
        index: 1
      }
    ],
    entities: [
      {
        name: 'small-lamp',
        connections: {
          '1': {
            red: [ { entity_id: 2, circuit_id: 1 } ],
            green: [ { entity_id: 3 } ]
          }
        },
        position: { x: 0.5, y: 0.5 },
        entity_number: 1
      },
      {
        name: 'decider-combinator',
        connections: {
          '1': { red: [ { entity_id: 1 } ] }
        },
        position: { x: 1.5, y: 0.5 },
        direction: 2,
        entity_number: 2
      },
      {
        name: 'small-lamp',
        connections: {
          '1': {
            red: [ { entity_id: 4, circuit_id: 1 } ],
            green: [ { entity_id: 1 } ]
          }
        },
        position: { x: 0.5, y: 1.5 },
        entity_number: 3
      },
      {
        name: 'decider-combinator',
        connections: {
          '1': { red: [ { entity_id: 3 } ] }
        },
        position: { x: 1.5, y: 1.5 },
        direction: 2,
        entity_number: 4
      }
    ],
    item: 'blueprint',
    version: 281479277838336
  }
}
However, if I remove the ", circuit_id: 1 " parts from the red wires, the green wire don't appear (Though I get "Blueprint imported successfully" in flying text.)

Non-working bp:

Code: Select all

{
  blueprint: {
    icons: [
      {
        signal: { type: 'item', name: 'constant-combinator' },
        index: 1
      }
    ],
    entities: [
      {
        name: 'small-lamp',
        connections: {
          '1': { red: [ { entity_id: 2 } ], green: [ { entity_id: 3 } ] }
        },
        position: { x: 0.5, y: 0.5 },
        entity_number: 1
      },
      {
        name: 'decider-combinator',
        connections: {
          '1': { red: [ { entity_id: 1 } ] }
        },
        position: { x: 1.5, y: 0.5 },
        direction: 2,
        entity_number: 2
      },
      {
        name: 'small-lamp',
        connections: {
          '1': { red: [ { entity_id: 4 } ], green: [ { entity_id: 1 } ] }
        },
        position: { x: 0.5, y: 1.5 },
        entity_number: 3
      },
      {
        name: 'decider-combinator',
        connections: {
          '1': { red: [ { entity_id: 3 } ] }
        },
        position: { x: 1.5, y: 1.5 },
        direction: 2,
        entity_number: 4
      }
    ],
    item: 'blueprint',
    version: 281479277838336
  }
}
I could expect circuit_id to be a requirement for entities with multiple connection points (arithmetic and decider), but they don't seem to be. At least, the red wires which have them are not affected at all if circuit_id is there or not. It correctly defaults to 1.
I don't understand how the green wire is affected by the definition of the red wire though. That seems like a bug.
Expected result:
  • Both blueprints should work the same (not true here).
  • Red wire definitions shouldn't affect green wire definitions (not true here).
  • I should be able to leave out circuit_id if it connects to 1 (input) on a arithmetic/decider (true here for the red wire, it still works, but false in the sense that other "unrelated" parts of the blueprint breaks.)

Re: [1.1.94] Blueprint string import requirement incongruencies

Posted: Tue Dec 19, 2023 5:24 pm
by Rseding91
Thanks for the report however I don't consider changing the internal blueprint string representation worth our time. The format has its requirements (which have never been explained in detail) and if they aren't met then areas will not work (as you've found).

Wires specifically suppress any errors that show up because entities may or may not have wire support depending on the mod(s) active at any point when importing a string.