Jump to content




Terraform - change how your biomes look like


  • You cannot reply to this topic
7 replies to this topic

#1 Everyone

  • New Members
  • 2 posts

Posted 15 April 2013 - 12:07 PM

Terraform
turn your deserts into meadows, change dirt beaches to sand beaches, explore caves made of wood!



What is it?
Terraform is a ComputerCraft Turtle program that digs out blocks and replaces them with the blocks YOU want, keeping the landscape's and caves shape while mining valuable resources at the same time.

Usage and parameters
terra [cycles] [dump] [quick [depth]]
All params are optional. They can be put in any in almost any order; almost, because 'quick' will interpret following it number as the depth to dig.
cycles - number. How many 'steps' infront of the turtle should be terraformed, i.e.: terra 15. If the number of steps is not given, the program will work in supervision mode, requiring conformation for each new cycle.
dump - literal string. Using this param will make the turtle throw up :) the inventory content (but not from the config slots) after each cycle.
quick - quick mode, by default it will dig just 5 blocks deep. Useful if you want to quickly replace the top layers and do mining by other means or not at all.
depth - number that comes after 'quick', lets you specify the depth of the quick mode, i.e.: terra 64 quick 3 will go for 64 cycles (or steps) replacing blocks to 3rd layer deep on it's path.

Configuration
Slot 1 - block used for the surface layer
Slot 2 - 'subsurface' block, placed on relative depth from 2 to 4, that's 3 layers.
Slot 3, 4 - 'filler' blocks, those will be used to replace everything else.

Default behavior
• Turtle won't start a terraform cycle unless the fuel level is at least 600. This was made on purpose so that turtle would not run out of fuel in the middle of a cycle deep in a hole (or a lava lake). I took this aproach because coming up with a proper and effective scheme for correct and constant fuel calculations was too mindbending.
• Turtle will try to make the best out of items in it's inventory. If it goes out of a particular block, it will try to restock it out of stuff it dug out.
• The program was written to operate without any supervision as much as possible. The only time the turtle will need your attention is when it goes into pitstop mode. It does that only when:
- fuel level drops below 600 after finishing a cycle
- it runs out of config blocks and cannot restock from internal inventory
- it's inventory is full.
• After a finished cycle the turtle will do one "step" forward, meaning it won't just move straight forward, but will position itself as close to the ground as possible, which means it will climb mountains and go down valleys, removing the need for manual height positioning. Be sure to remove tall grass, flowers, torches, redstones and other types of non-solid blocks, as they are percieved and mapped by the turtle as normal blocks. This can't be dealt with without block id recognition (and we know vanilla CC won't get this feature ever).

Why was it made? A piece of (possibly boring) history.
Spoiler

Future?
Spoiler

Download
MediaFire
Pastebin

Copyright
Do what you want with it, just be sure to give me some credit if you use my code in your project.

#2 superaxander

  • Members
  • 609 posts
  • LocationHolland

Posted 15 April 2013 - 06:28 PM

This is just...AWESOME!
EDIT:
You might want to use pastebin
pastebin get Ej66aXR7 terra

#3 Andrakon

  • Members
  • 37 posts

Posted 16 April 2013 - 11:47 PM

Woa totally awesome program! :D
I like all the extra history and back story.
It looks like you put a lot of time and effort into it!

Good video too!
Here is the code to embed the video:
[media]http://youtu.be/h8jS1eF_als[/media]


#4 Everyone

  • New Members
  • 2 posts

Posted 19 April 2013 - 08:26 AM

@superaxander: note taken.
@Andrakon: you save the day.

Thanks for the feedback guys, glad you like it. This one got much love as it's in constant use and yeah, the development took a few weeks on-off. I was making my first steps in LUA with this one. Even tho I'm no stranger to programming, LUA does things... in it's own fashion.

#5 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 19 April 2013 - 10:09 AM

Nice, that's a useful program.
I haven't actually used it, but I like your structured coding.
Clean, readable and annotated with helpful comments
That alone is worth a [+1] in my opinion.

Kudos, and keep up this good coding hygiene! ^_^

#6 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 19 April 2013 - 11:49 AM

Haven't quite tested this yet but it seems great and I'll test it tomorrow, But I also think this is worth +1
Keep up the good work! :)

#7 HeffeD

  • Members
  • 61 posts

Posted 08 October 2013 - 05:56 PM

I'm really surprised this great script hasn't received more attention.

I'm currently using it to cover the area around a nether fortress with slabs to ensure that mobs can only spawn in the fortress in an attempt to improve wither skeleton spawn rates.

I tried platforming first, but with the varied terrain, platforms really aren't a great solution. So I thought, I wonder if anyone has created a terrain follower, and sure enough!

So far the script has been absolutely trouble free and the turtles have no problem tackling even the most difficult terrain.

Thanks for sharing this with us! :)

#8 apemanzilla

  • Members
  • 1,421 posts

Posted 11 October 2013 - 10:11 PM

How... What... Thi... THIS IS AMAZING!
We NEED scripts like these, not just thousands of copied quarry scripts!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users