Adding automatic belt loaders into a furnace entity
Adding automatic belt loaders into a furnace entity
the title includes everything that i'm trying to do, i'm making a furnace that belts in and out without inserters for a mod i'm working on and i don't know where to start, can i make a second entity that can't be targeted that acts like a loader and gets placed invisibly with the furnace, or is there some way to make it part of the furnace's block of code. Thank you!
Re: Adding automatic belt loaders into a furnace entity
No.Whovian44 wrote: Wed Sep 02, 2020 7:22 amis there some way to make it part of the furnace's block of code.
Yes.Whovian44 wrote: Wed Sep 02, 2020 7:22 amcan i make a second entity that can't be targeted that acts like a loader and gets placed invisibly with the furnace
To make an entity invisible, in data.lua set all of its sprites to
Code: Select all
{
filename = "__core__/graphics/empty.png",
width = 1,
height = 1,
}
Code: Select all
function on_built(event) {
local entity = event.created_entity or event.entity or event.destination
if not entity or not entity.valid then return end
if entity.name == "my-furnace" then
-- Place the second entity
end
}
script.on_event(defines.events.on_built_entity, on_built)
script.on_event(defines.events.on_robot_built_entity, on_built)
script.on_event(defines.events.script_raised_built, on_built)
script.on_event(defines.events.script_raised_revive, on_built)
script.on_event(defines.events.on_entity_cloned, on_built)
Re: Adding automatic belt loaders into a furnace entity
Like this one? https://mods.factorio.com/mod/Loader-FurnaceWhovian44 wrote: Wed Sep 02, 2020 7:22 am the title includes everything that i'm trying to do, i'm making a furnace that belts in and out without inserters for a mod i'm working on and i don't know where to start, can i make a second entity that can't be targeted that acts like a loader and gets placed invisibly with the furnace, or is there some way to make it part of the furnace's block of code. Thank you!
But you can probably to go the way of miniloaders: https://mods.factorio.com/mod/miniloader
It's not a loader, but hidden inserters in this entity.