Jump to content




The versatile Shape Builder (updated 05/08/14 - now with diagonal lines)

turtle utility

143 replies to this topic

#1 Keridos

  • Members
  • 75 posts

Posted 26 March 2013 - 04:43 PM

So here it is, the thread for the updated shape builder.

Features in the current release:
  • Lines/Rectangles (now even diagonal etc. thanks to CupricWolf)
  • Walls
  • Stairs
  • Platforms
  • Cuboids (Rooms, hollow and nonhollow)
  • Cylinders
  • Pyramids
  • Spheres/Domes/Circles (both up and downwards)
  • 6- and 8- prisms and their 2dimensional counterparts (thanks to CupricWolf)
  • command line interface (also thanks to CupricWolf)
  • resume finally fixed, even without gps (that was me)
  • Ender Chest Refilling (was me aswell)
Its code is based on stuff coded by and been improved by Michiel/Vliekkie/Aeolun/pruby and currently maintaining it on GitHub are CupricWolf and me. (CupricWolf was called happydude before)
The most recent code can be found on GitHub here: https://github.com/K...s/Shape-Builder
The latest "stable" release is also available at pastebin: http://pastebin.com/RAHj4r2K - updated 19/08/14

Tutorial:

You need a mining turtle if your turtle needs to remove blocks to build. A chunkloader module (from MiscPeripherals) makes your turtle work even if no one is standing next to it (very good for smp servers/module currently bugged). A resupply module (also from MiscPeripherals) can make your turtle autorefill its materials -> good for bigger projects.
Place the turtle where you want to build the shape. The turtle will build the shape to its front right side. The turtles starting spot is in the bottom left corner of the square that surrounds your build (trying to get that in a picture if you do not understand what I want to tell with that)

For Enderchest refilling just place an enderchest in slot 16, enable refilling when it asks for that and then keep the enderchest filled with the required building material. It throws away a few pieces of the building material, about 2% of the material to keep unwanted stuff out, cannot be easily done elseway.

Future Additions:
  • More shapes
  • Ability to build stuff upside down
  • GPS support (in the works)
  • Ability to select starting point to be the center of the build.
If you have any ideas for this, just post here or on the GitHub repository.
Same is for any found bugs.

Changelog can be found here: https://github.com/K.../commits/master


ToDo for the thread:
Add Pictures

Edited by Keridos, 19 August 2014 - 07:26 PM.


#2 MrHohenheim

  • Members
  • 26 posts
  • LocationDebrecen

Posted 27 March 2013 - 12:22 PM

hi platform thing not solved i build 20x20 and when slot 1 run out example dirt and pick up cobble use this and not move to slot 2 to use the dirt..

#3 Keridos

  • Members
  • 75 posts

Posted 27 March 2013 - 01:18 PM

eh what?

edit: Didn't want to be that rude, sorry.

#4 kirimato

  • New Members
  • 1 posts

Posted 27 March 2013 - 01:23 PM

I think that he means is that the 20x20 platform building is still bugged. When the turtle is building, he has slot 1 and 2 filled with dirt. When slot 1 runs out of dirt, it picks up cobble and uses the cobble while it doesnt touch the slot 2 filled with dirt.

#5 Keridos

  • Members
  • 75 posts

Posted 27 March 2013 - 01:39 PM

Ah ok thanks, I will look into that soon, we just need to get that resume stuff working. Stay tuned, should be fixed soon.

#6 MrHohenheim

  • Members
  • 26 posts
  • LocationDebrecen

Posted 28 March 2013 - 02:59 AM

View Postkirimato, on 27 March 2013 - 01:23 PM, said:

I think that he means is that the 20x20 platform building is still bugged. When the turtle is building, he has slot 1 and 2 filled with dirt. When slot 1 runs out of dirt, it picks up cobble and uses the cobble while it doesnt touch the slot 2 filled with dirt.

yes thanks my englis very bad :(

#7 Kravyn

  • Members
  • 18 posts

Posted 28 March 2013 - 04:39 PM

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.

example like:
i=0
setPoint=9
shapeBuild=6


while i < setPoint do
turtle.down()
i=i+1
end
while i < shapeBuild do
shell.run("shapebuilder")
..... this is where i get stuck because when the builder script is triggered it asks for the information step by step.
write("square")
write("n")
write("10")

or instead something like shell.run("shapebuilder square n 10") <-----------
end

turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()

while i< shapeBuild do
shell.run("shapebuilder")
write("square")
write("n")
write("8")
end

And keep going til it gets down to the final size set. I dont need full automation just a way to trigger the shapebuilder within my script. is it possible?

#8 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 28 March 2013 - 08:39 PM

View PostKravyn, on 28 March 2013 - 04:39 PM, said:

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.

example like:
i=0
setPoint=9
shapeBuild=6


while i < setPoint do
turtle.down()
i=i+1
end
while i < shapeBuild do
shell.run("shapebuilder")
..... this is where i get stuck because when the builder script is triggered it asks for the information step by step.
write("square")
write("n")
write("10")

or instead something like shell.run("shapebuilder square n 10") <-----------
end

turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()

while i< shapeBuild do
shell.run("shapebuilder")
write("square")
write("n")
write("8")
end

And keep going til it gets down to the final size set. I dont need full automation just a way to trigger the shapebuilder within my script. is it possible?
We are working on adding command line access to things like this. Also building downwards will be added with upside down structures. Right now though the biggest concern is resumption, it has several issues that need to be addressed.

#9 Kravyn

  • Members
  • 18 posts

Posted 29 March 2013 - 04:58 AM

Well resuming any code is a pain and most of the time it requires GPS and a saved file or just saved file recording the last position in the code it ran and the variables + or - it was on within the code. But as said below I am still learning lua.

All I was asking really was if there was a way to make the turtle fill in the information for me. like a write command or a io.read("*a") then trigger a write()? things like that to fill in the information.

I understand you want to get the code out first but by the time I get the code I might be finished building my project manually. Which is a long time from now my point is that I just wanted a quick fix or work around.

I am grateful people are working on this code it seems to be really handy. I am learning turtle lua as fast as I can but every time I spend on it the less time I spend on building. and being on a server I fall behind everyone else. heh

#10 Keridos

  • Members
  • 75 posts

Posted 29 March 2013 - 02:51 PM

Well I have an idea how to get returning to get working most of the time. Basically the chance of it failing can be minimized, but not decreased to 0% without GPS.
The command line parameters are definitely being added as happydude already said.
Personally I would like to get the code going piece by piece and adding things in older versions is only more work for us.
But as you seem to have a basic understanding of programming take a look in the code of the program on pastebin. It is really easy to understand (you need to take a look at the Choicefunct() function, which basically handles all the reading of the information from the answers of the user).
Maybe when we get a working version of parameter passing I will add that in on the old version but at this moment we have quite a lot of other bugs to fix in our current release "candidate".

#11 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 29 March 2013 - 03:09 PM

View PostKravyn, on 29 March 2013 - 04:58 AM, said:

Well resuming any code is a pain and most of the time it requires GPS and a saved file or just saved file recording the last position in the code it ran and the variables + or - it was on within the code. But as said below I am still learning lua.

All I was asking really was if there was a way to make the turtle fill in the information for me. like a write command or a io.read("*a") then trigger a write()? things like that to fill in the information.

I understand you want to get the code out first but by the time I get the code I might be finished building my project manually. Which is a long time from now my point is that I just wanted a quick fix or work around.

I am grateful people are working on this code it seems to be really handy. I am learning turtle lua as fast as I can but every time I spend on it the less time I spend on building. and being on a server I fall behind everyone else. heh
And to answer your question, I don't think there are any ways other than manually placing the turtle and running shape each time, sorry >_<. I would do it like this anyways because minecraft isn't the most stable thing and you would have to reprogram your construction program every time the turtle got unloaded (alot)

#12 ughzug

  • Members
  • 24 posts

Posted 31 March 2013 - 12:33 PM

hexagons and octagons please ^_^

#13 xInDiGo

  • Members
  • 105 posts

Posted 31 March 2013 - 12:54 PM

hexagons and octagons

#14 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 31 March 2013 - 06:10 PM

hmm, sounds interesting. I'll see what can be done. I'll have to brain storm which parameters are needed and what not. The problem is that those aren't easily defined shapes, with rectangle based shapes its easy, just place a line then turn and place another, for circular objects its checking if a block is in the range radius to (radius + sqrt(3)) away from the center. Octagons and hexagons are different, they have to more thought out and the code will be much more complex, especially with hexagons. Hexagons will be harder to code than octogons because of the steepness of the "diagonal" parts, there are only two non-diagonals in a hexagon, the other four sides are diagonal, and those will be complicated because they are at 120° from the non-diagonals which is 90+30 and 30° is up-one-over-one-up-one-over-two, whereas in octogons the diagonals are at 135° from the non-diagonals which is 90+45 and 45° is just up-one-over-one, etc. Figuring out when to stop the diagonal and going back to non-diagonal will be semi-difficult to code in the hexagon.

EDIT: I got the turtle movments wrong with the hexagon, its not up-one-over-one-up-one-over-two but it is up-two-over-one-up-one-over-one-up-one-over-one-up-two-over-one... so like the following

- - - - - - +
- - - - - - +
- - - - - + -
- - - - + - -
- - - + - - -
- - - + - - -
- - + - - - -
- + - - - - -
+ - - - - - -
+ - - - - - -
where + is a block and - is empty space

#15 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 31 March 2013 - 06:17 PM

That's also assuming regular hexa-, octa-gons. Irregular polygons would be more difficult. And why stop at hexa-, octa-gons, why not have an n-gon builder, adding these shapes open the door for people to ask for more options and might cause us to have to add more and more shapes, and way more complexity. As far as I understand this is supposed to be a compilation of simple shape constructors. I'm not the only one involved in this project, so I am not the last word, I'll wait until the others get a chance to look at the thread. Also, I will try to make a program that can do it.

#16 xInDiGo

  • Members
  • 105 posts

Posted 03 April 2013 - 01:13 PM

bummer! some unique planes would be great!

i imagine it would ask the user for how many sides and how long each side would be. but then again i'm not so great at this coding business. the best i can do is a hopper turtle xD

#17 Keridos

  • Members
  • 75 posts

Posted 05 April 2013 - 07:00 PM

Hexagons and Octagons are being added soonish, other shapes are too difficult (at least happydude said that on github).
I will be looking into GPS Support and inverted building in the next days. Command line interfacing will be added soon too.
Just to warn you: Minecraft is not very stable and even chunkloading turtles get unloaded sometimes (for a reason that I have not found yet) so do not expect long programs to run smoothly. At least not without GPS support.

#18 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 08 April 2013 - 06:03 AM

View PostxInDiGo, on 03 April 2013 - 01:13 PM, said:

bummer! some unique planes would be great!

i imagine it would ask the user for how many sides and how long each side would be. but then again i'm not so great at this coding business. the best i can do is a hopper turtle xD
What do you mean by unique planes?

#19 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 08 April 2013 - 06:28 AM

View PostKeridos, on 05 April 2013 - 07:00 PM, said:

Hexagons and Octagons are being added soonish, other shapes are too difficult (at least happydude said that on github).
I will be looking into GPS Support and inverted building in the next days. Command line interfacing will be added soon too.
Just to warn you: Minecraft is not very stable and even chunkloading turtles get unloaded sometimes (for a reason that I have not found yet) so do not expect long programs to run smoothly. At least not without GPS support.
If other n-gons are to be added, their patterns will need to be hard coded. I don't think this is worth it because shapes larger than octagons are (IMHO) just used to approximate circles, and we already have code that does circles. A triangle constructor might be nice though.

#20 lalophobia

  • New Members
  • 2 posts

Posted 08 April 2013 - 08:27 AM

View PostKravyn, on 28 March 2013 - 04:39 PM, said:

Is there a way I can trigger a sequence of build scripts back to back?
[]
a way to trigger the shapebuilder within my script. is it possible?

I'm not part of the project you're asking.. but surely you could brute force it.

open your project in notepad or something so you can edit it a lot easier as in the ingame gui

copy section of the code you need to functions within your code and make it read variable(s) for each shape you want built with it instead of actual input.

if you need two circles of different sizes make two functions with different variables .. etc





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users