This is my first ever mod and I am trying to create a mod that adds furnaces that have built in requester and supplier chests. I have 4 furnaces (an all in one smart furnace is planned) working. I am having trouble getting the chests to work. I don't think the requests are being put into the chests. Another weird thing that happens is under the expanded view (Alt) there is a tiny requester/supplier chest that shows up on the furnace depending on order in the code so I feel the chest is there just not how I want it to be there.
Any help or suggestions would be greatly appreciated. Thank you for your time.
https://github.com/Kane-Nexus/LogisticElectricFurnace
Code: Select all
function insertDummyItem(surface, chestName, chestPosition, chestForce, entityName)
local dummy = surface.create_entity({name = chestName, position = chestPosition, force = chestForce})
dummy.insert{name=chestName, count=1}
if chestName == "lef-requester-chest" then
if entityName == "logistic-electric-furnace-iron" then
dummy.set_request_slot({name = "iron-ore", count = lefRequestedIron}, 1)
elseif entityName == "logistic-electric-furnace-copper" then
dummy.set_request_slot({name = "copper-ore", count = lefRequestedCopper}, 1)
elseif entityName == "logistic-electric-furnace-steel" then
dummy.set_request_slot({name = "iron-ore", count = lefRequestedSteel}, 1)
elseif entityName == "logistic-electric-furnace-brick" then
dummy.set_request_slot({name = "stone", count = lefRequestedStone}, 1)
end
table.insert(created_requesters, dummy)
elseif chestName == "lef-passive-provider-chest" then
table.insert(created_providers, dummy)
end
if dummy then
game.raise_event(on_chest_created, {chest=dummy})
-- print({"Created ",table.getn(created_requesters)," furnace requester chests"})
-- print({"Created ",table.getn(created_providers)," furnace provider chests"})
end
end