Please change first parameter of LuaLogisticNetwork.insert(item,members) to (accept?) a SimpleItemStack
Posted: Thu Sep 13, 2018 10:13 pm
Please change first parameter of LuaLogisticNetwork.insert(item,members) to (accept?) a SimpleItemStack
It is currently possible to:
But it is not possible to do the opposite:
I asked how I could (efficiently) do what I wanted, and this was suggested:
It is currently possible to:
Code: Select all
local function delete_10_iron_plate_from_logistic_network(logistic_network)
logistic_network.remove_item({ name="iron-plate", count=10 })
end
Code: Select all
local function add_10_iron_plate_to_logistic_network(logistic_network)
logistic_network.insert({ name="iron-plate", count=10 })
end
DaveMcW wrote: Thu Sep 13, 2018 2:28 pm An easier way is:
1. chest = surface.create_entity{name = "steel-chest"}
2. chest.insert{SimpleItemStack}
3. logistic_network.insert(chest.get_inventory(1)[1])
4. chest.destroy()
Allowing SimpleItemStack in LuaLogisticNetwork.insert() sounds like a good idea for Modding interface requests.