Page 1 of 1

Event when singal of a constant combinator are changed

Posted: Fri Jun 17, 2022 12:08 pm
by kartikaybagla
I'm trying to update the status of other entities when a constant combinator is updated (without using wires/signals). I tried looking through the events section in the API docs but couldn't find anything specific for this.

Re: Event when singal of a constant combinator are changed

Posted: Fri Jun 17, 2022 3:35 pm
by FuryoftheStars
I know there used to be a mod that added new entities to wirelessly transmit circuit signals between them. Maybe if you can find that you might be able to see what they did?

Re: Event when singal of a constant combinator are changed

Posted: Fri Jun 17, 2022 6:03 pm
by DaveMcW
The event does not exist.

You can catch most changes with on_gui_closed.

But constant combinators can also be updated by copy/pasting (on_entity_settings_pasted) or stamping a blueprint (no relevant event).

Re: Event when singal of a constant combinator are changed

Posted: Thu Oct 27, 2022 8:50 pm
by mami
I am attempting to do the same thing here, catch when the settings of a custom combinator are changed. I'm currently catching when the settings are copy-pasted and when the gui to change them is accessed, but I cannot find a way to catch when the combinator is blueprinted over. Is there a way to disable allowing combinator settings to be copied by blueprint?

Honestly if there is no way to catch it and no way to disable it, I'm not sure what I should do to prevent players from accidentally breaking my mod thinking blueprints will work.

Re: Event when singal of a constant combinator are changed

Posted: Thu Oct 27, 2022 11:39 pm
by quyxkh
Haven't tried it but wouldn't watching player_cursor_stack_changed for the player switching away from a blueprint at least make checking whether the bp has constant combinators and if so rechecking every constant combinator on the map once a tolerable expense?

Re: Event when singal of a constant combinator are changed

Posted: Fri Oct 28, 2022 12:06 am
by DaveMcW
mami wrote:
Thu Oct 27, 2022 8:50 pm
way to disable it
entity.allow_copy_paste = false

https://wiki.factorio.com/Prototype/Ent ... copy_paste

Re: Event when singal of a constant combinator are changed

Posted: Fri Oct 28, 2022 1:50 am
by mami
I was skeptical if this worked with blueprints but looks like it does, thanks!

Re: Event when singal of a constant combinator are changed

Posted: Sat Nov 19, 2022 3:29 pm
by mami
I just attempted to use player_cursor_stack_changed, but if the player is using a blueprint from their blueprint library, it does not seem to show up. When watching the player_cursor_stack_changed, is there a way to determine if the player is holding a blueprint from their blueprint library?