Sharparam / cybersyn-combinator

Factorio mod adding a specialized combinator for the Project Cybersyn mod
https://mods.factorio.com/mod/cybersyn-combinator
Mozilla Public License 2.0
3 stars 4 forks source link

Disable on copy / blueprinting #33

Open DanielFabian opened 8 months ago

DanielFabian commented 8 months ago

Description

Could we please clone one feature from the LTN combinator (can be an option if you think it's undesirable in some cases)? That is when you copy or blueprint the combinator have it be disabled.

Context

Otherwise the moment you copied it (that's especially problematic for a requester), it sends a train and quite frequently you might want to change the request before requesting a train.

In the case where you wanted a train immediately, it's as easy at turning the combinator on. In the case where you didn't you now have to deal with a train full of items you didn't want.

LTN combinator does this and it seems like a really useful thing to do the CS combinator, too.

I believe being able to copy a station without it immediately requesting a train would be quite useful to others, too, since polluting a sub-factory is never desirable.

Implementation

Whenever you copy the combinator / create a blueprint, set the enabled flag to false. Not sure exactly how this is done, but it's definitely been implemented before. If you want me to, I can investigate exactly how it's implemented.

Sharparam commented 8 months ago

I've looked at the API a bit and I'm not sure if there's a way to detect specifically if an entity is placed by using copy/paste or blueprint. In both cases that will trigger a "built by robots" event.

There is an option currently to "disable newly built combinators", although that will also disable them if you place them manually from your inventory. (This option can be found under per-player settings, there is also a map setting to disable combinators that are built by robots that can't be associated with a player, although not sure under what exact circumstances that happens).

Perhaps an option that will "disable combinators if built by robots"?