Code: Select all
collision_box = {{-0.6, -4.6}, {0.6, 4.6}},
selection_box = {{-1, -2.703125}, {1, 5.296875}},
joint_distance = 8,
https://www.dropbox.com/s/jgbfhboz2c8tb ... 6.png?dl=0
As you can see, only 3 of the 5 pumps try to connect. It's not entirely unexpected, but not the desired behaviour, when placing the pump, the ground does highlight a yellow square around what would be the two far end tanks, they just don't actually connect.
In this specific example, simply having some sort of option to tell it that there should be 5 pump connections would be an acceptable solution, however...
if you're going to allow modders to change the number, why not also the position? (Some rules should still apply, such as them being placed in the middle between tiles, maybe also 2 tiles apart.)
What if a wagon has 2 connection points that are either side of the center? (Maybe it's only a 4 tile long wagon)
what if a wagon is large, but the graphics only have a single pipe connection point? (A lot of IRL fluid wagons look like this)
what if it's a non-symmetrical wagon, and the modder wants a single pipe connection at one of the ends?
Since the graphics for the pump connectors are basically fixed, you probably want to define the connection points only as whole numbers as an offset from the middle of the wagon, 0 being the center, and then increments of -1 or 1 to shift it 1 tile either way... possibly also with the rule that they need to be at least 2 tiles apart.
so, an example of default fluid wagon would be... pump_connection_offsets = -2, 0, 2
Other examples for the scenarios I listed above would be...
pump_connection_offsets = -4, -2, 0, 2, 4
pump_connection_offsets = -1, 1
pump_connection_offsets = 0
pump_connection_offsets = 2