Page 1 of 1

Disable user from changing inserter filter

Posted: Fri Sep 28, 2018 5:11 am
by davidjs
For my mod i want an inserter that does not require power but can only be used for a specific resource.
I have solved the power issue by making it a burner and automatically filling its burner inventory with 1 gazillion Joule when placed.
However, i don`t want the player to be able to abuse the inserter for any item.


So, Is there anyway i can enforce the filter on the inserter?

Re: Disable user from changing inserter filter

Posted: Fri Sep 28, 2018 5:27 am
by eradicator
You can set it to LuaEntity.operable = false on creation, preventing the player from opening the GUI. You also have to remove the fast-replaceable group to prevent blueprints from setting a filter on it (hopefully that it sufficient :p).

Re: Disable user from changing inserter filter

Posted: Fri Sep 28, 2018 5:36 am
by davidjs
I just managed to do a quick " on_gui_opened => player.opened=nil"
But yeah "operable = false" makes a lot more sense x)

Totally forgot about the blueprints... Nice catch!