ComputerCraft

ComputerCraft

21M Downloads

[Enhancement] More peripherals on pocket computers

KnightMiner opened this issue ยท 16 comments

commented

As it has been brought up a couple times by dan with no real discussion, I feel it is worth bringing up the idea of allowing more peripherals on pocket computers before someone starts a PR for it (no point wasting effort if it is unwanted). I would say no more than two is required, as most of the time you are going to want a modem to communicate with other computers, then some peripheral unique to the program (speaker, sensor of some form, etc.).

I could see the argument that limiting it brings out more creativity, but it feels much less natural to have to constantly swap the peripheral in order to perform more than one function which I feel really limits functionality.


While bringing that up, as turtles have two peripherals, which with this change would make the same as pocket computers, should they get a third one so they remain having more than pocket computers? (as they do seem to be more powerful computers) I feel a peripheral would fit well visually on the top, though tools might look awkward up there, but I am not sure turtles how much turtles need to have more peripherals than pocket computers.

commented

On the subject of turtles. Perhaps having them being able to use tools directly? Kind of like CCTweaks Tool Host but built into the turtle (and also how OC does its robots if I understand correctly).

commented

Could you explain this idea in more details?

commented

@Wojbie Basically being able to have two peripherals and a tool(e.g. a pickaxe), with the tool being used 'from' the turtle's inventory.

commented

@Lupus590 But then CCTweaks won't have any features left ๐Ÿ˜›. In all seriousness, I do think turtles using items in the inventory should require a tool/upgrade rather than being the default. Upgrades feel more consistent that way, and allow you to expose peripheral methods such as .canDig().

commented

Where would you put the second peripheral for the pocket?

commented

Well, the current is "back", so probably top or bottom. Not sure how to show it visually unless we actually showed peripherals on the texture (quite a bit more complicated)

commented

One thing to consider is what to do about the "modem light" when both upgrades are trying to change it. A couple of possibilities:

  • Whoever changed it last determines the colour of the light. This seems the least appealing solution as modems set the modem colour every tick.
  • Split the current light into two pixels.
  • Determine the "average" colour of the two upgrades and use that.

I personally think two upgrades on turtles is enough. I feel there is always going to be a temptation to add more upgrade slots, just as they make things more convenient. Two allows for a tool and a modem, meaning you can communicate with other turtles and thus share responsibilities between them - something I think is more interesting than having some "all in one" turtle.

commented

@Restioson I think the way it works now is fine. One PC, one upgrade. It's as simple as it can be. But if we have the possibility to install the PC to a cover/sheet/case/nameit with an additional peripheral, it's a whole new story.

commented

@Messen I think you are confused; I did not create this issue. That was @KnightMiner.

commented

I feel like a peripheral case/etc. is much more complicated than just adding a second slot as we both have to program around having the additional peripheral wherever and someone needs to implement it on a code level which is more complicated than just adding a second slot

commented

@SquidDev yes, we're gradually merging CC-Tweaks into vanilla CC

commented

yes, we're gradually merging CC-Tweaks into vanilla CC

I don't object to that. Heck, I started CCTweaks on the basis of "why isn't this in CC". However, I do think there are some things in CCTweaks which shouldn't be part of main CC. The turtle tool host being one of these.

Edit: I think there is a bit of a temptation to go "add all the things" to CC. IMO CC works really well as a minimalist core, with the bells and whistles being added by additional peripheral mods. That's not to say new features should't be added, just not everything needs to be in the main mod.

commented

@SquidDev mentioning CCTweaks, what about Plethora? That makes a new peripheral system or something doesn't it? Could some of the back end stuff of Plethora be useful to CC?

commented

Going back to main topic of this discussion. As dan200 basically confirmed he don't see problem with pockets having 2 peripherals "Wireless Noisy Pocket Computers" I would-like to restart this discussion how this should be coded.

Personally it would make sense to me to just add a second peripheral slot to pocket called "bottom". That way all programs that use "back" will work ok and we will keep backwards compatibility.
Also this would require adding 2nd notification diode below first one on the pocket itself. Again this would fix bottom part of the peripheral. Anyone got any input to add to this thing before i go ahead and start Bodgeing it? make idiot from myself trying to understand this code.

commented

Whilst it makes less sense, I feel the notification light should be next to the current one, rather than below it. There is space on the texture to the left of the current light, whilst there isn't any space below.

There is a bit of me which would like to blend colours instead - I doubt people will need both lights most of the time. Not sure how this would work in practice though.

commented

Ohh right, I would say then that current one get moved to left and new one in place of current one. That way top->bottom would be left->right ordered.