This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Jack_windham's profile picture

rednet.broadcast/rednet height bug

Started by Jack_windham, 26 April 2014 - 09:07 PM
Jack_windham #1
Posted 26 April 2014 - 11:07 PM
i have 3 computers(no protocals were used)
i created a whole new world to test this
i placed the first computer at y lvl 20
added a rednet modem on the right
started up lua and typed "rednet.open("right")" into the command line and hit enter
the ring on the modem turned on
then i placed another computer at y lvl 100 and did the same thing
then i placed another computer at y lvl 180 and did the same thing
then i typed rednet.receive() into both at y lvl 100 and 180
then on the one at y level 20 i typed "rednet.broadcast("AE")
only the computer at y lvl received the message and printed "n, AE"
the one at y level stayed at rednet.receive()

ill provide a pics if needed
Jack_windham #2
Posted 27 April 2014 - 11:48 AM
(i created a new world just to be safe) i placed a computer at y level 20 and opened a rednet modem on the right. then i did the same thing for a computer at y lvl 100 and 180. then i typed rednet.receive() into the command line for the computers at y lvl 100 and 180 then did a rednet broadcast from y lvl 20 and only the one at y lvl 180 received the message, the one at y lvl 100 stayed in rednet.receive mode. I'm on cc 1.63 and forge 9.11.1.965. pls. help, this completely breaks my build. :)/>
Lyqyd #3
Posted 27 April 2014 - 05:40 PM
Not a bug, assuming the one that received the message was at 180 and the one that didn't was at 100. You didn't specify. Edit: your duplicate post specified that I was right, so I've included it here.

Moved to Ask a Pro.
Bomb Bloke #4
Posted 28 April 2014 - 01:44 AM
To elaborate on what Lyqyd's getting at, every block higher you place a computer adds more than one block to its effective wireless range. When determining whether two computers can send or receive to or from each other, only the height of the higher system is taken into account. This means that the system at y180 can be in range of the system at y20, even if the system at y100 is not.

While unintuitive, this is intended behaviour. You should be able to work around it by sticking a computer up at y255 (or whatever the building height limit is) and running the (as of CC 1.6) built-in "repeat" script on it - all three of your other computers should be able to communicate with each other once that's set up.
Lyqyd #5
Posted 28 April 2014 - 02:01 AM
For reference, the range formula is:


minRange + (position.yCoord - 96.0) * ((maxRange - minRange) / ((world.getHeight() - 1) - 96.0))