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

Two Programs For Developing Your New Area

Started by eglove, 22 June 2014 - 03:31 AM
eglove #1
Posted 22 June 2014 - 05:31 AM
I've created two programs that go perfect together for developing a new area.

1. Clear Space http://pastebin.com/Hipv8pmJ - This clears an entire area given a length, width, height and depth. You can give it a depth of 0 (meaning it will not go down), but everything else must be at least 1.

2. Place Torches http://pastebin.com/3gbNWF3M - This places torches in the "official" most efficient pattern seen here. While this program does dig, it's recommended that you have a large area planned out for it. (Hence the clear space program.) Also, as you can see from the linked screenshot, it does assume a fairly large area. Each torch is placed either 11 blocks or 6 blocks away from the last, depending if you're looking at length or width.

A Challenge: I have to think on this myself, but I want to see if anyone else has suggestions, or if they want to give this a go. I'd like to mix the two programs into one. You give it an area you want to clear, it places torches on the lowest level, and then clears the area above that. The programs handle themselves a little differently and you have to deal with the odd end positioning of the torch program.

Anyway, below is a screen of the results, this is a 36x24 area (the numbers were purposely chosen for an easy test run, but the program does work with funky numbers. Tell me what you think. :)/>



Edit: Planned changes:
[indent=1]1. Implement placeDown() into "Clear Space" to cover up caverns and holes.[/indent]
[indent=1]2. Allow "Place Torches" to work around buildings, ie. if it runs into something, instead of digging, simply move up until it can go forward, and go down where it can. (Best for flat spaces, or with areas that have established buildings.)[/indent]
Dog #2
Posted 22 June 2014 - 05:38 AM
Wow, I have uses for this. Thanks! Any chance you would consider merging the place torch capability with the clear space program so it can place torches as it goes (after you implement placeDown() into "Clear Space", of course)?
eglove #3
Posted 22 June 2014 - 08:18 PM
Wow, I have uses for this. Thanks! Any chance you would consider merging the place torch capability with the clear space program so it can place torches as it goes (after you implement placeDown() into "Clear Space", of course)?

Thanks. As already mentioned, I've already considered a merge and its kind of complicated getting the spacing right. I think the best option would be to first clear, then place the torches but I'd have to figure out which corner the clear turtle ends up in. However, personally I think it'd be more valuable to have the features noted on the bottom, which aren't mergable.
Dog #4
Posted 22 June 2014 - 11:25 PM
… its kind of complicated getting the spacing right. … I think it'd be more valuable to have the features noted on the bottom, which aren't mergable.
Gotcha - thanks for the explanation and thanks, again, for this package :)/>
wieselkatze #5
Posted 24 June 2014 - 07:58 PM
I think there would definitely be a use for this (currently testing this program).
As I see the program has no protection for mobs yet. That should be fairly easy to implement though.

Nice program for someone who actually is relatively new to the forums, keep it up! :)/>