8-way constant combinator

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

8-way constant combinator

Post 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.

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: 8-way constant combinator

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Modding discussion”