Expose historical data of LuaFlowStatistics
Expose historical data of LuaFlowStatistics
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!
- NotRexButCaesar
- Smart Inserter
- Posts: 1133
- Joined: Sun Feb 16, 2020 12:47 am
- Contact:
Re: Expose historical data of LuaFlowStatistics
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!
Re: Expose historical data of LuaFlowStatistics
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
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
Re: Expose historical data of LuaFlowStatistics
Bump. Having milestones work retroactively with greater precision would be awesome!
Don't forget, you're here forever.
Re: Expose historical data of LuaFlowStatistics
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”.
Re: Expose historical data of LuaFlowStatistics
Bump. Also would love to see the functionality of this mod be better!
Re: Expose historical data of LuaFlowStatistics
This is implemented in 1.1.60 as the sample_index parameter to LuaFlowStatistics.get_flow_count.
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: Expose historical data of LuaFlowStatistics
I released a new version of Milestones which uses this new parameter and it now works very well when added to existing games
Estimations before.
Estimations after.
Thanks Xorimuth!
Estimations before.
Estimations after.
Thanks Xorimuth!