Expose historical data of LuaFlowStatistics

Post Reply
User avatar
Wiwiweb
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat May 08, 2021 2:36 am
Contact:

Expose historical data of LuaFlowStatistics

Post by Wiwiweb »

Image

Using LuaFlowStatistics.get_flow_count, I can get any data in the green box.
I want to get the data in the red box.

Something like get_flow_count_at_timestamp() that would take a prototype name and a game tick timestamp, and return the production rate and/or count at that timestamp.

Why?
I'm looking to create a mod that records the time of the first creation of an item, and I would like it to be able to find that retroactively, if the mod is added to an existing save file.

Thanks!

User avatar
NotRexButCaesar
Smart Inserter
Smart Inserter
Posts: 1120
Joined: Sun Feb 16, 2020 12:47 am
Contact:

Re: Expose historical data of LuaFlowStatistics

Post by NotRexButCaesar »

I believe the values are also stored with more significant digits than displayed, so this could act as a way to get more precise values for testing builds in the editor.
Last edited by NotRexButCaesar on Sat Nov 20, 2021 5:56 am, edited 1 time in total.
—Crevez, chiens, si vous n'étes pas contents!

User avatar
Wiwiweb
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat May 08, 2021 2:36 am
Contact:

Re: Expose historical data of LuaFlowStatistics

Post by Wiwiweb »

My mod is released now.

https://mods.factorio.com/mod/Milestones

I ended up adding a manual input so players can copy values from the production graphs.

But I'm hoping I can update that to be automatic in the future, wink nudge ;)

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 450
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: Expose historical data of LuaFlowStatistics

Post by raiguard »

Bump. Having milestones work retroactively with greater precision would be awesome!
Don't forget, you're here forever.

stillmoms
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Mar 03, 2022 10:04 pm
Contact:

Re: Expose historical data of LuaFlowStatistics

Post by stillmoms »

Another bump from me. As someone who discovered Milestones after getting 800 hours deep into Space Exploration, it’d be nice to be able to get more detailed statistics on when I first did something than “somewhere between 48 hours and 858 hours”.

dubax
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed Jan 10, 2018 6:01 pm
Contact:

Re: Expose historical data of LuaFlowStatistics

Post by dubax »

Bump. Also would love to see the functionality of this mod be better!

Xorimuth
Filter Inserter
Filter Inserter
Posts: 623
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Expose historical data of LuaFlowStatistics

Post by Xorimuth »

This is implemented in 1.1.60 as the sample_index parameter to LuaFlowStatistics.get_flow_count.
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

User avatar
Wiwiweb
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat May 08, 2021 2:36 am
Contact:

Re: Expose historical data of LuaFlowStatistics

Post by Wiwiweb »

I released a new version of Milestones which uses this new parameter and it now works very well when added to existing games :D

Estimations before.
Estimations after.

Thanks Xorimuth!

Post Reply

Return to “Implemented mod requests”