Page 1 of 1

8-way constant combinator

Posted: Thu Aug 23, 2018 4:36 am
by DaveMcW
I am trying to make an 8-way constant combinator.

Code: Select all

local combinator = data.raw["constant-combinator"]["constant-combinator"]
table.insert(combinator.flags, "building-direction-8-way")
combinator.sprites.sheets = {
  {
    filename = "__base__/graphics/entity/rail-endings/rail-endings-background.png",
    frames = 8,
    width = 128,
    height = 128,
  }
}
combinator.activity_led_sprites.sheets = {
  {
    filename = "__base__/graphics/entity/rail-endings/rail-endings-background.png",
    frames = 8,
    width = 128,
    height = 128,
  }
}
for i = 1, 8 do
  combinator.activity_led_light_offsets[i] = {0,0}
  combinator.circuit_wire_connection_points[i] = {
    wire = {green={0,0}, red={0,0}},
    shadow = {green={0,0}, red={0,0}},
  }
end
This fails to load with the error, "Count of light offsets doesn't match the count of sprite positions".

If I leave the activity_led_light_offsets and circuit_wire_connection_points at default settings, it does load. But the diagonal rotations don't have unique graphics, they simply use one of the 4 main direction graphics.

Re: 8-way constant combinator

Posted: Thu Aug 23, 2018 6:19 am
by Bilka
The offsets/wire connection positions always expect 4 members, you cannot change that. (Doc: https://wiki.factorio.com/Prototype/ConstantCombinator ) The game expects a Sprite4Way, so it will load that and not a Sprite8Way, so you cannot have different graphics for the diagonal rotation. This is all to be expected because the combinator is build for 4 rotations, not 8, so it doesn't support having 8.