Is it possible to limit (new, modded) inserters/bots to certain items/categorys ?
I did not find anything that will look like a payload category, only think is payload-size, but i think its more of numer of items to carry
limit inserters / bots to certain items
Re: limit inserters / bots to certain items
For inserters there are filter inserters. You can set the filter from lua and hide the gui so users can't change it.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: limit inserters / bots to certain items
Inserter filters are hard-limited to a maximum of 5 filters though. So if you need more there's not any good solution. For bots there is no possibility at all.
Re: limit inserters / bots to certain items
That were a way to go.....mrvn wrote:For inserters there are filter inserters. You can set the filter from lua and hide the gui so users can't change it.
as i am not a very avid lua-user - do you have some guides or examples for such inserters
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: limit inserters / bots to certain items
For disallowing the gui of an entity you need something like:
[code]script.on_event(defines.events.on_gui_opened,function(e)
if e.entity and e.entity.name == 'myentity' then
game.players[e.player_index].opened = nil
end
end)[/code]
if e.entity and e.entity.name == 'myentity' then
game.players[e.player_index].opened = nil
end
end)[/code]
Code: Select all
script.on_event(defines.events.on_built_entity,function(e)
if e.created_entity.name == 'myentity' then
e.created_entity.operable = false
end
end)
Last edited by eradicator on Wed Mar 14, 2018 1:03 pm, edited 1 time in total.
Re: limit inserters / bots to certain items
GUI disabling is easy by data stage:
See https://mods.factorio.com/mods/darkfrei/RITEG
Or by control stage
http://lua-api.factorio.com/latest/LuaE ... y.operable
Code: Select all
enable_gui = false
Or by control stage
http://lua-api.factorio.com/latest/LuaE ... y.operable
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: limit inserters / bots to certain items
Oh right. Totally forgot about .operable. enable_gui is exclusive to the electric_energy_interface however and will have no effect on anything else. (Previous posts code has been updated)