`rednet.lookup` is returning nil (`chat` program has stopped working)
Cheatoid opened this issue ยท 5 comments
Minecraft Version
1.18.x
Version
1.100.2
Details
As the title says.
Simplest way to reproduce this issue is to make use of the chat
program.
Place down a computer with modem on side, access the terminal and enter chat host room
.
Place down another computer with modem on side, access the terminal and enter chat join room username
, and then here you will see the issue:
Looking up room... Failed.
I think I figured it out. It is because both computers have the identical metadata/ID, so it ends up failing during lookup... ๐
This is so silly. It is easy to get multiple computers with identical ID while in creative, simply destroy a computer after placing it, and then middle click it on hotbar.
Can you check the id of those two command computers (run id
program in shell)? In creative it's possible to place two computers with the same id, and that might cause problems like this.
I think I figured it out. It is because both computers have the identical metadata/ID, so it ends up failing during lookup... ๐ This is so silly. It is easy to get multiple computers with identical ID while in creative, simply destroy a computer after placing it, and then middle click it on hotbar.
It is working like that on purpose. Cause if computer sends message to itself (its own ID) it is just queued as event and it allows multiple programs on same computer to communicate over rednet without actually having any modems on the computer cause it is all in effect loopback communication.
CC-Tweaked/src/main/resources/data/computercraft/lua/rom/apis/rednet.lua
Lines 194 to 198 in cdf8b77
So if there are multiple computers with same ID they are unable to communicate with each other cause of said ID collision. Lucky it can't happen in normal game play.
Well this is strange. It does not work in this particular setup which I have here, not sure why.
I just tested it again by placing a new set of computers and it works fine.
Video demo: https://streamable.com/udq3zy