Page 1 of 1

Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 1:25 pm
by MineGame159
I am creating infinite chest and I dont want to get items that are in chest when destroyed. I am using defines.events.on_player_mined_entity but that buffer inventory only contains chest itself and I cannot clear items that was in chest.

Re: Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 1:45 pm
by DaveMcW

Re: Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 1:47 pm
by darkfrei

Re: Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 1:54 pm
by MineGame159
Thanks, but its strange that buffer does not contain items from inventory

Re: Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 3:13 pm
by darkfrei

Re: Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 3:39 pm
by MineGame159
darkfrei wrote:
MineGame159 wrote:Thanks, but its strange that buffer does not contain items from inventory
And
https://lua-api.factorio.com/latest/Con ... nityFilter
https://lua-api.factorio.com/latest/Lua ... ity_filter
https://lua-api.factorio.com/latest/Lua ... ty_filters
What there are infinity filters?

Re: Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 3:55 pm
by MineGame159
darkfrei wrote:
MineGame159 wrote:Thanks, but its strange that buffer does not contain items from inventory
And
https://lua-api.factorio.com/latest/Con ... nityFilter
https://lua-api.factorio.com/latest/Lua ... ity_filter
https://lua-api.factorio.com/latest/Lua ... ty_filters
Whooohoo. I had it working fine with lot of events but thats a lot easier thanks.

Re: Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 7:07 pm
by darkfrei
MineGame159 wrote:Whooohoo. I had it working fine with lot of events but thats a lot easier thanks.
Can you show some examples?

Re: Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 8:08 pm
by MineGame159
darkfrei wrote:
MineGame159 wrote:Whooohoo. I had it working fine with lot of events but thats a lot easier thanks.
Can you show some examples?
Code? Or finished chest? For code i just grabbed steel-chest prototype modified picture and added one property to it.

Edit: ohh you meant my old code. I will try to get it back because i deleted it but maybe

Re: Dont return inventory contents when destroyed

Posted: Tue Sep 04, 2018 8:27 pm
by Rseding91
Have you looked at the "infinity-container" entity type? It's a chest that can spawn infinite items and you can set it to not give items back when mined via a setting in the prototype.

Re: Dont return inventory contents when destroyed

Posted: Wed Sep 05, 2018 5:02 am
by MineGame159
Rseding91 wrote:Have you looked at the "infinity-container" entity type? It's a chest that can spawn infinite items and you can set it to not give items back when mined via a setting in the prototype.
Yeah darkfrei mentioned it