Jump to content




[1.8.9][SSP] disk.getID() on pocket and computer return nil


5 replies to this topic

#1 skypop

  • Members
  • 3 posts

Posted 16 October 2016 - 12:01 AM

VERSION:
minecraft 1.8.9
computercraft 1.79

DESCRIPTION:
When a computer or pocket-computer is inserted in disk drive, disk.getID(string side) return nil.
Same thing, when wrapping disk drive, function getDiskID() return nil.

By way of comparison disk.getLabel(string side) and getDiskLabel() works perfectly.

EXPECTED RESULT:
Gets the unique ID number.

REPRODUCTION STEPS:
Place a computer and disk drive. Insert a pocket computer (with or whitout label, files...)
Run lua :
testID = disk.getID("right")
print(tostring(testID)) -- nil
print(type(testID)) -- nil

_drive = peripheral.wrap("right")
testID = _drive.getDiskID("right")
print(tostring(testID)) -- nil
print(type(testID)) -- nil

Edited by skypop, 16 October 2016 - 12:12 AM.


#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 16 October 2016 - 01:52 AM

This is not a bug, this is intended behavior. The wiki page even states:

Quote

Returns number the disk ID, or nil if the drive does not contain a Floppy Disk

In addition, the disk ID is completely seperate from computer IDs. You can have a disk of id 0 and a computer of id 0, which would be confusing for any program using the ID.

#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 16 October 2016 - 03:55 AM

Though, the wiki is more an unofficial recording of "how ComputerCraft works", as opposed to "Dan's official word on how ComputerCraft should work". I've no idea what his intentions were here.

#4 skypop

  • Members
  • 3 posts

Posted 16 October 2016 - 08:24 AM

View PostKingofGamesYami, on 16 October 2016 - 01:52 AM, said:

This is not a bug, this is intended behavior. The wiki page even states:

The wiki detail the same thing about labels while disk.getLabel() and getDiskLabel() works.

Quote

string disk label, or nil if the item in the drive is neither a floppy disk nor a music record or if it is a floppy disk with no label


#5 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 16 October 2016 - 11:42 AM

That may be, but I would still not consider this a bug simply because a disk id is separate from a computer id. It would be confusing if multiple items could return the same value for what is supposedly a unique and unreplicable identifier.

#6 skypop

  • Members
  • 3 posts

Posted 16 October 2016 - 10:46 PM

That may not be a bug, but in my humble opinion this is a mistake.
In the present state multiple items return the same value (nil), it confusing computers, turtles and pocket computers...
I think this feature has been forgotten during the1.6 and 1.77 updates.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users