Page 1 of 1
Invalid pipe connections specification for offset
Posted: Wed Oct 14, 2020 11:44 am
by Suf
Hi All
A quick question about this error that i received: Invalid pipe connections specification for offset {-0.5390625000, -0.5078125000}. The offset must be outside of the entity bounding-box
Code: Select all
collision_box = {{-0.50, -0.48}, {0.50, 1.8}},
selection_box = {{-0.50, -0.48}, {0.50, 1.8}},
Code: Select all
fluid_boxes =
{
{
production_type = "input",
pipe_picture = assembler2pipepictures(),
pipe_covers = pipecoverspictures(),
base_area = 10,
base_level = -1,
pipe_connections = {{ type="input", position = {-0.54, -0.51} }},
secondary_draw_orders = { north = -1 }
},
{
production_type = "output",
pipe_picture = assembler2pipepictures(),
pipe_covers = pipecoverspictures(),
base_area = 10,
base_level = 1,
pipe_connections = {{ type="output", position = {0.54, 0.51} }},
secondary_draw_orders = { north = -1 }
},
off_when_no_fluid_recipe = true
},
Thanks in Advance.
Re: Invalid pipe connections specification for offset
Posted: Sat Oct 17, 2020 11:09 am
by Deadlock989
Your fluid boxes are located oddly. There is a limited range of locations they can be with regard to the collision box of the entity they belong to. See
viewtopic.php?f=25&t=40659&p=240470#p240470
Re: Invalid pipe connections specification for offset
Posted: Sat Oct 17, 2020 12:32 pm
by Suf
Quote from that topic
type="input" means fluids can only flow into this connection output would mean it can only flow out of it.
position = {0, 3} is an offset from the center. as pointed out by Posila should be in the middle of a tile.
therefore, for Posila's 3x3 example, the range is -2 to 2 in both the X and Y in steps of 1 (so -1, 0 and 1 are valid too). other structures like a 2x2 would be -1.5 to 1.5. (in steps of 1, so that's -0.5 and 0.5) Since it must be at the edge, that means one of the two variables MUST be -2 or 2. And since you can't put it in a corner, the other must not be.
So here questions to determine those numbers for any modded entity that can be put into the game; what i understood 3x3 is the possible pipe positions to the entity that can be connected to, so in the assembly machine example the pipe can be connected from three sides(although it's 4 sides in the game) and it can be positioned on three tiles that's why it's 3x3? so in my entity case if i wanted to make it only be connected by only one pipe position from up and down then it's 2x1?
Also about that one of the two variables must be -2 or 2,why is that?
how to determine the range in X and Y based on my collision box?
and finally how to determine the steps?
and yeah as the one who asked the question there i don't understand how to define the fluid box based on my collision box; the only thing i know it is should be outside the collision and as far as i know i made it like that

Re: Invalid pipe connections specification for offset
Posted: Sat Oct 17, 2020 12:49 pm
by Deadlock989
Suf wrote: Sat Oct 17, 2020 12:32 pm
So here questions to determine those numbers for any modded entity that can be put into the game; what i understood 3x3 is the possible pipe positions to the entity that can be connected to, so in the assembly machine example the pipe can be connected from three sides(although it's 4 sides in the game) and it can be positioned on three tiles that's why it's 3x3? so in my entity case if i wanted to make it only be connected by only one pipe position from up and down then it's 2x1?
Also about that one of the two variables must be -2 or 2,why is that?
how to determine the range in X and Y based on my collision box?
and finally how to determine the steps?
and yeah as the one who asked the question there i don't understand how to define the fluid box based on my collision box; the only thing i know it is should be outside the collision and as far as i know i made it like that
This is confusing me but I will try to answer.
1. I don't know what you mean by "3x3 possible pipe positions". The assembler entity is 3x3 tiles so there are actually 12 possible locations for pipes, 1 for each tile edge around its perimeter (3 north, 3 east, 3 south, 3 west, where the blue dots are in posila's picture). However in practice it can make things difficult, both for you as the modder and for players, if you have pipes on corners for small machines. They will want to have the machines lined up next to each other and that makes it impossible to connect corner pipes unless you use an underground pipe because the pipes will connect to adjoining pipes.
2. No, the machine doesn't need to be 2x1 if you want a straight connection. You can have a 1x1 entity with two opposite pipe connections (or even a 1x1 entity with connections in all four directions). Vanilla assemblers are 3x3 with a straight pair of connections (one input, one output).
3 & 4. The -2 and 2 thing is because of the size of the assembler. It is exactly 2 tiles from the centre/origin of the assembler to the location where the fluid boxes have to be. If you have a 5x5 entity then the fluid box offsets must be -3/3 etc. Basically count from the centre tile of the entity to the tile where the player would place a pipe. I guess a 4x4 entity would be -2.5/2.5 but I've never tried to make an even-numbered size entity with fluid boxes.
4. I don't know which "steps" you mean.
Fluid boxes are hell. Just wait until you start trying to assign shift values to their sprites.
Re: Invalid pipe connections specification for offset
Posted: Sat Oct 17, 2020 3:02 pm
by Suf
Deadlock989 wrote: Sat Oct 17, 2020 12:49 pm
Suf wrote: Sat Oct 17, 2020 12:32 pm
So here questions to determine those numbers for any modded entity that can be put into the game; what i understood 3x3 is the possible pipe positions to the entity that can be connected to, so in the assembly machine example the pipe can be connected from three sides(although it's 4 sides in the game) and it can be positioned on three tiles that's why it's 3x3? so in my entity case if i wanted to make it only be connected by only one pipe position from up and down then it's 2x1?
Also about that one of the two variables must be -2 or 2,why is that?
how to determine the range in X and Y based on my collision box?
and finally how to determine the steps?
and yeah as the one who asked the question there i don't understand how to define the fluid box based on my collision box; the only thing i know it is should be outside the collision and as far as i know i made it like that
This is confusing me but I will try to answer.
1. I don't know what you mean by "3x3 possible pipe positions". The assembler entity is 3x3 tiles so there are actually 12 possible locations for pipes, 1 for each tile edge around its perimeter (3 north, 3 east, 3 south, 3 west, where the blue dots are in posila's picture). However in practice it can make things difficult, both for you as the modder and for players, if you have pipes on corners for small machines. They will want to have the machines lined up next to each other and that makes it impossible to connect corner pipes unless you use an underground pipe because the pipes will connect to adjoining pipes.
2. No, the machine doesn't need to be 2x1 if you want a straight connection. You can have a 1x1 entity with two opposite pipe connections (or even a 1x1 entity with connections in all four directions). Vanilla assemblers are 3x3 with a straight pair of connections (one input, one output).
3 & 4. The -2 and 2 thing is because of the size of the assembler. It is exactly 2 tiles from the centre/origin of the assembler to the location where the fluid boxes have to be. If you have a 5x5 entity then the fluid box offsets must be -3/3 etc. Basically count from the centre tile of the entity to the tile where the player would place a pipe. I guess a 4x4 entity would be -2.5/2.5 but I've never tried to make an even-numbered size entity with fluid boxes.
4. I don't know which "steps" you mean.
Fluid boxes are hell. Just wait until you start trying to assign shift values to their sprites.
Thanks a lot ,actually now i understand this better. Apparently i have to use the grid in-game to determine all of that ,as for the steps and i quote ", the range is -2 to 2 in both the X and Y in steps of 1 "<<<that what i was referring to.
Re: Invalid pipe connections specification for offset
Posted: Mon Oct 19, 2020 5:32 am
by Suf

So here an actual comparing between the assembly machine -3,3(represented by the dots) and the entity im doing a fluid box for which as shown it's around 1.5
-1.5 based on the grid, however that seems not the case because that still an error and i've tried every number from {-0, -0.1},{0,0.1} to {0,-3},{0,3} and yeah none worked, I feel now I've reached the point where im playing a guessing game with this fluid box rather relying on facts and formulas
So any other options where i can actually use this grid for better use or just go back to basics and use the collision box to calculate the fluid box?
Re: Invalid pipe connections specification for offset
Posted: Mon Oct 19, 2020 5:48 am
by DaveMcW
Suf wrote: Wed Oct 14, 2020 11:44 amCode: Select all
collision_box = {{-0.50, -0.48}, {0.50, 1.8}},
Suf wrote: Mon Oct 19, 2020 5:32 ami've tried every number from {-0, -0.1},{0,0.1} to {0,-3},{0,3} and yeah none worked
Your collision box is not symmetric, so of course symmetric positions won't work.
Why is your collision box not symmetric?
Re: Invalid pipe connections specification for offset
Posted: Mon Oct 19, 2020 5:58 am
by Suf
DaveMcW wrote: Mon Oct 19, 2020 5:48 am
Suf wrote: Wed Oct 14, 2020 11:44 amCode: Select all
collision_box = {{-0.50, -0.48}, {0.50, 1.8}},
Suf wrote: Mon Oct 19, 2020 5:32 ami've tried every number from {-0, -0.1},{0,0.1} to {0,-3},{0,3} and yeah none worked
Your collision box is not symmetric, so of course symmetric positions won't work.
Why is your collision box not symmetric?
Because the entity itself is not symmetric, as you can see from the image above there's still some leftovers on 3rd south box and yeah the Collison box is exactly on the edges of that entity

Re: Invalid pipe connections specification for offset
Posted: Mon Oct 19, 2020 6:04 am
by DaveMcW
You should make the collision box symmetric. If you are concerned about graphics lining up, use the
shift property.
Re: Invalid pipe connections specification for offset
Posted: Mon Oct 19, 2020 6:34 am
by Suf
DaveMcW wrote: Mon Oct 19, 2020 6:04 am
You should make the collision box symmetric. If you are concerned about graphics lining up, use the
shift property.
i can instead rescale the entity in the modeling program(Blender) and then make it have a symmetrical collisions without using the shift function no?
but in order to do that i need to know what the grid size for Factorio.Thanks for the help

Re: Invalid pipe connections specification for offset
Posted: Mon Oct 19, 2020 10:56 am
by Suf

As you can see i've used your method and yeah it worked nicely for the fluid box and i used the shift to make it in line to that pipe ,but as you can see from the image now the entity has a bigger collision box than its actual size,and if i used the older collision box which fits it i'll receive the same error.
it seems the only way here is to actually resize it in the modeling program,but as i said before i don't know the grid size that Factorio uses.
Re: Invalid pipe connections specification for offset
Posted: Mon Oct 19, 2020 11:45 am
by DaveMcW
It looks like you are using +1.7 and -1.7, and have exactly 1 tile too much. Try subtracting 0.5 from both sides, for +1.2 and -1.2.
The Factorio grid is 32 pixels in normal resolution, and 64 pixels in high resolution.
Re: Invalid pipe connections specification for offset
Posted: Mon Oct 19, 2020 12:10 pm
by Suf
DaveMcW wrote: Mon Oct 19, 2020 11:45 am
It looks like you are using +1.7 and -1.7, and have exactly 1 tile too much. Try subtracting 0.5 from both sides, for +1.2 and -1.2.
The Factorio grid is 32 pixels in normal resolution, and 64 pixels in high resolution.
Yeah now it's good ,thanks for the help guys
