Invalid pipe connections specification for offset

Place to get help with not working mods / modding interface.
Post Reply
Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Invalid pipe connections specification for offset

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

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Invalid pipe connections specification for offset

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

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Invalid pipe connections specification for offset

Post by Suf »

Deadlock989 wrote:
Sat Oct 17, 2020 11:09 am
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
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 :?:

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Invalid pipe connections specification for offset

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

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Invalid pipe connections specification for offset

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

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Invalid pipe connections specification for offset

Post by Suf »

Image
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 :lol:
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?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Invalid pipe connections specification for offset

Post by DaveMcW »

Suf wrote:
Wed Oct 14, 2020 11:44 am

Code: Select all

		collision_box = {{-0.50, -0.48}, {0.50, 1.8}},
Suf wrote:
Mon Oct 19, 2020 5:32 am
i'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?

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Invalid pipe connections specification for offset

Post by Suf »

DaveMcW wrote:
Mon Oct 19, 2020 5:48 am
Suf wrote:
Wed Oct 14, 2020 11:44 am

Code: Select all

		collision_box = {{-0.50, -0.48}, {0.50, 1.8}},
Suf wrote:
Mon Oct 19, 2020 5:32 am
i'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
Image

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Invalid pipe connections specification for offset

Post by DaveMcW »

You should make the collision box symmetric. If you are concerned about graphics lining up, use the shift property.

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Invalid pipe connections specification for offset

Post 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 :mrgreen:

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Invalid pipe connections specification for offset

Post by Suf »

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

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Invalid pipe connections specification for offset

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

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Invalid pipe connections specification for offset

Post 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 :)

Post Reply

Return to “Modding help”