376 posts
Location
[string "FindMe"]:23143: bad argument #1 to 'returnPos' (vector expected, got nil)
Posted 05 January 2015 - 05:16 AM
Im rewriting the rednet api and im confused on how rednet handles protocols. There is no protocol found in modem.transmit for me so im a little confused
8543 posts
Posted 05 January 2015 - 05:23 AM
It goes in the packet structure rednet uses, under the key "sProtocol". Take a look through the rednet API code and you should see how it's used.
7083 posts
Location
Tasmania (AU)
Posted 05 January 2015 - 06:16 AM
As a basic outline, rednet.send takes your message, the protocol, and one or two other bits of info, and bungs them in a table. That table then gets sent via modem.transmit, and the receiving computer repackages it as a rednet event at the other end (within rednet.run, which runs in parallel with the shell on all systems whether you ask for it or not - including those which don't have modems connected at all).
Prior to CC 1.6, there's no table encapsulation - the message just gets modem.transmit'd more or less as-is, and rednet.run thus has a slightly more simplistic job.
376 posts
Location
[string "FindMe"]:23143: bad argument #1 to 'returnPos' (vector expected, got nil)
Posted 05 January 2015 - 06:30 AM
Alright, so as I interpreted, it sends a table? Thank you! That helps me a lot