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

[1.4] One turtle, four slots for peripherals

Started by squarepenguin, 02 September 2012 - 07:36 PM
squarepenguin #1
Posted 02 September 2012 - 09:36 PM
I would like to propose a single turtle that in its GUI has not only the 4x4 inventory but also four slots representing top, back, left and right peripherals.
this way, when more addons become available, they can intuitively added to any combination of other items. (there is currently no way to have a crafting turtle with a modem)

Some items can not be put in certain slots; tools can be only put in the 'left' and 'right' slot.
Other items can be put anywhere; modem, inventory(backpack);

With lua functions as turtle.use(side) the turtle can load an item from its inventory to a peripheral-slot customise itself, alowing for more versatility.

Bottom line: It makes turtles unified, more customisable and more versatile.


What do you think? Are there any problems with this proposal aside from possible difficult implementation? Do you agree or disagree? etc.
GopherAtl #2
Posted 03 September 2012 - 02:54 PM
Pretty sure the limit of 2 peripherals - one tool and one other - is deliberate, and not likely to be extended to 4. I also think it's unlikely they'll be changed to allow swapping perhipherals on an existing turtle. Given that, just displaying the peripherals in a non-interactive way in the gui seems a bit pointless.
Tahg #3
Posted 03 September 2012 - 10:18 PM
The limit of 2 peripherals surely is, as this data is stored in the auxiliary value of the ItemStack, and that is limited to two bytes. (Each peripheral takes a single byte for its id). However, I see no reason why they can't allow say, a crafty modem turtle in the future.
kamnxt #4
Posted 13 September 2012 - 10:00 PM
Maybe not 4 (top, right, left, and where would the last one be?), but swapping 3 or 2 peripherals would be nice.
immibis #5
Posted 14 September 2012 - 07:42 AM
They could hold a different type of upgrade, so you can't put a modem or pickaxe in them. Multiple slots would be ideal for simple upgrades like compasses.
Xfel #6
Posted 14 September 2012 - 10:22 AM
The limit of 2 peripherals surely is, as this data is stored in the auxiliary value of the ItemStack, and that is limited to two bytes. (Each peripheral takes a single byte for its id).
actually, it's 4 bytes avaiable. But I think the other two are use to store the computer id.
immibis #7
Posted 14 September 2012 - 10:45 AM
The limit of 2 peripherals surely is, as this data is stored in the auxiliary value of the ItemStack, and that is limited to two bytes. (Each peripheral takes a single byte for its id).
actually, it's 4 bytes avaiable. But I think the other two are use to store the computer id.

There's the 2-byte item ID (which is limited to a maximum of 31999), the 2-byte damage value and almost-unlimited NBT data.
There's only one item ID of course, which gives 2 bytes + as much as necessary.
The catch is that stackable items can't use NBT. If turtles were unstackable (which isn't as annoying as it sounds) you could attach many peripherals to one turtle.
Xfel #8
Posted 14 September 2012 - 10:56 AM
Sorry, I had wrong information there. It seems that there are two versions of the turtle item, one using dmg to store the computer id and one using it for the peripherals.

One other thing that occured to me lately is: Why can't I craft a wireless crafting turtle? There is no rule allowing only one tool and one peripheral except for the crafting rules. I once used an item editor to create a wireless crafting turtle and it appeared to work.
Sebra #9
Posted 14 September 2012 - 04:05 PM
I would like to propose a single turtle that in its GUI has not only the 4x4 inventory but also four slots representing top, back, left and right peripherals…
From 6 sides bottom(engine) and back(inventory) seems to be essential. So other four are good to be available for peripherals.
Some items can not be put in certain slots; tools can be only put in the 'left' and 'right' slot.
Other items can be put anywhere; modem, inventory(backpack);
yes, except inventory is part of turtle. It should not be peripheral.
Personally I want to use Monitor as a front peripheral for turtle. Modem on top will look so cool.
With lua functions as turtle.use(side) the turtle can load an item from its inventory to a peripheral-slot customise itself, alowing for more versatility.
Good but another proposal.
Pretty sure the limit of 2 peripherals - one tool and one other - is deliberate, and not likely to be extended to 4. I also think it's unlikely they'll be changed to allow swapping perhipherals on an existing turtle.
I'm afraid so.
The limit of 2 peripherals surely is, as this data is stored in the auxiliary value of the ItemStack, and that is limited to two bytes. (Each peripheral takes a single byte for its id). However, I see no reason why they can't allow say, a crafty modem turtle in the future.
If turtle drop peripherals on pickup(except left tool like pickaxe), storing issue is eliminated. Labeled turtles can keep all peripherals and save them in NBT.
Sorry, I had wrong information there. It seems that there are two versions of the turtle item, one using dmg to store the computer id and one using it for the peripherals.

One other thing that occured to me lately is: Why can't I craft a wireless crafting turtle? There is no rule allowing only one tool and one peripheral except for the crafting rules. I once used an item editor to create a wireless crafting turtle and it appeared to work.
At least this.
Cloudy #10
Posted 14 September 2012 - 09:28 PM
The limit of 2 peripherals surely is, as this data is stored in the auxiliary value of the ItemStack, and that is limited to two bytes. (Each peripheral takes a single byte for its id).
actually, it's 4 bytes avaiable. But I think the other two are use to store the computer id.

There's the 2-byte item ID (which is limited to a maximum of 31999), the 2-byte damage value and almost-unlimited NBT data.
There's only one item ID of course, which gives 2 bytes + as much as necessary.
The catch is that stackable items can't use NBT. If turtles were unstackable (which isn't as annoying as it sounds) you could attach many peripherals to one turtle.

Actually that wasn't the issue (in my experience they stacked fine). The issue was that when displayed in the world in multiplayer (e.g. Anywhere but in your hand in first person or in the inventory) that the turtle type didn't display since the networking of these items doesn't include NBT data.
Xfel #11
Posted 15 September 2012 - 06:25 AM
But isn't there a method getShareTag in the item class which can be overridden to return true and to send the item stack?
Cloudy #12
Posted 15 September 2012 - 08:27 AM
But isn't there a method getShareTag in the item class which can be overridden to return true and to send the item stack?

Yes - but neither the packet which says that an item Entity has been spawned in the world nor the packet which shows the item in your hand to other players networks the NBT tag. To try it out yourself, drop an enchanted weapon/tool in multiplayer - you will see that it is not shiny once in the world, but regains it once you pick it up.