Assembler Pipe Passthrough - Issue Fixes & Solutions
✅ Corner Entity Alt-Mode Overlap (MAIN FIX)
Problem: Fluid box connections on corner entities (oil refineries, chemical plants, cryogenic plants) overlapped with alt-mode display information.
Solution maybe: Implemented position offsetting for corner entities to move pipe connection indicators 0.3 tiles inward from entity edges.
preview (https://drive.google.com/uc?id=1dB9SxqGC-VjJQdm9RA3Z6wq-Wvlf_-zC)
Code Implementation:
-- Detect corner entities
local is_corner_entity = (entity.name == "oil-refinery" or entity.name == "chemical-plant" or
string.find(entity.name, "cryogenic") or string.find(entity.name, "refinery"))
-- For INPUT connections (North/South):
if is_corner_entity then
-- Offset south connection slightly inward (towards center)
input_y_south = input_y_south - 0.3
-- Offset north connection slightly inward (towards center)
input_y_north = input_y_north + 0.3
end
-- For OUTPUT connections (East/West):
if is_corner_entity then
-- Offset east connection slightly inward (towards center)
output_x_east = output_x_east - 0.3
-- Offset west connection slightly inward (towards center)
output_x_west = output_x_west + 0.3
end
Complete Code Changes
In process_fluidboxes()
function:
local function process_fluidboxes(entity, entitytype)
local entity = table.deepcopy(data.raw[entitytype][entity.name])
local entity_size = get_entity_size_in_tiles(entity)
-- NEW: Check if this is a corner entity that needs special handling
local is_corner_entity = (entity.name == "oil-refinery" or entity.name == "chemical-plant" or
string.find(entity.name, "cryogenic") or string.find(entity.name, "refinery"))
if (entity_size[1] == entity_size[2]) then
-- ... existing logic ...
if fluidbox_types['input'] > 0 then
if (fb.production_type == 'input') then
-- NEW: Calculate base positions with corner entity offset
local input_x = first_input_fb_pos[1] - (i_index * 2)
local input_y_south = first_input_fb_pos[2]
local input_y_north = -first_input_fb_pos[2]
-- NEW: Apply corner entity offset
if is_corner_entity then
input_y_south = input_y_south - 0.3
input_y_north = input_y_north + 0.3
end
fb.pipe_connections = {
{
position = { input_x, input_y_south },
flow_direction = 'input-output',
direction = defines.direction.south
},
{
position = { input_x, input_y_north },
flow_direction = 'input-output',
direction = defines.direction.north
}
}
end
end
if fluidbox_types['output'] > 0 then
if fb.production_type == 'output' then
-- NEW: Calculate base positions with corner entity offset
local output_x_east = first_output_fb_pos[1]
local output_x_west = -first_output_fb_pos[1]
local output_y = first_output_fb_pos[2] - (o_index * 2)
-- NEW: Apply corner entity offset
if is_corner_entity then
output_x_east = output_x_east - 0.3
output_x_west = output_x_west + 0.3
end
fb.pipe_connections = {
{
position = { output_x_east, output_y },
flow_direction = 'input-output',
direction = defines.direction.east
},
{
position = { output_x_west, output_y },
flow_direction = 'input-output',
direction = defines.direction.west
}
}
end
end
end
end