pipe-to-ground entities limited to 1 underground connectio

This subforum contains all the issues which we already resolved.
sparr
Smart Inserter
Smart Inserter
Posts: 1520
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

pipe-to-ground entities limited to 1 underground connectio

Post by sparr »

I've defined the following entity of type pipe-to-ground. In theory it should be able to make an underground connection in both directions, but it can't. If underground connections are intentionally limited to one, the structure of the pipe_connections table should be changed. If multiples should work, then this is a bug.

Code: Select all

      pipe_connections =
      {
        {
          position = {0, -1},
          max_underground_distance = 1
        },
        {
          position = {0, 1},
          max_underground_distance = 1
        },
      },
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: pipe-to-ground entities limited to 1 underground connect

Post by slpwnd »

Yup, this is a bug. It should be possible to have multiple connections. This will be fixed in 0.9.2.
sparr
Smart Inserter
Smart Inserter
Posts: 1520
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: pipe-to-ground entities limited to 1 underground connect

Post by sparr »

Awesome, thanks! Here are the complete entities that I'm adding with this fixed feature:

Code: Select all

  {
    type = "pipe-to-ground",
    name = "underground-pipe",
    icon = "__pipe-dream__/graphics/icons/underground-pipe.png",
    flags = {"placeable-neutral", "player-creation"},
    minable = {hardness = 0.2, mining_time = 0.75, result = "underground-pipe"},
    max_health = 50,
    corpse = "small-remnants",
    resistances =
    {
      {
        type = "fire",
        percent = 80
      }
    },
    collision_box = {{-0.1, -0.1}, {0.1, 0.1}},
    selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
    fluid_box =
    {
      base_area = 1,
      -- pipe_covers = pipecoverspictures(),
      pipe_connections =
      {
        {
          position = {0, -1},
          max_underground_distance = 1
        },
        {
          position = {0, 1},
          max_underground_distance = 1
        },
      },
    },
    underground_sprite =
    {
      filename = "__core__/graphics/arrows/underground-lines.png",
      priority = "high",
      width = 32,
      height = 32
    },
    pictures =
    {
      up =
      {
        filename = "__pipe-dream__/graphics/entity/underground-pipe/underground-pipe-updown.png",
        priority = "high",
        width = 44,
        height = 32 --, shift = {0.10, -0.04}
      },
      down =
      {
        filename = "__pipe-dream__/graphics/entity/underground-pipe/underground-pipe-updown.png",
        priority = "high",
        width = 40,
        height = 32 --, shift = {0.05, 0}
      },
      left =
      {
        filename = "__pipe-dream__/graphics/entity/underground-pipe/underground-pipe-leftright.png",
        priority = "high",
        width = 32,
        height = 42 --, shift = {-0.12, 0.1}
      },
      right =
      {
        filename = "__pipe-dream__/graphics/entity/underground-pipe/underground-pipe-leftright.png",
        priority = "high",
        width = 32,
        height = 40 --, shift = {0.1, 0.1}
      },
    }
  },
  {
    type = "pipe-to-ground",
    name = "pipe-to-ground-tap",
    icon = "__base__/graphics/entity/pipe/pipe-cross.png",
    flags = {"placeable-neutral", "player-creation"},
    minable = {hardness = 0.2, mining_time = 0.75, result = "pipe-to-ground-tap"},
    max_health = 50,
    corpse = "small-remnants",
    resistances =
    {
      {
        type = "fire",
        percent = 80
      }
    },
    collision_box = {{-0.3, -0.3}, {0.3, 0.3}},
    selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
    fluid_box =
    {
      base_area = 1,
      pipe_covers = pipecoverspictures(),
      pipe_connections =
      {
        {
          position = {0, -1},
          max_underground_distance = 5
        },
        {
          position = {1, 0},
          max_underground_distance = 5
        },
        {
          position = {0, 1},
          max_underground_distance = 5
        },
        {
          position = {-1, 0},
          max_underground_distance = 5
        },
        { position = {0, -1} },
        { position = {1, 0} },
        { position = {0, 1} },
        { position = {-1, 0} }
      },
    },
    underground_sprite =
    {
      filename = "__core__/graphics/arrows/underground-lines.png",
      priority = "high",
      width = 32,
      height = 32
    },
    pictures =
    {
      up =
      {
        filename =  "__base__/graphics/entity/pipe/pipe-cross.png",
        priority = "high",
        width = 40,
        height = 40
      },
      down =
      {
        filename =  "__base__/graphics/entity/pipe/pipe-cross.png",
        priority = "high",
        width = 40,
        height = 40
      },
      left =
      {
        filename =  "__base__/graphics/entity/pipe/pipe-cross.png",
        priority = "high",
        width = 40,
        height = 40
      },
      right =
      {
        filename =  "__base__/graphics/entity/pipe/pipe-cross.png",
        priority = "high",
        width = 40,
        height = 40
      },
    },
  },
sparr
Smart Inserter
Smart Inserter
Posts: 1520
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: pipe-to-ground entities limited to 1 underground connect

Post by sparr »

I just discovered that *sometimes* the second connection works. I can't discern a pattern, although it always works or doesn't work in the same situation, so it's consistent.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: pipe-to-ground entities limited to 1 underground connect

Post by slpwnd »

sparr wrote:I just discovered that *sometimes* the second connection works. I can't discern a pattern, although it always works or doesn't work in the same situation, so it's consistent.
My guess would be that now (0.9.1) it doesn't work only when the other connection is in the same direction as from where you are connection. The trick was that when the code is searching for the other side of the pipe and encounters a pipe that has opposite pipe-to-ground connection than it expects then it stops searching. This has been changed that it still looks at other connections of that entity and then stops.
sparr
Smart Inserter
Smart Inserter
Posts: 1520
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: pipe-to-ground entities limited to 1 underground connect

Post by sparr »

In my tests I am using entities with connections in two or four directions. The only time I have two connections in the same direction is when one is underground and the other is aboveground, but that does not seem to affect this behavior. Even with potential connections in four different directions, I am seeing connections after the first one sometimes work and sometimes not.
Post Reply

Return to “Resolved Problems and Bugs”