Forbid specific fluid going through pipe & tank

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
jessefjxm
Inserter
Inserter
Posts: 37
Joined: Wed Mar 14, 2018 1:45 am
Contact:

Forbid specific fluid going through pipe & tank

Post by jessefjxm »

This is my original post trying to find a solution: viewtopic.php?f=25&t=59127&p=352950#p352950, but looks like we lack proper interface at current version. Wondering if we can have a option in fluid prototype that simple forbid such fulid going through pipe and tank.


Contents from post above:

Hellow guys, i'm currently writing a mod that aims to create modular accelerators. I use fluids to simulate particle flows in different energy levels (100Mev, 1Gev, etc.). The reason i choose fluid is i can place several "acceleration modules" one by one, and with auto-recipe trick a initial flow (I call it particle-flow-1Mev) can travel through these acceleration moduels with energy level keep increasing (input:fluid.particle-flow-1Mev, output:fluid.particle-flow-10Mev) so they can works like one large and whole acclerator. Steps above works fine, but I hope there's a way to restrict those particle flows (fluids) only go through my acceleration modules(buildings), cause it's really weird when you see a flow of 250Gev energetic particles going through the pipe and be stored in the tank. Anybody got some ideas? :D

This "accelerator" looks like this -- don't mind the textures!
Image

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

Re: Forbid specific fluid going through pipe & tank

Post by Deadlock989 »

Fluid boxes have a "filter" attribute which specifies which fluids are allowed in. https://wiki.factorio.com/Types/FluidBox#filter

You would have to restrict vanilla pipes to only work with vanilla fluids, or to work with other mods, parse through all the fluid types and don't add your particle ones.
Image

jessefjxm
Inserter
Inserter
Posts: 37
Joined: Wed Mar 14, 2018 1:45 am
Contact:

Re: Forbid specific fluid going through pipe & tank

Post by jessefjxm »

Deadlock989 wrote:Fluid boxes have a "filter" attribute which specifies which fluids are allowed in. https://wiki.factorio.com/Types/FluidBox#filter

You would have to restrict vanilla pipes to only work with vanilla fluids, or to work with other mods, parse through all the fluid types and don't add your particle ones.
As far as I know filter can only restrict one fluid rather than a list or table...devs says restrict for table will harm performance. viewtopic.php?f=28&t=46302

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

Re: Forbid specific fluid going through pipe & tank

Post by Deadlock989 »

So it does. Well, there you go, that's why.
Image

jessefjxm
Inserter
Inserter
Posts: 37
Joined: Wed Mar 14, 2018 1:45 am
Contact:

Re: Forbid specific fluid going through pipe & tank

Post by jessefjxm »

Yeah, that's why I hope devs can add such feature with minimum effect to performance.

saors
Inserter
Inserter
Posts: 34
Joined: Wed May 17, 2017 12:09 am
Contact:

Re: Forbid specific fluid going through pipe & tank

Post by saors »

I would propose this:

Devs add a filter to the entity connections.

Instead of filtering what can go in the pipe, you filter what can be connected to the pipe.

So you would add this filter to the buildings, only whitelisting other buildings from your mod or any of your custom pipes to be connected. And you would add the same filter to your pipes.
Since you wouldn't be able to connect regular pipes or storage tanks, etc, to your custom pipes, there's no way for the players to store the fluid.

This shouldn't have that big of an effect on performance either (to my understanding) since the check is done on_entity_place/modified as opposed to every tick when the fluid is flowing.

Post Reply

Return to “Modding interface requests”