Add flow to Fluid box API

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
hreintke
Fast Inserter
Fast Inserter
Posts: 115
Joined: Mon Sep 04, 2017 6:52 pm
Contact:

Add flow to Fluid box API

Post by hreintke »

In the API a fluid box is defined as

Code: Select all

A fluid box is represented as a table:

name :: string: Fluid prototype name of the fluid contained in this fluid box.
amount :: double: Amount of the fluid in this box.
temperature :: double (optional): The temperature. When reading from LuaFluidBox, this field will always be present. It is not necessary to specify it when writing, however. When not specified, the fluid box will be set to the fluid's default temperature as specified in the fluid's prototype.
When activation debug option I can also see the flow.

Code: Select all

show-fluid-box-fluid-info	How much fluid is in a pipe/storage tank, shows flow of liquid in pipes.
Is it possible to add the flow to the fluidbox API ?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add flow to Fluid box API

Post by Rseding91 »

What would the use-case be?
If you want to get ahold of me I'm almost always on Discord.

hreintke
Fast Inserter
Fast Inserter
Posts: 115
Joined: Mon Sep 04, 2017 6:52 pm
Contact:

Re: Add flow to Fluid box API

Post by hreintke »

Would use it in my modded combinator to show/act on actual flow of liquids in parts of the factory.
I know pipes cannot be connected to the circuit network but can work around that issue.

In what units is the flow expressed ?
Don't see the flow graphics in a tank, is it just to small to see or not available ?

hreintke
Fast Inserter
Fast Inserter
Posts: 115
Joined: Mon Sep 04, 2017 6:52 pm
Contact:

Re: Add flow to Fluid box API

Post by hreintke »

Hi,

What is your opinion on this ?
Any chance that this can be added ?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add flow to Fluid box API

Post by Rseding91 »

Pipes don't track how much flows through them. Just a general "amount" as in "none", "slow", "fast" and so on.
If you want to get ahold of me I'm almost always on Discord.

hreintke
Fast Inserter
Fast Inserter
Posts: 115
Joined: Mon Sep 04, 2017 6:52 pm
Contact:

Re: Add flow to Fluid box API

Post by hreintke »

That's not to bad for my use.

That will give me enough info to work with.
Is it possible to add that to the fluidbox API ?

hreintke
Fast Inserter
Fast Inserter
Posts: 115
Joined: Mon Sep 04, 2017 6:52 pm
Contact:

Re: Add flow to Fluid box API

Post by hreintke »

Any opinion on this.

I would like to make a mod like bottleneck(logistics) visualizing the flows in my factory.
Not taking every pipe into account but a user selectable subset.

This update would make that possible.

TreefrogGreaken
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Thu May 04, 2017 12:07 pm
Contact:

Re: Add flow to Fluid box API

Post by TreefrogGreaken »

I'd second this, as this would enable me to create my mod!

Im trying to get the amount of Water that is being generated/flowing from an Offshore Pump.

I've tried doing this already by assessing the fluidbox.amount value, which allows me to then get a tick counter going to calculate the amount of water that has been flowing. Though the amount value then goes to 0 once its filled the first pipe up and my mod then assumes the offhore pump is no longer working, so my tick couter stops.

If there was a value, or at least a flowing yes/no value then I would know that the offshore pump is working and be able to get the right amount of water provided.

Without this I can't see a way to get the amount of water created, and compare this to the amount of water ive setup for the tiles. Yes im trying to turn water into a finite resource!

TreefrogGreaken
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Thu May 04, 2017 12:07 pm
Contact:

Re: Add flow to Fluid box API

Post by TreefrogGreaken »

Any ideas if the above could be included in the changes for 0.17?

The idea would really help in knowing if an Offshore Pump has fluid flowing through it, or if there was an entity.active on offshore pumps so that I would know if they are pumping or not.

Heres the mod that would benifit from it : https://mods.factorio.com/mod/WaterAsAResource

If not, then my guesstimate will have to remain.

ps. Sorry for the necrobump if its been too long on this topic.

Post Reply

Return to “Modding interface requests”