Page 1 of 1

[2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Posted: Thu Apr 17, 2025 7:34 pm
by LazyManiac13
I started to develop my own pipe mod with not truly underground pipes, that I want to collide with other entities on build.
I found that underground_collision_mask for connecting pipes checks collisions with tiles only. I tried to add "object", "is_object", "is_lower_object" to collision layers. I also tried to force it by setting colliding_with_tiles_only = false but it does not work either.

Please, allow this check to work with all collision layers.

Code: Select all

  {
    type = "pipe-to-ground",
    name = "test-pipe",
    fluid_box =
    {
      pipe_connections =
      {
        { direction = defines.direction.north, connection_category = { "default", "test-pipe" }, position = {0, 0} },
        { direction = defines.direction.south, connection_category = "test-pipe", position = {0, 0} },
        {
          connection_type = "underground",
          direction = defines.direction.south,
          position = {0, 0},
          max_underground_distance = 10,
          underground_collision_mask =
          {
            colliding_with_tiles_only = false,
            layers = 
            {
              object = true,
              -- is_object = true,
              -- is_lower_object = true,
              water_tile = true,
              empty_space = true,
              lava_tile = true,
              -- ground_tile = false,
              -- floor = false,
              -- transport_belt = true,
            },
          },
        },
      },
      hide_connection_info = true
    },

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Posted: Thu Apr 17, 2025 9:18 pm
by Rseding91
Thanks for the report however that is intended. Its entire function is tile collision and does not interact with other entities.

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Posted: Thu Apr 17, 2025 9:25 pm
by robot256
There are other collision layer names that have special purposes and don't actually cause collisions to happen, like elevated_rail_support. It would be nice if these special cases were documented somewhere.

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Posted: Thu Apr 17, 2025 9:44 pm
by Bilka
robot256 wrote: Thu Apr 17, 2025 9:25 pm There are other collision layer names that have special purposes and don't actually cause collisions to happen, like elevated_rail_support. It would be nice if these special cases were documented somewhere.
https://lua-api.factorio.com/latest/typ ... ision_mask is already documented as only checking collision with tiles. The names of the collision layers are irrelevant in this case.

What do you mean by elevated_rail_support not causing collision?

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Posted: Thu Apr 17, 2025 9:50 pm
by LazyManiac13
Rseding91 wrote: Thu Apr 17, 2025 9:18 pm Thanks for the report however that is intended. Its entire function is tile collision and does not interact with other entities.
Consider it modding feature request then. Let colliding_with_tiles_only be true by default in case of underground_collision_mask and allow to override it.
In rare case, if it is set to false by prototype, you can check all collision layers. Please.

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Posted: Thu Apr 17, 2025 10:03 pm
by robot256
Bilka wrote: Thu Apr 17, 2025 9:44 pm
robot256 wrote: Thu Apr 17, 2025 9:25 pm There are other collision layer names that have special purposes and don't actually cause collisions to happen, like elevated_rail_support. It would be nice if these special cases were documented somewhere.
https://lua-api.factorio.com/latest/typ ... ision_mask is already documented as only checking collision with tiles. The names of the collision layers are irrelevant in this case.

What do you mean by elevated_rail_support not causing collision?
Sorry, I meant "rail_support". And now I feel crazy, because it works (causes collisions) in 2.0.43. I definitely made two different git commits of Cargo Ships to make boats collide with rail supports. First, I tried "rail_support", and then I switched to "is_object" because the first change didn't seem to work at the time. Either I was testing the wrong code or something changed between then and now. Probably it was my fault somehow.