Page 1 of 1

Setting Circuit connections for a new entity

Posted: Fri Mar 21, 2025 8:39 pm
by Fortheking55
Hello follow modders!

In my mod, I delete an existing entity (in this case turrets) and replace it with a "copy" of itself, but just as an upgraded version. I have found where I can copy over the control behaviors from the old entity to the new entity but have not found a way to set the same circuit connections as the old entity had. Any suggestions?

Thanks!

Re: Setting Circuit connections for a new entity

Posted: Fri Mar 21, 2025 10:05 pm
by robot256
Simple. Use https://lua-api.factorio.com/latest/cla ... _connector and https://lua-api.factorio.com/latest/cla ... onnections to identify which wire connectors belonging to other entities are connected to your entity with each type of wire. Then use https://lua-api.factorio.com/latest/cla ... connect_to to reproduce the connections when the new entity is built.

Re: Setting Circuit connections for a new entity

Posted: Sat Mar 22, 2025 4:09 am
by Fortheking55
Wow it was pretty simple! I guess I need to learn how to better read the documentation.. I kept looking for "circuit" or "network" and was getting no where. Thank you so much!