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

Shape Builder

Started by Aeolun, 01 February 2013 - 02:12 AM
Aeolun #1
Posted 01 February 2013 - 03:12 AM
So, I needed a turtle script that would help me build the stuff that I personally always found damn annoying to build, I looked around here a bit, but the only thing that I could find to build simple stuff (I do not want advanced tower building) was a rather unworkable script that someone posted here a while ago.

I took it upon myself to fix it, but left their original credits in the code.

http://pastebin.com/zkb4FY4L

I now also added the sphere dome builder that posted here: http://www.computerc...d-dome-builder/

It builds:
- Lines
- Rectangles (or squares, as a convenience method)
- Circles
- Walls
- Floors (or roofs)
- Rooms (combines walls, floors and roof)
- Stairs
- Domes
- Cylinders
- Pyramids (hollow or filled)

It is extremely basic, though it does try to take into account fuel levels and the amount of blocks left available to built with (that is, if it runs out of either, it will stop, and patiently wait until you come to refuel or refill it, then continue).

If I write it builds a line, it probably does exactly what you imagine it does :P/> but for those whom want to see what it does, here are some screenshots: http://min.us/mmS6gwT0ydSRf

One thing to note is that it always takes the block UNDER it as the starting point, and always builds from left to right, and from front to back. So if you tell it to build a room 6 wide and 6 deep, the left wall will be at the starting point, and the right wall 6 blocks to the right of that.
I try to make everything consistent, please let me know if it does something weird.

You can use it with both normal and mining turtles. Mining turtles have the added benefit that they smash whatever is in the way of what they are building, normal turtles may just give up if something is in the way.

Do not expect it to restart gracefully if the chunk unloads, or if your server reboots. I do not generally expect people to build while they are not around so I didn't bother for now.
Mailmanq! #2
Posted 01 February 2013 - 03:46 AM
Good, finally I don't have to keep making a script for something like this when I need it. Also, do you think you could add circles?
Cranium #3
Posted 01 February 2013 - 03:47 AM
Next you need more shapes. Cylinders, pyramids, spheres….
Good job so far though!
xInDiGo #4
Posted 01 February 2013 - 07:00 AM
this is pretty nice! i was using this sphere/dome builder to make my domes, but more shapes would be great! having one program to do them all would be very nice :]

perhaps a Pyramid (either hollow or not) would be good to add too!

i also like that you defined where it starts and which direction it builds. in my experience it takes a few tries to get the turtle to build right where you want it so this helps!
ughzug #5
Posted 02 February 2013 - 01:57 PM
can you add hexagons?
theoriginalbit #6
Posted 02 February 2013 - 02:21 PM
I say screenshots ;)/>

Good job though. More shapes would be good :)/>
Aeolun #7
Posted 02 February 2013 - 09:10 PM
Screenshots added, more shapes added (most requested, I forgot sphere, and need some more time to calculate hexagons ;)/> ).

I've used the spherebuilder script posted by xInDiGo. No sense in making it myself if it already exists and works perfectly.
Shnupbups #8
Posted 02 February 2013 - 09:13 PM
Coolio, turtle slaves can build me a 6 room house while I be lazy and do other stuffs.
ughzug #9
Posted 02 February 2013 - 11:29 PM
thanks man take your time
maniacpsycho #10
Posted 08 February 2013 - 10:27 PM
script errors if you have easy mode enabled (no refuelling)
MacDaddyPro #11
Posted 09 February 2013 - 05:32 AM
This is great. Thanks for making it.

This is what I have used it so far and it worked great.

Cylinder = Worked great..

Pyramids = Worked great.

Walls = Worked great.

Walls = Bugged. The floor and the celling go one way and the room goes the other.

I am going to go test all the others right now.

Again. Thanks for this! I think it is great. Ill get back after I test all the rest of the shapes.

B)/>
MacDaddyPro #12
Posted 09 February 2013 - 06:36 AM
Just some info when you build a room. If it is even it seems to work 5 x 5 x 5

But if you build a 12 x 8 x 7 it puts the roof and floor in the wrong way.

back to testing.

thanks again.
MacDaddyPro #13
Posted 09 February 2013 - 07:09 AM
Bug in platform.

When it runs out of blocks in slot 1 it uses the blocks it picks up.
xInDiGo #14
Posted 11 February 2013 - 08:08 AM
few things i noticed.

it doesn't handle sand or gravel very well, and when it starts picking up junk blocks in its first slot it will place those blocks as part of the shape
Ritchie #15
Posted 22 February 2013 - 06:34 AM
I love this program, thank you so much! I find it difficult to build more complex structures though, such as stacked cylinders and domes of different sizes because I can't seem to figure out (try as I might) where to place the turtle to have the center points of stacked structures line up, especially since it uses radius not diameter but seems to change the radius so that the diameter always comes out to an odd number.

It really just becomes hard for us more creative types, I assume there's math involved.

My request is that you change it or add the option to start building from the center block so that turtle placement is a snap.

-Ritchie
Hitorikirino #16
Posted 25 February 2013 - 08:04 AM
Every time I try to run this program I am getting an error. It will place one block directly below it and then give the error before it moves. The error is "shape:28: attempt to compare number with string expected, got number".
solaris187 #17
Posted 28 February 2013 - 10:50 AM
Your calculations for the starting point of a circle seem to be off. I place the turtle down and tell it to build a circle of size X. It actually moves first to the right X before it constructs the circle. This make is very difficult since the starting point is not even in the circle or part of it in some way. Is this a bug?
Keridos #18
Posted 04 March 2013 - 05:06 AM
For the circle/dome the center is radius blocks to the right and forward from the starting point of the turtle.

Nice work, please update and add sphere and hexagon. Loving this already.

/edit: The room wall calculation is wrong, it starts the first wall correct but then continues to build the to the left side instead of to the right side. So one of the walls is right, the other three are not in their correct positions.
Keridos #19
Posted 07 March 2013 - 12:19 PM
Fixed the room building code (problem was the turtle built like it was on the starting position after building the floor, but that only works fine for rooms with uneven side length values).
The other code is unchanged.
/edit: Updated the paste again, now should be able to build spheres. (updated now, pastebin finally up)

http://pastebin.com/RAHj4r2K

Another idea: It may make sense to make this project communitydriven, so hosting it on Github might be a good idea. Makes modifying and managing it far easier. So fixes like mine could be merged into the project without changing the Opening Post too much. And of course a versatile shape builder could be more useful than like 5 small ones.
Edited on 07 March 2013 - 03:34 PM
Paksarra #20
Posted 12 March 2013 - 06:03 AM
Every time I try to run this program I am getting an error. It will place one block directly below it and then give the error before it moves. The error is "shape:28: attempt to compare number with string expected, got number".

This is probably because you have fuel disabled. I'm getting the same error for any program that checks fuel, and my server's admins are 2 to 1 against turning fuel back on for compatibility I am not happy with them.
Keridos #21
Posted 14 March 2013 - 05:27 PM
Every time I try to run this program I am getting an error. It will place one block directly below it and then give the error before it moves. The error is "shape:28: attempt to compare number with string expected, got number".

This is probably because you have fuel disabled. I'm getting the same error for any program that checks fuel, and my server's admins are 2 to 1 against turning fuel back on for compatibility I am not happy with them.

Updated the Program. Unlimited fuel settings should be no more problem now.
Download still at this pastebin URL: http://pastebin.com/RAHj4r2K

/edit: Cleaned up the code a bit more.

/edit: another bit of code cleaning and restructuring. Maybe I will try to add in a hexagon function, but i cannot guarantee that. Also if anyone finds errors or has suggestions, would be nice if you added them aswell as issues on the github. Makes managing them pretty easy. Or post them in the new thread whenever I get around to making it.

/edit: merged the branch into the main program. So now we only have 1 program for all turtles. It automatically detects and uses mining and resupply modules. Chunkloader modules make the turtle not stop when you leave the age they work in (in smp)
Kravyn #22
Posted 18 March 2013 - 01:46 PM
nice script I am using the platform one for now but I was wondering if there is any way you can make the builds work downwards? I build on high platforms.

I would like to make either inverted builds (as in top down) or upside-down (like pyramids floor is at the top and the point is at bottom).
Keridos #23
Posted 19 March 2013 - 12:06 AM
Maybe I will add that functionality in, still need to figure out how to exactly do that
bluzor #24
Posted 21 March 2013 - 02:19 AM
i'm a pretty big fan of this! is there any chance to get it to build solid items? (to build underwater for instance)
- thanks for your time!
Keridos #25
Posted 21 March 2013 - 03:22 PM
As far as I know it should be able to build underwater.
bluzor #26
Posted 22 March 2013 - 02:01 PM
it does build under water. but i have to manually remove water spawns =( (If it builds a solid i can simply just mine the blocks)
Paksarra #27
Posted 23 March 2013 - 05:25 PM
Updated the Program. Unlimited fuel settings should be no more problem now.

Thank you!

This program is incredibly useful (now that it works for me.) Thanks for writing it.
Kravyn #28
Posted 23 March 2013 - 10:18 PM
the reason the turtle does not remove the water sources is because it never goes through the water in the center its not impossible to program the turtle to go through every block it would cost a lot more fuel tho for those that keep fuel in especially if the build is big.
Shini #29
Posted 25 March 2013 - 03:25 AM
is it possible to make it continue the work after restart?
and whats the link to the github depo?
Keridos #30
Posted 27 March 2013 - 05:08 AM
is it possible to make it continue the work after restart?
and whats the link to the github depo?

We are working on resume funcionality at the moment. THe github repo is here: https://github.com/Keridos/Shape-Builder
And here is the new thread for the program: http://www.computercraft.info/forums2/index.php?/topic/11520-the-versatile-shape-builder-updatedactive/
Kravyn #31
Posted 28 March 2013 - 05:58 AM
is there a way I can trigger a sequence of build scripts back to back?

Since I am unable to make it build downwards I am trying to get it to go down and build upwards from the bottom point I wanted it to build from.

like when you make the turtle.down() enough times to reach the point I want then have it do shell.run("shapebuilder") the problem I am having is how do I tell the turtle to fill in the information for me when it asks what shape calculate fuel and the dimensions I want.

I would appreciate the help.
Keridos #32
Posted 28 March 2013 - 06:27 AM
is there a way I can trigger a sequence of build scripts back to back?

Since I am unable to make it build downwards I am trying to get it to go down and build upwards from the bottom point I wanted it to build from.

like when you make the turtle.down() enough times to reach the point I want then have it do shell.run("shapebuilder") the problem I am having is how do I tell the turtle to fill in the information for me when it asks what shape calculate fuel and the dimensions I want.

I would appreciate the help.
Post any problems in the new thread please, this threads author is inactive.
naxyr #33
Posted 23 June 2013 - 12:26 PM
Works great so far. If I change the < to a == on line 28 I can run it without a fuelcheck.
Mmarss #34
Posted 20 July 2013 - 11:48 PM
This is great! Thanks very much for making it. Is there any chance you could add filled circles though? If my turtles could build tower floors (which are the most block-intensive component of towers), it would make any kind of construction a lot easier. I hope you can work out how to make solid circles.
Many thanks again,
Mmarss
Kravyn #35
Posted 21 July 2013 - 01:35 PM
the author has basically stopped working on it so you might want to go to the new thread for shape building

http://www.computercraft.info/forums2/index.php?/topic/11520-the-versatile-shape-builder-updatedactive/