Page 1 of 1

Forbid specific fluid going through pipe & tank

Posted: Wed Mar 28, 2018 3:00 pm
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

Re: Forbid specific fluid going through pipe & tank

Posted: Wed Mar 28, 2018 3:29 pm
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.

Re: Forbid specific fluid going through pipe & tank

Posted: Wed Mar 28, 2018 4:06 pm
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

Re: Forbid specific fluid going through pipe & tank

Posted: Wed Mar 28, 2018 6:06 pm
by Deadlock989
So it does. Well, there you go, that's why.

Re: Forbid specific fluid going through pipe & tank

Posted: Thu Mar 29, 2018 1:12 pm
by jessefjxm
Yeah, that's why I hope devs can add such feature with minimum effect to performance.

Re: Forbid specific fluid going through pipe & tank

Posted: Fri Apr 06, 2018 5:28 pm
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.