The API definition for WireConnectionDefinition states that the field wire should be "either defines.wire_type.red or defines.wire_type.green." IE, not copper.
But also listed are two fields source_wire_id and target_wire_id, and it seems to be stated that these are to specify the type of copper wire connection.
If wire cannot be used, what are these fields supposed to do?
https://lua-api.factorio.com/latest/Con ... Definition
Why does WireConnectionDefinition have fields source_wire_id and target_wire_id?
-
- Long Handed Inserter
- Posts: 52
- Joined: Wed Apr 29, 2020 9:53 pm
- Contact:
Re: Why does WireConnectionDefinition have fields source_wire_id and target_wire_id?
This looks like an issue with documentation because in case of a copper wire you have to specify a wire value equal to `defines.wire_type.copper` to make parser to look for the `source_wire_id` and `target_wire_id` fields. When a wire is `defines.wire_type.red` or `defines.wire_type.green` it will look for `source_circuit_id` and `target_circuit_id` instead.
-
- Long Handed Inserter
- Posts: 52
- Joined: Wed Apr 29, 2020 9:53 pm
- Contact:
Re: Why does WireConnectionDefinition have fields source_wire_id and target_wire_id?
Indeed. For the dev's information, I came across this inconsistency when the following error was obtained during a .connect_neighbour() call in my scenario:
"Expected source_wire_id for entities with more than one wire connection."
The parameters for .connect_neighbour() were taken as exactly those four parameters obtained by a call of .circuit_connected_entities on another entity — yet this call claims to only spit out red or green wires, not copper. Which entities in particular I do not know, but something unexpected is afoot. (EDIT: I think they were ghost entities.)
"Expected source_wire_id for entities with more than one wire connection."
The parameters for .connect_neighbour() were taken as exactly those four parameters obtained by a call of .circuit_connected_entities on another entity — yet this call claims to only spit out red or green wires, not copper. Which entities in particular I do not know, but something unexpected is afoot. (EDIT: I think they were ghost entities.)