Page 1 of 1

[2.0.6] Global LuaForce get_*_statistics

Posted: Sat Oct 19, 2024 7:48 am
by BurninSun
LuaForce had attributes changed to methods for get_item_production_statistics, get_fluid_production_statics, get_kill_count_statistics, and get_entity_build_count_statistics so that they now take a surface as a parameter and return relevant LuaFlowStatistics for that surface only.

I'm requesting that the `surface` parameter for all 4 of these methods becomes optional and without it, a global LuaFlowStatistics object be returned. This would be similar to the production screen UI with its checkbox to enable "Global statistics".

Re: [2.0.6] Global LuaForce get_*_statistics

Posted: Sat Oct 19, 2024 8:15 am
by Stringweasel
+1 would be useful for Better Victory Screen which has to keep track of many things. And having to add it all in Lua will be a little slower.

Re: [2.0.6] Global LuaForce get_*_statistics

Posted: Sat Oct 19, 2024 3:33 pm
by Wiwiweb
+1 would be useful for Milestones

Re: [2.0.6] Global LuaForce get_*_statistics

Posted: Wed Nov 20, 2024 1:11 am
by Rseding91
Just FYI: there is no global statistics and the GUI simply goes over all of them and sums them together each frame it renders. That works fine for reading because "sum all" doesn't care if a given surface exists or not. But, it wouldn't work for the Lua API where you can also write/modify/add because it would either do nothing, error, or write to every surface in the game (that exists? or just the ones that have statistics at that point in time?)

So I'm going to say this is a won't-implement.