Page 2 of 2

Re: Event for wire connected/disconnected to entity

Posted: Wed Apr 16, 2025 10:11 am
by Osmo
I'm making a mod that needs to know when power poles are connected/disconnected and this would be really helpful.
I don't even know how to approach this considering pasting blueprints can also create wires.

Re: Event for wire connected/disconnected to entity

Posted: Sat May 31, 2025 11:43 pm
by protocol_1903
There's been a large number of these type of requests over the years (i count 10+) was there any resolution to this? Perhaps it could be called naturally after `on_built` events, and if mods add/modify circuit connections it could have an option to `raise_connected` just like how `surface.create_entity` has `raise_built`?

Re: Event for wire connected/disconnected to entity

Posted: Sun Jun 01, 2025 7:01 pm
by sparr
The devs have explicitly rejected this and related ideas a few times on the forums and on Discord.

We just have to keep hoping they eventually change their minds. Maybe posting more use cases will help, as folks think up mods that could be done with this and can't reasonably be done without it.

Re: Event for wire connected/disconnected to entity

Posted: Mon Jun 02, 2025 1:17 am
by protocol_1903
In that case, I'm making a mod to apply a different set of default settings for machines, which can be either entity settings or circuit settings. The plan is to have circuit settings only apply when a wire is connected, but as of right now that's not possible. So it's either some hacky way to get that 'event' or apply the circuit settings when the entity is constructed, which just exaggerates the problem by having custom circuit settings on every entity (including common ones like belts, assemblers, inserters...) which I believe uses a lot more data than 'unmodified' entities. This not has been tested however, and I would love to be proven wrong here.