[2.0.23] what is a real wire connection?

Place to report issues and suggest improvements to the API documentation.
Quezler
Long Handed Inserter
Long Handed Inserter
Posts: 75
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

[2.0.23] what is a real wire connection?

Post by Quezler »

https://lua-api.factorio.com/latest/cla ... ector.html

Code: Select all

connections :: Read array[WireConnection]  

All wire connectors this connector is connected to.

Code: Select all

real_connections :: Read array[WireConnection]  

All wire connectors this connector is connected to with real wires.
At first glance this confused me, what is a "real" wire?
- is it not real if either entity has draw_circuit_wires enabled? you don't see a "real" wire
- is it not real if it goes to another surface? since you do not see that either
- is it not real if the wire origin is script?
- is it not real if the wire origin is radar?

Turns out none of those things, real means its neither a ghost nor a simulation, but it took me some digging on the c++ side to confirm what a "real wire" was.

edit 1: only after typing this i realized that "connection_count" had a mention of "ghost and real" which gives a hint, but who looks at _count first anyways?
edit 2: since it is on the second line / after the period, you don't see the _count explanation on the top of the page either, and at that point you click the main.
curiosity
Filter Inserter
Filter Inserter
Posts: 483
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [2.0.23] what is a real wire connection?

Post by curiosity »

Non-real wire meaning ghost seems obvious to me, but are you sure about simulations? Why would they be special there?
Quezler
Long Handed Inserter
Long Handed Inserter
Posts: 75
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

Re: [2.0.23] what is a real wire connection?

Post by Quezler »

well a ghost is still very much a real ghost, without the comparison only the _count one has it was not immediately obvious to me.

and as for the simulation i just did a quick code search and simulation crossed my screen too for the generic isreal method, though for wires its probably safe to assume only the ghost state is relevant.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3090
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.23] what is a real wire connection?

Post by boskid »

Short explanation is:
- wire is "real" when entities at both ends are "real" (not ghost).

Real wires are causing real effects: propagating electric network or circuit network, carrying signals, electricity. Opposite case is ghost wires which are just visual (script will see them through lua api). It is possible to have real wire of player origin, ghost wire of player origin, real wire of script origin and ghost wire of script origin. Radars origin is only using real wires as then radar at any of ends turns into a ghost this triggers a rewiring to exclude a ghost radar from radar network so you should never see a ghost wires of radar origin.
curiosity
Filter Inserter
Filter Inserter
Posts: 483
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [2.0.23] what is a real wire connection?

Post by curiosity »

Quezler wrote: Tue Dec 03, 2024 10:28 am well a ghost is still very much a real ghost
What would you call them then (besides "non-ghost")?
Post Reply

Return to “Documentation Improvement Requests”