I have a friend who streams and does videos for youtube and he wanted to be able to pull some production stats and power stats into OBS. If I could access them it would be as simple as moving those values to a text file he could parse. However we currently have no hooks into that information.
My suggestion is that since you are already calculating all the data and naturally storing it somewhere in the memory, is to add hooks for modders to be able to pull data from the production and electric network screens.
Hooks for gui values
-
- Burner Inserter
- Posts: 10
- Joined: Thu Nov 03, 2016 4:58 am
- Contact:
Re: Hooks for gui values
You can write a small mod (or even include it into the control.lua of the savefile) that periodically gathers the information you're looking for and writes it to an external file with LuaGameScript.write_file, which you then can parse with an external tool.
-
- Burner Inserter
- Posts: 10
- Joined: Thu Nov 03, 2016 4:58 am
- Contact:
Re: Hooks for gui values
This is what I would like to do. However currently to my knowledge there are no ways to grab the power usage or to grab production values. That is the issue.
Re: Hooks for gui values
For production values use http://lua-api.factorio.com/latest/LuaF ... stics.htmlHopewelljnj wrote:This is what I would like to do. However currently to my knowledge there are no ways to grab the power usage or to grab production values. That is the issue.
Example that shows the production values (the same as in the [P] Production window - tab All) for eg. iron plate:
Code: Select all
/c game.player.print(game.player.force.item_production_statistics.get_input_count("iron-plate"))
LuaForce also has values for fluid consumption, resources, entity build counts and kill counts.
I don't think there currently is an easy way to read power usage statistics using lua, you might ask in the Modding help or Modding interface requests forums.
-
- Burner Inserter
- Posts: 10
- Joined: Thu Nov 03, 2016 4:58 am
- Contact:
Re: Hooks for gui values
Thanks.
Re: Hooks for gui values
Moved from suggestions to modding help
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...