Page 1 of 1

[2.0.23] what is a real wire connection?

Posted: Mon Dec 02, 2024 6:22 pm
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.

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

Posted: Tue Dec 03, 2024 2:59 am
by curiosity
Non-real wire meaning ghost seems obvious to me, but are you sure about simulations? Why would they be special there?

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

Posted: Tue Dec 03, 2024 10:28 am
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.

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

Posted: Tue Dec 03, 2024 10:58 am
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.

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

Posted: Tue Dec 03, 2024 11:10 am
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")?