I am trying to get the fluid throughput of an offshore-pump. I can happily get the entitie's fluidbox's amount and capacity, but can't see a way to see/calculate its throughput.
As the amount refills from what is currently an infinite source, monitoring the amount only seems to show me if the throughput from the offshore-pump to its connected neighbour is greater than its pumping_speed.
Does anyone have any thoughts on how to do this or should I make a modding interface request?
The intention was to make water a limited resource, by tracking the consumption of offshore-pumps every game tick.
Getting Fluidbox throughput
- Muppet9010
- Filter Inserter
- Posts: 278
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: Getting Fluidbox throughput
Thats a property of its prototype:Muppet9010 wrote:I am trying to get the fluid throughput of an offshore-pump. I can happily get the entitie's fluidbox's amount and capacity, but can't see a way to see/calculate its throughput.
As the amount refills from what is currently an infinite source, monitoring the amount only seems to show me if the throughput from the offshore-pump to its connected neighbour is greater than its pumping_speed.
Does anyone have any thoughts on how to do this or should I make a modding interface request?
The intention was to make water a limited resource, by tracking the consumption of offshore-pumps every game tick.
http://lua-api.factorio.com/latest/LuaE ... ping_speed
And can't be changed at runtime
- Muppet9010
- Filter Inserter
- Posts: 278
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: Getting Fluidbox throughput
I wasn't looking to change the pumping speed initially, just to obtain the water throughput per tick.
However, as you mention pumping speed, I have now set this to 0.001 (0.06/s) and use a script to add to the fluidbox's amount. This is a bit clunky as the pump's basic pump_speed (no script amount adding) shows as technically active, but generates so little water it doesn't really provide anything useful in reality.
So I can now see how much top up room is available in the pump when adding water and thus have my throughput of the pump from the water source.
If I set the pumping speed to 0.0001 or lower (0) I found that the fluid box count was still showing as 1 in game. However, there wasn't an actual object (type, amount) there. I tried inserting one at index 1 int he same way I add water, but it didn't seem to take.
Am I approaching this wrong or is this something that can't be done at runtime via LUA API (I realise the fluid mechanics are probably compiled code behind) ?
P.S. I realise as my first wonder into Factorio modding I could have started simpler.
However, as you mention pumping speed, I have now set this to 0.001 (0.06/s) and use a script to add to the fluidbox's amount. This is a bit clunky as the pump's basic pump_speed (no script amount adding) shows as technically active, but generates so little water it doesn't really provide anything useful in reality.
So I can now see how much top up room is available in the pump when adding water and thus have my throughput of the pump from the water source.
If I set the pumping speed to 0.0001 or lower (0) I found that the fluid box count was still showing as 1 in game. However, there wasn't an actual object (type, amount) there. I tried inserting one at index 1 int he same way I add water, but it didn't seem to take.
Am I approaching this wrong or is this something that can't be done at runtime via LUA API (I realise the fluid mechanics are probably compiled code behind) ?
P.S. I realise as my first wonder into Factorio modding I could have started simpler.