fluid-wagon, user defined connection points

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

fluid-wagon, user defined connection points

Post by bobingabout »

I tried tried to make a 10 length wagon. Here is the code changes.

Code: Select all

    collision_box = {{-0.6, -4.6}, {0.6, 4.6}},
    selection_box = {{-1, -2.703125}, {1, 5.296875}},
    joint_distance = 8,
This is the result:
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
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: fluid-wagon, user defined connection points

Post by bobingabout »

Just an update highlighting one of the issues with short wagons:
https://www.dropbox.com/s/0af7o8l0w4vj9 ... 2.png?dl=0
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: fluid-wagon, user defined connection points

Post by posila »

Pump connector is unfortunatelly pretty much hardcoded for exactly our use case, because it turned out to be so complicated (and everybody now claims they weren't the one who wanted it to be this complicated - that is with pump connecting from the top) ... and I think it is pretty good candidate for the next thing to be reworked.

I don't see more connection points added for 1.0, but adding check that the pump is really next to a wagon _should_ be small safe change, I think. Can you PM the mod with short wagons (or is it already in one of your released mods), so I can see if I can do something about it.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: fluid-wagon, user defined connection points

Post by Optera »

posila wrote:
Sun May 31, 2020 8:49 am
I don't see more connection points added for 1.0, but adding check that the pump is really next to a wagon _should_ be small safe change, I think. Can you PM the mod with short wagons (or is it already in one of your released mods), so I can see if I can do something about it.
Depending on implementation of this check I foresee Cargo Ships breaking again.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: fluid-wagon, user defined connection points

Post by bobingabout »

Small wagons having pumps connecting correctly would be a starting point.

PM sent, with mod link.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2227
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: fluid-wagon, user defined connection points

Post by boskid »

This is kind of implemented in 0.18.30. FluidWagon prototype will have tank_count with allowed values of 1,2 or 3 and default value of 3. No mods should be broken.
Tank connection points will have spacing of 2 as always and set of connectors will be centered.

User avatar
Therax
Filter Inserter
Filter Inserter
Posts: 470
Joined: Sun May 21, 2017 6:28 pm
Contact:

Re: fluid-wagon, user defined connection points

Post by Therax »

boskid wrote:
Wed Jun 03, 2020 12:58 pm
This is kind of implemented in 0.18.30. FluidWagon prototype will have tank_count with allowed values of 1,2 or 3 and default value of 3. No mods should be broken.
Tank connection points will have spacing of 2 as always and set of connectors will be centered.
This name initially made me think that the initial fluid wagon implementation had been exposed again, that could actually have 3 separate fluidboxes to hold 3 different fluids. Perhaps this should be "tank_connection_count"?
Miniloader — UPS-friendly 1x1 loaders
Bulk Rail Loaders — Rapid train loading and unloading
Beltlayer & Pipelayer — Route items and fluids freely underground

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2227
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: fluid-wagon, user defined connection points

Post by boskid »

Therax wrote:
Wed Jun 03, 2020 6:27 pm
This name initially made me think that the initial fluid wagon implementation had been exposed again, that could actually have 3 separate fluidboxes to hold 3 different fluids. Perhaps this should be "tank_connection_count"?
Oh no... this feature is 1 day old and it is already a legacy. Lets say this is minor issue, there are 3 tanks by default but they are all connected and there is no prototype flag to allow them being separated - that way it will be future proof just in case and i will not have to change it breaking mods released since yesterday (if any) that would depend on current name.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: fluid-wagon, user defined connection points

Post by bobingabout »

I don't mind either way, as long as somebody documents the correct functionality of whatever flag is used on the wiki. My mod that will make use of this isn't anywhere near complete yet.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Post Reply

Return to “Modding interface requests”