Page 1 of 1

.neighbours on ghost electric poles

Posted: Mon Jan 31, 2022 2:52 pm
by lyvgbfh
Currently, electric pole ghosts are listed as neighbours of regular poles, however I cannot ask them for their own neighbours, so recursively iterating electric networks by connection needs several type checks not to crash. Is this something that can be resolved relatively easily?

Re: .neighbours on ghost electric poles

Posted: Mon Jan 31, 2022 5:24 pm
by curiosity
Note that electric networks don't propagate through ghosts, so it doesn't make sense for you to visit them either way. To be clear, I'm all for this request, but your logic looks flawed.

Re: .neighbours on ghost electric poles

Posted: Mon Jan 31, 2022 7:42 pm
by lyvgbfh
curiosity wrote:
Mon Jan 31, 2022 5:24 pm
Note that electric networks don't propagate through ghosts, so it doesn't make sense for you to visit them either way. To be clear, I'm all for this request, but your logic looks flawed.
Good point, I think my wording could have been improved. In my case it would be more traversing copper cable networks, instead of electric networks.

Re: .neighbours on ghost electric poles

Posted: Tue Feb 22, 2022 10:57 am
by lyvgbfh
I hope bumping this is acceptable - it seems this behavior may not be intended, since I can connect_neighbour & disconnect_neighbour on ghost poles, but not access their .neighbours.

Re: .neighbours on ghost electric poles

Posted: Wed Apr 20, 2022 11:27 am
by lyvgbfh
boskid wrote:
Wed Apr 20, 2022 9:51 am
Please do not reuse resolved bug reports for unrelated stuff. Also LuaEntity::belt_neighbours cannot be used on electric poles so your report is invalid.
Replying in the correct thread, this is in the same vein as the bug report the quote is from. I may be mistaken but the bugs seem quite similar - neighbours will return ghosts but the ghosts themselves do not return neighbours.

Re: .neighbours on ghost electric poles

Posted: Wed Apr 20, 2022 12:17 pm
by curiosity
If you think it's a bug, report it in the correct forum, not write to modding API requests.

Re: .neighbours on ghost electric poles

Posted: Thu Apr 21, 2022 8:50 am
by boskid
Unfortunately i am not going to implement this. Its not a simple "take inner entity of a ghost" because wires are stored differently by entity ghosts and there would be more issues to solve if this would be exposed (for example it would expose circuit wires that go from ghost poles to a real entities while real entities do not report those circuit wires). It will be possible to get wires of a ghost in 1.2 as it is already implemented here, but it wont be under LuaEntity::neighbours read but something else instead.

Re: .neighbours on ghost electric poles

Posted: Thu Apr 21, 2022 3:23 pm
by lyvgbfh
Fair enough, I appreciate the clarification.

Re: .neighbours on ghost electric poles

Posted: Sat Jul 30, 2022 9:06 pm
by azaghal
Apologies for possibly hijacking this thread, but I ran into somewhat similar issue, but this time around with the ghost underground belts. If you feel this would be better off discussed in separate thread, please do let me know.

Trying to invoke .neighbours on a pair of "connected" ghost underground belts results in the "Neiughbours can't be used on this entity" error. Invoking the same property on constructed underground belt works as expected (so, you can try to manipulate the other end of the underground belt).

Invoking .belt_neighbours on a ghost underground does not result in an error, but it also does not provide any kind of inputs/outputs entities either - it only returns something if ghost underground belt is connected to a ghost/non-ghost regular belt.

Is this the intended behaviour for underground belts similar to ghost electric poles? And if so - will there be some way to access the ghost underground belt neighbours in version 1.2?