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!
Setting Circuit connections for a new entity
-
- Manual Inserter
- Posts: 2
- Joined: Fri Mar 21, 2025 8:13 pm
- Contact:
Re: Setting Circuit connections for a new entity
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.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
-
- Manual Inserter
- Posts: 2
- Joined: Fri Mar 21, 2025 8:13 pm
- Contact:
Re: Setting Circuit connections for a new entity
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!