Add a method to get contents of an entire fluid system

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
asher_sky
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Sun Oct 18, 2020 7:13 pm
Contact:

Add a method to get contents of an entire fluid system

Post by asher_sky »

Would it be possible to add a method to be able to get the contents of an entire fluid system?

Essentially I just want to know what fluid is used for the highlight visualization when a player selects one of the pipes. I've tried using `get_fluid_segment_contents()`, but certain entities like pumps end the segment. So in the case where a pump has pushed all the heavy oil out of a pipe segment and into a storage tank, if a player hovers the empty pipe segment the highlight will be red, but get_fluid_segment_contents will not return the heavy oil in the other part of the system.

It would be really nice to have a way to know what fluids are in the whole system (ideally the same as what the base game uses to determine highlight visualization color), or even just some way to get the connected fluid segments so I could crawl and query them without needing to iterate each connected fluidbox.

Thank you!
GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 525
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: Add a method to get contents of an entire fluid system

Post by GrumpyJoe »

asher_sky wrote: Mon Jan 06, 2025 7:59 pm So in the case where a pump has pushed all the heavy oil out of a pipe segment and into a storage tank, if a player hovers the empty pipe segment the highlight will be red
I made a bug report for this specific part, being told it's intended. The color stays the same, even if you empty the pipe segment. Color only gets updated when any fluid enters that segment again.

Just a FYI, as for the rest, I wouldn't know.

Keeping pipe segments separate might have something to do with people doing crazy stuff, have multi fluid offloader stations nowadays.
Post Reply

Return to “Modding interface requests”