Call LuaLogisticNetwork.get_item_count() without item name

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
DARKHAWX
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu May 10, 2018 10:19 am
Contact:

Call LuaLogisticNetwork.get_item_count() without item name

Post by DARKHAWX »

I couldn't quite fit it all within the title but it would be nice to callLuaLogisticNetwork.get_item_count(item, member) withoutspecify an item name. Right now you must specify and item name, it's impossible to get a count of all items only in storage or only in providers. Solution would probably be to switch the order of the parameters and then have a third option for member being "all", or just allow us to pass through either nil or "" as the item parameter.

betrok
Fast Inserter
Fast Inserter
Posts: 101
Joined: Wed Feb 28, 2018 12:08 pm
Contact:

Re: Call LuaLogisticNetwork.get_item_count() without item name

Post by betrok »

I think it will be better to add an optional member argument for get_contents() instead.

DARKHAWX
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu May 10, 2018 10:19 am
Contact:

Re: Call LuaLogisticNetwork.get_item_count() without item name

Post by DARKHAWX »

betrok wrote:I think it will be better to add an optional member argument for get_contents() instead.
That is a better idea.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13171
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Call LuaLogisticNetwork.get_item_count() without item name

Post by Rseding91 »

What's the use case for this? Such a function would be very expensive to call because it's going to have to iterate over every storage entity in the network and count up every item they have.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding interface requests”