As used in https://lua-api.factorio.com/latest/Lua ... flow_count, it actually returns the average value over 5 seconds, not 1. I've only tested this with electrical networks.
For my mod, I want this time period to be as low as possible. Having an actual '1 second' option would be good, although 1 tick would be much better! (Or you could expose the total value over 1 tick, which would be perfect! viewtopic.php?f=28&t=94959)
If need be, I can provide a mod and save that demonstrates this.
[Rseding91] [1.1.21] defines.flow_precision_index.one_second actually represents 5 seconds
[Rseding91] [1.1.21] defines.flow_precision_index.one_second actually represents 5 seconds
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: [1.1.21] defines.flow_precision_index.one_second actually represents 5 seconds
In case you're concerned about any backwards incompatible changes you fancy making, the string 'defines.flow_precision_index.one_second' only occurs in the following mods:
capacity-combinator_1.0.3 capacity-combinator_1.0.3/control.lua
power-combinator_4.3.3 power-combinator_4.3.3/control.lua (same author as capacity-combinator)
spawner-alert_0.1.7 spawner-alert_0.1.7/control.lua
PowerOverload_1.0.0 PowerOverload_1.0.0/control.lua (my mod)
capacity-combinator_1.0.3 capacity-combinator_1.0.3/control.lua
power-combinator_4.3.3 power-combinator_4.3.3/control.lua (same author as capacity-combinator)
spawner-alert_0.1.7 spawner-alert_0.1.7/control.lua
PowerOverload_1.0.0 PowerOverload_1.0.0/control.lua (my mod)
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: [1.1.21] defines.flow_precision_index.one_second actually represents 5 seconds
Thanks for the report. It's now fixed for the next release.
The defines are correct but the logic in get_flow_count was wrong.
The defines are correct but the logic in get_flow_count was wrong.
If you want to get ahold of me I'm almost always on Discord.
Re: [1.1.21] defines.flow_precision_index.one_second actually represents 5 seconds
I did notice that the one-second window will give numbers back scaled to 1 minute. Is that what you meant?
It matches how the GUI functions; it takes the 1 second window and says "if you did this for a minute; here's what you would make".
It matches how the GUI functions; it takes the 1 second window and says "if you did this for a minute; here's what you would make".
If you want to get ahold of me I'm almost always on Discord.
Re: [1.1.21] defines.flow_precision_index.one_second actually represents 5 seconds
That bit is fine, I just multiply the result by 60 to get it in watts. Its nice in that you can pick any of the defines and your maths would be the same, the only difference being how far back in time it effects the result.Rseding91 wrote: Thu Feb 11, 2021 7:39 pm I did notice that the one-second window will give numbers back scaled to 1 minute. Is that what you meant?
It matches how the GUI functions; it takes the 1 second window and says "if you did this for a minute; here's what you would make".
What I'm really wanting (but is outside the scope of this bug report) is a way to get the network consumption (506MW in this screenshot), which compared to my current solution:
1. would require no calculations on the lua side (this code is ran many times every tick)
2. would update instantly (not be averaged over the last second)
2. could also be achieved by adding a defines.flow_precision_index.one_tick
Anyway, this has spilled over from viewtopic.php?f=28&t=94959, where it should belong.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: [Rseding91] [1.1.21] defines.flow_precision_index.one_second actually represents 5 seconds
Hmm, I'm pretty sure that this has still not been fixed as of 1.1.24. With the mods Power Overload and Editor Extensions, the following blueprint creates a situation where the pole should blow up every second, but it only blows up exactly every 5 seconds. I'm using `defines.flow_precision_index.one_second`.
Please can this be moved back to "Bug reports", and let me know if I'm misunderstanding something!
Edit: Fixed in 1.1.25: https://wiki.factorio.com/Version_history/1.1.0#1.1.25
Please can this be moved back to "Bug reports", and let me know if I'm misunderstanding something!
Edit: Fixed in 1.1.25: https://wiki.factorio.com/Version_history/1.1.0#1.1.25
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings