Pipe Valve and Routing

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
gavrielba
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Nov 29, 2022 2:14 am
Contact:

Pipe Valve and Routing

Post by gavrielba »

I have a mod idea and I don't know if it's possible.

(On the simplest terms) I want to add a valve item to pipes. The valve can close and open a pipe line.

Image

Here's a practical example. Let's say I'm using a mod where a building can accept different energy fluids for its' operation. Let's say a Factory can accept either Oil or Gas for energy source. If I had a valve like that I could control the pipe network better and route whichever energy source I have more to the factory! This valve can basically act like a filtered splitter or filtered inserter but for the pipe networks.

Now, I tried to use pumps for that. And, indeed, it should work because when pump is on, it only allows liquid in one direction and it can be turned off from signal network. But it doesn't work in cases where I want to route two different liquids through the same pipe! (like in the picture)

So herein lies my question: if you have any experience with mods at all, do you know if it's possible? Maybe something even along the lines of "destroying" a pipe link and "rebuilding" it according to a switch?

I actually asked this on reddit /factorio sub and they couldn't answer so you're like my last hope before I might need to spend hours researching Factorio mod-making only to discover that it's not possible!

Few points to consider:

[*]I can already do it manually. I can route different liquids through same pipes by manually destroying and rebuilding pipe links. I just have to be sure that the pipe line I'm connecting to is completely empty from the previous liquid before I connect it. Which is fine because the mod can just not allow the valve to open if there's a chance of liquid contamination.

[*]Over at reddit they told me that by using bots it's already possible to connect two pipelines together even if they have different liquids. I don't know how much that helps but it might be worth sharing.

Again, I'm a good programmer and I can do everything myself (even graphics) I would just prefer to know if it's possible at all before I start getting into it. THANKS!!

Post Reply

Return to “Modding discussion”