Dont return inventory contents when destroyed

Place to get help with not working mods / modding interface.
Post Reply
MineGame159
Inserter
Inserter
Posts: 38
Joined: Sun Apr 16, 2017 1:54 pm
Contact:

Dont return inventory contents when destroyed

Post 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.



MineGame159
Inserter
Inserter
Posts: 38
Joined: Sun Apr 16, 2017 1:54 pm
Contact:

Re: Dont return inventory contents when destroyed

Post by MineGame159 »

Thanks, but its strange that buffer does not contain items from inventory


MineGame159
Inserter
Inserter
Posts: 38
Joined: Sun Apr 16, 2017 1:54 pm
Contact:

Re: Dont return inventory contents when destroyed

Post 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?

MineGame159
Inserter
Inserter
Posts: 38
Joined: Sun Apr 16, 2017 1:54 pm
Contact:

Re: Dont return inventory contents when destroyed

Post 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.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Dont return inventory contents when destroyed

Post 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?

MineGame159
Inserter
Inserter
Posts: 38
Joined: Sun Apr 16, 2017 1:54 pm
Contact:

Re: Dont return inventory contents when destroyed

Post 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

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Dont return inventory contents when destroyed

Post 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.
If you want to get ahold of me I'm almost always on Discord.

MineGame159
Inserter
Inserter
Posts: 38
Joined: Sun Apr 16, 2017 1:54 pm
Contact:

Re: Dont return inventory contents when destroyed

Post 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

Post Reply

Return to “Modding help”