Jump to content




Textutils:166: Cannot Serialize Type Function


  • You cannot reply to this topic
10 replies to this topic

#1 campicus

  • Members
  • 164 posts

Posted 31 July 2013 - 07:29 AM

I am trying to make my turtle send its coordinates via rednet but I get the above error. Any ideas?

Spoiler


#2 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 31 July 2013 - 07:35 AM

t[6] = tStatus
is the problem. Should be
t[6] = status
(tStatus is a function)

#3 campicus

  • Members
  • 164 posts

Posted 31 July 2013 - 07:38 AM

Ah man, I had tStatus as both a var and function, which I thought I had fixed all instances but apparently not. You're actually a legend, thanks mate!

#4 jesusthekiller

  • Banned
  • 562 posts
  • LocationWrocław, Poland

Posted 31 July 2013 - 08:01 AM

-snip, nvm-

#5 campicus

  • Members
  • 164 posts

Posted 31 July 2013 - 08:11 AM

Ok, more issues, now on the receiving side. I'm not really sure what I am doing, don't hate the noob!

I have:

rednet.open("right")

while true do
local id, message = rednet.receive()
local t = textutils.unserialize(message)
print("Pos: "..t[1]..","..t[2]..","..t[3])
end


#6 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 31 July 2013 - 08:13 AM

View Postcampicus, on 31 July 2013 - 08:11 AM, said:

rednet.open("right")

while true do
local id, message = rednet.receive()
local t = textutils.unserialize(message)
print("Pos: "..t[1]..","..t[2]..","..t[3])
end
And what's the error? concat string and nil?

#7 campicus

  • Members
  • 164 posts

Posted 31 July 2013 - 08:17 AM

Yes sorry

#8 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 31 July 2013 - 08:22 AM

Version of ComputerCraft?

EDIT: Nevermind, the problem is in the sender: you serialize the table and put it into "message", then you send "msg", not "message".

#9 campicus

  • Members
  • 164 posts

Posted 31 July 2013 - 08:26 AM

Thanks again! I will get there eventually I swear (haha)

#10 GamerNebulae

  • Members
  • 216 posts
  • LocationNetherlands

Posted 01 August 2013 - 04:43 AM

View Postcampicus, on 31 July 2013 - 08:26 AM, said:

Thanks again! I will get there eventually I swear (haha)

I said that once with an API I tried making, but I gave up, because it got so cluttered and had over 800 lines xD

#11 campicus

  • Members
  • 164 posts

Posted 01 August 2013 - 04:46 AM

Every mistake I make is one that I am less likely to repeat :P That's what I keep telling myself... lol





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users