buffer inventory for script_raised_destroy

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
SWeini
Inserter
Inserter
Posts: 35
Joined: Mon Apr 04, 2022 6:43 am
Contact:

buffer inventory for script_raised_destroy

Post by SWeini »

I'd like to see a mechanism similar to on_player_mined_entity.buffer, but for script_raised_destroy.

Currently it's only possible to add additional items when an entity is mined by player or robot using the buffer inventory. However, when an entity is destroyed using scripts, the only possibility is to spill additional items on the ground and hope that this is compatible with the script destroying the entity.

Ideally a mod can add additional items into the buffer inventory when its entity was destroyed by another mod. The mod destroying that entity retrieves the additional items from the buffer and can do what is appropriate for it. For example when using destruction planners in the built-in editor those items would just be ignored. But the Nanobots mod would add them to the player inventory automatically.

See viewtopic.php?p=581750#p581750 for why I need it.

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

Re: buffer inventory for script_raised_destroy

Post by Rseding91 »

This feels too much like a modding "hack" than an actual modding feature. All of what you describe depends on event order and that another mod actually wants to get items from other mods before its event ran. That's a huge assumption. Destroying an entity is meant to *destroy* it; not spill the contents onto the ground. That already makes this feel incredibly weird.
If you want to get ahold of me I'm almost always on Discord.

SWeini
Inserter
Inserter
Posts: 35
Joined: Mon Apr 04, 2022 6:43 am
Contact:

Re: buffer inventory for script_raised_destroy

Post by SWeini »

I just looked at how Nanobots actually recovers entities and it looks like it calls LuaControl.mine_entity which does properly mine it and does NOT destroy the entity. This looks like the proper way for mods that simulate mining entities, so I guess my request is really nonsense. I'll change the mod to ignore script_raised_destroy.

Post Reply

Return to “Modding interface requests”