Resource Siphon deprecated

by Yehn

Adds a building that siphons nearby resources, allowing for mining setups with very few entities. The siphon is available immediately, but requires a lot of power and produces a lot of pollution. Works with productivity research.

Content
4 years ago
0.17
6
Mining

g Error on deconstruction with bots

4 years ago

Hi,

I have installed the "Cursed Better Construction Robots" mod and now deconstructing with bots causes this error:

Error while running event ResourceSiphon::on_nth_tick(10)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
ResourceSiphon/control.lua:55: in function <ResourceSiphon/control.lua:41>
stack traceback:
[C]: in function 'index'
__ResourceSiphon
/control.lua:55: in function <ResourceSiphon/control.lua:41>

So maybe the problem is the other mod...

Since last time no any further problems - your mods works great.

Thanks in advance!

4 years ago
(updated 4 years ago)

Hey there,

So I can tell you what causes that error. My mod maintains a list of every siphon that's constructed - and removes the siphon from this list when deconstructed. This is necessary so it can run the part that siphons ore out of the ore patches and into the siphon.

Mods, when they add or remove an entity (like a siphon) have an option to not inform other mods about this.
My mod has this code: script.on_event({defines.events.on_entity_died, defines.events.on_player_mined_entity, defines.events.on_robot_mined_entity, defines.events.script_raised_destroy}, siphonremoved)

But it looks like that mod you use has chosen not to inform other mods when it removes an entity. And thus that error.

There's not much I can do about that. But you can contact the other mod's author and ask him/her to have his mod inform other mods when entities are destroyed/removed.

FWIW, that mod will break more than just resource siphon. For any mod that tracks when entities are removed - it's going to cause problems.

Lastly, this goes the other way too. If that mod doesn't raise an event when it builds something, this mod won't know there's a new siphon and that it needs to receive ore dust.

4 years ago

Hi,

thank you very much for your reply with the very detailed information!

Okay, I will ask the other author.

Thanks again!

New response