To make the number next to the product

This is the place to request new mods or give ideas about what could be done.
Post Reply
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

To make the number next to the product

Post by Airat9000 »

To make the number next to the product mod. That there are many factories that produce the goods that would not think you have the goods or not.


Сделать количество рядом в с изделием, мод. Который бы показывал сколько есть заводов что производят товар, что бы не думать есть товар или нет.
2017-11-17_12-02-05.png
2017-11-17_12-02-05.png (727.63 KiB) Viewed 1964 times

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: To make the number next to the product

Post by bobingabout »

There may be a way to add a number... it depends what you want the number for? What should the number be telling you?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: To make the number next to the product

Post by darkfrei »

bobingabout wrote:There may be a way to add a number... it depends what you want the number for? What should the number be telling you?
How many assemblers make this recipe/item.
Or press "P".

Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: To make the number next to the product

Post by Airat9000 »

bobingabout wrote:There may be a way to add a number... it depends what you want the number for? What should the number be telling you?
I meant how many plants are already producing goods

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: To make the number next to the product

Post by bobingabout »

How many entities already exist with this recipe set?

I'm not sure there's an easy way to do this, because of the limited (zero) access to base game GUIs.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: To make the number next to the product

Post by darkfrei »

bobingabout wrote:How many entities already exist with this recipe set?

I'm not sure there's an easy way to do this, because of the limited (zero) access to base game GUIs.
It's not so difficult. http://lua-api.factorio.com/latest/LuaE ... ity.recipe

on_init find all assemblers, add them into global.assemblers.
on_built_entity or on_robot_built_entity add them to global.assemblers too.

All this events are fast (except one on_init - surface.find_entities_filtered, but wea are need at only once).
Then on press custom GUI "refresh" it can makes a table with all recipes what we have (not furnace-recipes, it can be changed by-the-way). If we have global.assemblers, then it don't needs a lot of time. All this recipes are saved to global.recipes_with_count now.
The global.recipes_with_count looks like

Code: Select all

-- local recipe_with_count = global.recipes_with_count[i]
recipe_with_count = {name = recipe_name, count = count, icons = icons, results = results}
Then we can to make the table global.results_with_count. Now we can make the new GUI window with items/fluids and count of them (it isn't production-value, but the table with results from assemblers).

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: To make the number next to the product

Post by bobingabout »

You listed the easy part... how do you do the hard part of actually putting a number on the recipe crafting GUI?

There's no way to edit this GUI directly, no way to probe it to see what page you're looking at, how far you've scrolled it, and if the recipes are even in the order and position you expect them to be.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: To make the number next to the product

Post by darkfrei »

bobingabout wrote:You listed the easy part... how do you do the hard part of actually putting a number on the recipe crafting GUI?

There's no way to edit this GUI directly, no way to probe it to see what page you're looking at, how far you've scrolled it, and if the recipes are even in the order and position you expect them to be.
It can be your own GUI, that will be updated by click on "refresh" button. Minimize it when you don't need it.

Post Reply

Return to “Ideas and Requests For Mods”