I know that the loaders are not meant to be used, but they are still there and I know that a lot of modders would be glad to use them.
I've tried something with some stuff to see the comparison between loaders and inserters and found that targeted entities set inserter to active state but not loaders, this mean that only the loader's input (transport-belt) can set it to actve state, but if that transport belt is full, nothing could happens unless you refresh it.
[0.13.4] Input loaders are not set back to active state
- y.petremann
- Filter Inserter
- Posts: 421
- Joined: Mon Mar 17, 2014 4:24 pm
- Contact:
Re: [0.13.4] Input loaders are not set back to active state
It's not in the base game for a reason - it's not fully implemented.
If you want to get ahold of me I'm almost always on Discord.
- y.petremann
- Filter Inserter
- Posts: 421
- Joined: Mon Mar 17, 2014 4:24 pm
- Contact:
Re: [0.13.4] Input loaders are not set back to active state
I think that right that it's not fully implemented, but it's here and I think that some modders would use it, look at some mods like slipstream chest for example ...Rseding91 wrote:It's not in the base game for a reason - it's not fully implemented.
For now this is the only thing I found that make it working improperly for general cases.
-
- Manual Inserter
- Posts: 2
- Joined: Thu Jun 16, 2016 3:35 pm
- Contact:
Re: [0.13.4] Input loaders are not set back to active state
I added the following control.lua to the loaders mod. It deactivates and activates them every now and then. This solves the problem that loaders stay deactivated even when they have work to do.
I'm no LUA expert, but it did the trick for me and did not influence script update time in a significant way.
greets
Code: Select all
script.on_init(function()
if global.tickTable == nil then
global.tickTable = { }
global.loaderCount = 0
global.removedIndex = -1
end
end)
script.on_load(function()
if global.tickTable == nil then
global.tickTable = { }
global.loaderCount = 0
end
end)
script.on_event(defines.events.on_built_entity, function(event) onBuild(event.created_entity) end)
script.on_event(defines.events.on_robot_built_entity, function(event) onBuild(event.created_entity) end)
script.on_event(defines.events.on_tick, function(event) onTick(event.tick) end)
function onBuild(entity)
if entity.name == "loader" or entity.name == "fast-loader" or entity.name == "express-loader" then
if global.removedIndex ~= -1 then
loaders = global.tickTable[removedIndex]
loaders[getEntityId(entity)] = entity
global.removedIndex = -1
else
global.loaderCount = global.loaderCount + 1
index = global.loaderCount % 240
if global.tickTable[index] == nil then
global.tickTable[index] = {}
end
global.tickTable[index][getEntityId(entity)] = entity
end
end
end
function onTick(tick)
index = tick % 240
local loaders = global.tickTable[index]
if loaders == nil then return end
for i,v in pairs(loaders) do
if v and v.valid then
v.active = false
v.active = true
else
loaders[i] = nil
removedIndex = index
end
end
global.tickTable[index] = loaders
end
function getEntityId(entity)
return "lldr:" .. entity.position.x .. "---" .. entity.position.y
end
greets
Re: [0.13.4] Input loaders are not set back to active state
Hi, we have decided to fix and support loader entity after all, even thought we don't plan to use it in vanilla for now.
Thanks for the report,
this will be fixed in 0.13.14
Thanks for the report,
this will be fixed in 0.13.14
Re: [0.13.4] Input loaders are not set back to active state
Yes yes yes thanks!