Page 1 of 1

How can I accurately know the number of items in a blueprint?

Posted: Mon Mar 14, 2022 5:59 pm
by WIZ4
Screenshot_3.jpg
Screenshot_3.jpg (77.66 KiB) Viewed 3563 times

Re: How can I accurately know the number of items in a blueprint?

Posted: Tue Mar 15, 2022 5:20 am
by danbopes
I personally like using this mod: https://mods.factorio.com/mod/LogisticRequestManager

You can drag the blueprint to the blueprint icon in the bar (Assuming it's in your inventory and not in game blueprints), and it will create requests for all the items. Then you can drill into the requests and see the exact amounts needed for each item.

Other than that, you'd need to find/make a mod specifically for this, or write your own lua code. Alternatively, you could always export the blueprint to a string, decode it to json, and count the number via a simple script

Re: How can I accurately know the number of items in a blueprint?

Posted: Tue Mar 15, 2022 6:28 am
by danbopes
It's not pretty, but I was bored, and created a simple lua function to do what you're asking:

Code: Select all

/c script.on_event(defines.events.on_gui_opened,function(event)
    if event.item == nil then return end
    if event.item.type ~= "blueprint" then return end
    
    for k, v in pairs(event.item.cost_to_build) do
        game.print("Item: " .. k .. ", Amount: " .. v)
    end
end)
Simply type this into the console (using the ` key), and then open your blueprint. You'll see each of the items output to the screen:
Image

Re: How can I accurately know the number of items in a blueprint?

Posted: Tue Mar 15, 2022 10:26 am
by WIZ4
It's enough. Thanks :)