Request: WireConnectionPoint from LuaEntityPrototype

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
paybara
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Apr 29, 2023 5:18 am
Contact:

Request: WireConnectionPoint from LuaEntityPrototype

Post by paybara »

Context:
I've written a Belt Tracer mod that lets you trace a belt or a pipe through your factory, and I'd like to extend it to trace & highlight circuit networks as well.

I've figured out how to walk the circuit network with LuaEntity.circuit_connection_definitions but I'd like to display the traces touching the correct input/output points on each combinator.
I see that combinator prototypes have input_connection_points and output_connection_points, but I can't see any way to read them at runtime from LuaEntityPrototype.

If you can add a lookup to read the connection points at runtime (presumably a table with circuit_id and/or wire color as the key), that would be ideal.

I might hack in support for the main two combinators just by looking at the orientation, since I think every other vanilla entity can only be connected to the circuit network at most once, but I assume there are mods out there with more types of combinators.
And in general it would look nice to have the traces follow the wires instead of just going to the center of each entity.

repne-scasb
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 09, 2022 1:18 pm
Contact:

Re: Request: WireConnectionPoint from LuaEntityPrototype

Post by repne-scasb »

I would really like to have this! I think it would be a good idea to also add a shorthand method to LuaEntity to get the offset of a connection point for some wire + connector/wire_id for the current direction of the entity, also for electric-poles, which always report the same direction while wire connection points change.

Currently I hacked in support by reading the data in data-final-fixes.lua and transferring the info to the control stage via dummy items with modified descriptions xD Not ideal

Post Reply

Return to “Modding interface requests”