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

[1.4.3] Community-developed Lua programs in official release

Started by Radtoo, 18 October 2012 - 01:08 AM
Radtoo #1
Posted 18 October 2012 - 03:08 AM
I noticed that CC Lua API is quite powerful, but the included Lua programs are almost all quite basic.

I imagine there are quite bunch of CC programs that could be of general interest: Some with trivial impact on economy (build a nifty house or other shapes using materials already provided) and some with large impact on economy (mining, farming, placing lights, killing mobs, preparing wireless networks, storage management and refueling). And a library of Lua helper functions to more easily write those programs is also another thing.

People already started developing many of these, but almost everyone worked alone,, and quite a few duplicated their efforts or ceased working after getting a basic implementation done. And most (/all?) of the scripts don't seem to end up in the official CC release.



As such, I think it would be useful if there was some sort of simple, public process by which the Lua programs for ComputerCraft could be developed and included in the official release. Not all of them, mind you, but just the ones that probably have wide appeal and readable code with documentation.

Since doing that in the "Programs" forum alone would probably result in considerable chaos: Maybe an explicitly open-source licensed Github repository for those programs could be started and pull requests be taken for things to be included into the next release of CC?
ChunLing #2
Posted 18 October 2012 - 05:18 AM
This is the purpose of the "pastebin" program which is part of the official release. Using this program, you can download programs posted on pastebin directly to your in-game computers, without the need for the official development team to sort through everything and decide what is useful enough to be included in the rom directory as part of the mod itself.
Radtoo #3
Posted 18 October 2012 - 04:28 PM
This is the purpose of the "pastebin" program which is part of the official release. Using this program, you can download programs posted on pastebin directly to your in-game computers, without the need for the official development team to sort through everything and decide what is useful enough to be included in the rom directory as part of the mod itself.
I understand that, and people can also use the "Programs" forums. It isn't the same. it would precisely be good to invest the comparatively very little effort needed to review and include some nicer scripts and their related helper functions.

By far the most users will see / get those - not the ones on pastebin, not the ones in the forums. And they'd be explicitly licensed so that they can be extended / fixed when desired or needed. And we'll get a bunch of nice helper functions for use with actual 3rd party scripts along the way.
billysback #4
Posted 18 October 2012 - 04:44 PM
This does seem over the top, who do you suggest gos through all of the programs looking for the best ones, then implementing all of the "best" ones in to the game.

This would also increase the download size of CC with programs that a lot of people will probably never use…
As ChunLing pointed out PasteBin is there for a reason, it has been made incredibly easy to get programs off of pastebin and is supported by most major programs… Why not just take advantage of this?
ChunLing #5
Posted 18 October 2012 - 05:10 PM
Hey, I've posted some scripts, and they work and all, but I'm not exactly going to make a long term commitment to continue development on them through all future versions of CC and Minecraft. It might be different if "licensed" meant I got paid or something, but it doesn't. And it can't. Unless you want to start paying for CC.

But leaving that aside, I think that you're kinda missing the point of CC, which is to engage with the programming yourself at least to the degree of personally selecting which programs you'll use. The idea is for each user's computers to reflect the needs (and skills) of that user.
Radtoo #6
Posted 19 October 2012 - 10:50 PM
This does seem over the top, who do you suggest gos through all of the programs looking for the best ones, then implementing all of the "best" ones in to the game.
Script writers would submit implementations, not suggestions. Someone from the CC team with the power to decide if it should go into CC reviews and adds / refuses to add. That's all there is to it.

This would also increase the download size of CC with programs that a lot of people will probably never use…

Common sense says people would use various programs and helper functions. Aforementioned person decides if it gets into CC's default collection of Lua programs.

As ChunLing pointed out PasteBin is there for a reason, it has been made incredibly easy to get programs off of pastebin and is supported by most major programs… Why not just take advantage of this?

By that reason, why ship any Lua scripts at all with CC? Why any items, in fact? I think it is be because they will get used far more than the pastebin ones. They serve as important demonstration to users as to why CC is useful and fun, at all.

From a programmer's point of view, the built-in functions and the usually shipped Lua scripts is all that might be imported / reused. The rest you'll have to do from scratch - or you'll have to deal with deployment issues and other unfun stuff.


Hey, I've posted some scripts, and they work and all, but I'm not exactly going to make a long term commitment to continue development on them through all future versions of CC and Minecraft. It might be different if "licensed" meant I got paid or something, but it doesn't. And it can't. Unless you want to start paying for CC.
You wouldn't have to. The idea isn't that you're forced to perpetually maintain things. It is that you donate what you have under an open source license. Now, either you or someone else does the needed fixes that might be required over time. Or they can just get tossed out of the "official" script collection again if they're too bad / unmaintained / unpopular / whatever.


But leaving that aside, I think that you're kinda missing the point of CC, which is to engage with the programming yourself at least to the degree of personally selecting which programs you'll use.
Of course you're still supposed to be able to download / write more programs, but both for programmers and plain users alike it would be useful to get commonly used programs and helper functions by default. Those are looked at / used most.

It's still a choice just the same whether or not to run a program or function, and how to run it.
billysback #7
Posted 19 October 2012 - 11:08 PM
why ship any Lua scripts at all with CC?

Your main reason seems to be to be used as an example for new people to CC;
The current programs are there for that, and this would also be unfair for scripters who's programs arn't put in because they are considered "worse" than someone else's, when it could be considered better for you.

If you go to a restaurant, you don't get given what the chef wants you to have, you look at the menu and choose what you want.
If you want a CC Script, you don't get given the programs someone else wants you to have, you look at the forums and choose the ones you want.
Radtoo #8
Posted 20 October 2012 - 02:28 AM
Your main reason seems to be to be used as an example for new people to CC;
And to build a library of scripting functions based on what those scripts came up with, yes. Both.

The current programs are there for that, and this would also be unfair for scripters who's programs arn't put in because they are considered "worse" than someone else's, when it could be considered better for you.
What, everyone got their feature suggestion implemented into CC? 'cause otherwise, I think it's equally "unfair" that some didn't get prioritized. I don't see a problem - either is a decision of the CC maintainers…?

If you go to a restaurant, you don't get given what the chef wants you to have, you look at the menu and choose what you want.
If you want a CC Script, you don't get given the programs someone else wants you to have, you look at the forums and choose the ones you want.
Restaurant analogy time?

Of course, a very visible menu to pick from at the entrance / that is being handed to you would be another approach. I know no restaurant where you check out the neighborhood in hope of maybe finding a menu, after all.

Maybe some chef / waiter suggestions too, like they have in restaurants? Customers often happen to ask for those, after all. The waiters / chefs usually know what's a really good dish and what's not so special / not everyone's thing.

Oh and how about the explicit permission to alter dishes a little, add some salt and pepper, get an extra chair? You know… modifications to the default arrangement? I'd prefer if we had assurance the restaurant owners can't theoretically call the police if you do that…
ChunLing #9
Posted 20 October 2012 - 03:10 AM
Well, you can alter the contents of your rom folder in the mod. And there is the pastebin. I think that last is a pretty unfair shot at a mod that does so much to make it easy to customize it.

The reason that the sample programs are basic is for the same reason that the vanilla mod doesn't (and will not) incorporate block ID compare functions and the like. It is because part of the point (a large part of the point) of ComputerCraf–that makes it different from just copying a cool world save and using creative to modify it to your hearts content–is to figure out how to do things yourself…only with programming more than with mining.

Programming encompasses more than sitting in front of a screen typing in code. It also means selecting existing programs and working them into your setup. Which is why you have the pastebin command, so that you can easily import third party programs even while a client in someone else's SMP.
Cloudy #10
Posted 20 October 2012 - 09:32 AM
I don't understand why you guys are arguing about this. It won't influence our decision :)/>/> Regardless, we got something in mind which we may do for some built in programs and other user programs, sourced from a web site. It won't involve typing a command, but I'll leave it at that as we might not even implement it.
Radtoo #11
Posted 20 October 2012 - 03:43 PM
I think that last is a pretty unfair shot at a mod that does so much to make it easy to customize it.
It was primarily a shot at the restaurant analogy.

Even so, I see that the standard function and program library in this mod on the Lua side could be better (more adapted to common problems). And I see that they would be already, if some users' scripts were officialized.

The reason that the sample programs are basic is for the same reason that the vanilla mod doesn't (and will not) incorporate block ID compare functions and the like.

It is because part of the point (a large part of the point) of ComputerCraf–that makes it different from just copying a cool world save and using creative to modify it to your hearts content–is to figure out how to do things yourself…only with programming more than with mining.
… but you can already go to the forums and not figure out things yourself! I just see two differences right now:
  1. The average CC user will probably not exhaustively check the forums or even go to the forums, in practice. They won't necessarily find the commonly used scripts.
  2. We get duplication of a lot of helper functions as programmers don't cooperate (yet).

Assuming I did a very nice program & script library on my own and published it as open source code, doing so as an individual without official sanctioning & yet again duplicating efforts already made.

What then? Do you want to ban those scripts or force parts of them to be removed, because now not everyone has to figure out how to do common tasks with turtles and computers on their own anymore…? Would you just do nothing and claim it helps that people had to download it first? Or would you perhaps you would rebalance CC, making more of an effort than dealing with the scripts directly?

Programming encompasses more than sitting in front of a screen typing in code. It also means selecting existing programs and working them into your setup.
I think you might get from context that I already know what programming is about. The suggestion was that we create some *better* official Lua programs and program libraries jointly under the umbrella of, and to the extent to which, the CC team is interested in allowing into an official release, rather than doing it all on our own.

I think there's no danger that people wouldn't also work those into their existing setups if they existed. Both non-programming players and programmers.

I don't understand why you guys are arguing about this. It won't influence our decision
I guess because a discussion was started…?

Regardless, we got something in mind which we may do for some built in programs and other user programs, sourced from a web site. It won't involve typing a command, but I'll leave it at that as we might not even implement it.
All right.
ChunLing #12
Posted 20 October 2012 - 04:58 PM
Well, as long as you're content, that's good.

But seriously, do consider building a team to create some attractive, functional content. Some programmers do work together…most of the better programmers, in fact. I have no objection to people making more usable code. But it should still be up to the players which programs they'll use.
electrodude512 #13
Posted 22 October 2012 - 11:48 PM
Why not ship a package manager with CC? There should be an easy way to add stuff to it and modify (i.e. update) things you put on it, such as directly from computers. Something like cc-get (which I know nothing about besides that it's a CC package manager). It should have post, modify (only for your own programs), list, search, install, update, and update-all commands. Programs could be stored on pastebin like how they are now, but the package list would have to be stored somewhere else.
ChunLing #14
Posted 23 October 2012 - 12:32 AM
Eh…this is a subset of the larger question of why CC ships with such basic programs. Like you say, there are more advanced package managers available. It ultimately isn't something that the developers themselves have to do.

This isn't even like a peripheral mod supplying something that isn't in the core mod. You can do all of this with the mod exactly as it is.
BigSHinyToys #15
Posted 23 October 2012 - 08:08 PM
I have made and released a few programs most are linked in my profile about me page < a good tip btw makes tracking all those links easer and allow others to brows my work. anyway I post then expecting no responses and no downloads if it helps someone then that is good enough. I have started scripting this year with minimal previous experience a little HTML and a minuscule amount of C++ . My first programs were driven by necessity WIFI was not available and RP was not compatible with Better Than Wolves but CC was. I wanted a elevator that was CC controlled and one computer per floor i ended up making a simple signal wire send receive program this allows floors to request the lift and to select destination. an extremely crude method but very effective I had a lift with multiple accessible floors and no huge restone mess.

from there I made many programs most small all badly coded none releases standard. I have much better lua skill than I had then still haven't worked out OOP yet .

Anyway my point is that not having a program to do a job motivates creating one to solve that problem. I don't use other peoples scripts (I mean no offense by this) I know there are better scripts out there that do the jobs I have code for but I like to solve problems My way and have a cretin pride in this. if more scripts were included and standard library for turtle motion tracking were introduced I don't think I would use them maybe contribute some stuff.

As for why people work alone I think that there are too many differing skill levels through out the CC community and a pro doesn't want to work with a noob because you would have to fix there code ect… . this means people with skill normally work alone on projects. Time zones and works schedule's also make collaboration an issue.group efforts do exist and have mixed levels of success example redWorks was a collaboration and produced good programs and code.

If there was a store for downloads like apple store or android market place that had a comity that approved programs It might help to distinguish great programs from the good ones.

I started out writing this thinking it would be pointless but the more I think about it it could be useful.

That makes me 50/50 on this offish endorsement (and access to it in game) would tip it into a yes lets do it.
ChunLing #16
Posted 23 October 2012 - 11:52 PM
I use other people's stuff all the time, but I usually modify it heavily to fit better into my setup. I still think that programming is kinda the spirit of Computer Craft, but it's not like I have any objection to the idea of a committee of expert programmers getting together and promoting a unified suite, I just don't think that it is something that the CC developers need to do, given that it takes time away from doing things that only they can do which I want done.

If a group of trustworthy programmers can get together and assemble a few kits of semi-standardized programs for different user needs, then I would be very happy to support their efforts (you know, in an incidental way, a bit of praise, some word of mouth).

But if the community doesn't have enough programmers that can work together and come up with something, then why would we assume that having the developers do it would do anything but tick bunches of people off because their favorite program isn't part of the package?