Jump to content




[Remove] 11X11 House Builder!


20 replies to this topic

#1 RandomShovel

  • Members
  • 18 posts

Posted 18 November 2012 - 03:58 AM

Hello! This is a program I've made, it makes a 11 x 11 sized house! Thus far, there are 3 codes.
  • One makes a 11 x 11 sized house, without decorations!
  • One makes a 11 x 11 sized house, with decorations!
  • One makes a 11 x 11 sized house, but can do decorations, or no decorations!
:D

Pictures?
Spoiler


It's code is lengthy, because i'm new to lua, and I don't know of a shorter way of writing it. If you like the code, here is the pastebin link.

The codes:
Spoiler


Change log:
Spoiler

Upcoming Features:
Spoiler


If someone wants to edit it, post the edit to this post.

Your welcomed to look at this code and fix. As I said before I am somewhat new to lua, and am still getting used to new stuff. Hateful posts are not welcomed, and I will not take them lightly! If you do edit this code, or fix it, you MUST post it in the forum! Note: The change log is about the post, and the code. It will always be about both!

Thank you for looking at this post, have a nice day :) !


#2 yamidarkstar

  • New Members
  • 6 posts

Posted 26 November 2012 - 08:54 PM

for some reason it builds the house frame for me then does the decorations and windows next to the house instead of part of it

#3 RandomShovel

  • Members
  • 18 posts

Posted 26 November 2012 - 09:43 PM

That's odd. It works for me, i can't test or fix this because my computer is broken. What version of minecaft are you using? Was there anything blocking it's way at any point?

#4 yamidarkstar

  • New Members
  • 6 posts

Posted 02 December 2012 - 05:14 AM

I'm using 1.4.5 and was building on a superflat map to test it out

#5 Ikkalyzte

  • New Members
  • 58 posts

Posted 02 December 2012 - 06:35 PM

Direwolf fan? :D
Anyway, if you're looking to clean up the code, use "for" loops. It seems you're already familiar with them, so just use them whenever possible.
Also, you seem to have unnecessary functions. Instead of having two "row" functions, you could use implement them in the "floor" function, just having it do it all at once.
Finally, your slot selection is pretty interesting... you could replace all the functions that select the same type of block with a single one. Do you know how to pass arguments yet?

Anyway, good start. Keep learning. It'll get cleaner :)

#6 RandomShovel

  • Members
  • 18 posts

Posted 03 December 2012 - 04:04 AM

Thank you for that note, when I can test these edits i'll post the new code. As for the decorations not being in the house, the code is the same as when it worked for me. I even made some of the code in 1.4.5 and 1.2.5

#7 Expenox

  • Members
  • 137 posts
  • LocationIn the depths of my computer.

Posted 09 December 2012 - 12:01 PM

Nice, always nice to see new turtle programs!

#8 RandomShovel

  • Members
  • 18 posts

Posted 16 December 2012 - 03:32 PM

View PostIkkalyzte, on 02 December 2012 - 06:35 PM, said:

Finally, your slot selection is pretty interesting... you could replace all the functions that select the same type of block with a single one. Do you know how to pass arguments yet?

After a few rereads, I understood what you were saying, and I put them in 1 function per block.

#9 RandomShovel

  • Members
  • 18 posts

Posted 16 December 2012 - 03:51 PM

View Postyamidarkstar, on 26 November 2012 - 08:54 PM, said:

for some reason it builds the house frame for me then does the decorations and windows next to the house instead of part of it

I tested this and it works fine, I can't find a problem like this.

#10 Dusty_Rebel

  • Members
  • 57 posts

Posted 05 January 2013 - 05:40 PM

Love It!

#11 RandomShovel

  • Members
  • 18 posts

Posted 06 January 2013 - 05:22 AM

View PostDusty_Rebel, on 05 January 2013 - 05:40 PM, said:

Love It!

Thanks!

#12 thetravis0916

  • Members
  • 3 posts

Posted 08 January 2013 - 05:34 AM

I love it but mine got off some is it because of the grass?

Attached Thumbnails

  • Attached Image: OFF.jpg


#13 RandomShovel

  • Members
  • 18 posts

Posted 08 January 2013 - 02:08 PM

View Postthetravis0916, on 08 January 2013 - 05:34 AM, said:

I love it but mine got off some is it because of the grass?

Yes, that is something I forgot to check on... It will be fixed soon [ Already fixing ( Will be released before today ends (( Well for me that is )) )]

Update: House with decorations isn't freaking out over grass anymore, reduced the wait time on the floor, and a bit of work to fix the Non-Decor. program. That's just comparing the codes though then testing :). Delete the old one, and use the new ones.

#14 lokilotus

  • Members
  • 13 posts

Posted 19 January 2013 - 10:42 PM

Hey,

2 things...

1) I edited the decorated code so it asks you whether or not you would like to continue when starting up, and it waits for user input to start- will put code in a pastebin for you. :)

2) Where should the turtle start, e.g. top left at the front of the house nearest the door, bottom right on the right hand side (when facing the door) ETC? the OP doesn't make it clear.

Thanks!

-Loki

Code Pastebin: http://pastebin.com/eBQmXtgB

#15 RandomShovel

  • Members
  • 18 posts

Posted 20 January 2013 - 10:46 AM

View Postlokilotus, on 19 January 2013 - 10:42 PM, said:

Hey,

2 things...

1) I edited the decorated code so it asks you whether or not you would like to continue when starting up, and it waits for user input to start- will put code in a pastebin for you. :)

2) Where should the turtle start, e.g. top left at the front of the house nearest the door, bottom right on the right hand side (when facing the door) ETC? the OP doesn't make it clear.

Thanks!

-Loki

Code Pastebin: http://pastebin.com/eBQmXtgB

Thanks! Mind if I were to add this to the post? The turtle starts the house at the lower left, at the front of the house.

#16 lokilotus

  • Members
  • 13 posts

Posted 22 January 2013 - 01:24 AM

View PostRandomShovel, on 20 January 2013 - 10:46 AM, said:

View Postlokilotus, on 19 January 2013 - 10:42 PM, said:

Hey,

2 things...

1) I edited the decorated code so it asks you whether or not you would like to continue when starting up, and it waits for user input to start- will put code in a pastebin for you. :)

2) Where should the turtle start, e.g. top left at the front of the house nearest the door, bottom right on the right hand side (when facing the door) ETC? the OP doesn't make it clear.

Thanks!

-Loki

Code Pastebin: http://pastebin.com/eBQmXtgB

Thanks! Mind if I were to add this to the post? The turtle starts the house at the lower left, at the front of the house.

Yeah, that's cool :) It's not the cleanest edit I've done (not that I've done many) but it gets the job done :D I found that too, except my turtle decided to build like it was outset one block... More testing on my end needed for proper placement methinks. I'll have a look at it today and see if I can determine anything funky up with the code. :)

#17 RandomShovel

  • Members
  • 18 posts

Posted 22 January 2013 - 04:15 AM

View Postlokilotus, on 22 January 2013 - 01:24 AM, said:

View PostRandomShovel, on 20 January 2013 - 10:46 AM, said:

View Postlokilotus, on 19 January 2013 - 10:42 PM, said:

Hey,

2 things...

1) I edited the decorated code so it asks you whether or not you would like to continue when starting up, and it waits for user input to start- will put code in a pastebin for you. :)

2) Where should the turtle start, e.g. top left at the front of the house nearest the door, bottom right on the right hand side (when facing the door) ETC? the OP doesn't make it clear.

Thanks!

-Loki

Code Pastebin: http://pastebin.com/eBQmXtgB

Thanks! Mind if I were to add this to the post? The turtle starts the house at the lower left, at the front of the house.

Yeah, that's cool :) It's not the cleanest edit I've done (not that I've done many) but it gets the job done :D I found that too, except my turtle decided to build like it was outset one block... More testing on my end needed for proper placement methinks. I'll have a look at it today and see if I can determine anything funky up with the code. :)

Well, until it's fix, it won't be posted. That's all I can say. Possibly finish the experimental code since I'm bored xD.

#18 lokilotus

  • Members
  • 13 posts

Posted 23 January 2013 - 05:40 AM

That's cool, my game's lagging out a lot with my texture pack ATM- will have to switch to vanilla textures for now. Will have something done by tonight hopefully, a good way to relax after my Chemistry Exam :D



EDIT 1, 23/01/13: Ok. Test 1 conclusion: Weird program is weird. Then again, it did make a nice art deco design. Then again, was not creeper-proof or habitable in any way. More tests needed.

Edited by lokilotus, 24 January 2013 - 06:09 AM.


#19 lokilotus

  • Members
  • 13 posts

Posted 26 January 2013 - 02:24 AM

Alright. This time it worked perfectly. Odd. I haven't changed a thing within the code, except added the yes/no functionality... So weird. I think the base program in general needs more testing. Hmm. I'll see if I can spot anything,

#20 dissy

  • Members
  • 181 posts

Posted 24 February 2013 - 07:16 AM

I've noticed a couple problems, and a couple places where it could be improved.

First, documentation! Probably the worst was the turtle inventory needs. What's listed in the post here, what the program requests, and what the program actually ends up using are all different - specifically for the "decor" parts.

Which leads to the first problem. Of course I simply placed the turtle on the ground and started to run it. It was not stated the turtle must be one block above the ground, or that you must dig out a 11x11x1 "plot" for it to build in.
Instead, it started to dig up dirt blocks to make room for the floor, however the turtle also picked up these dirt blocks and once the first slot was empty that is where they went. It then proceeded to build part of the floor out of dirt.

Then, it built solid walls using slots 3-6, finished the house, and after placing some furniture it went back inside to dig back out the walls it just placed to make windows. I should note the turtle stopped just before placing the ceiling blocks to request I add in more blocks... Only to later obtain the blocks it needed from the walls it shouldn't have placed.

Then the block pickup problem happened, and instead of placing glass for the windows, it was placing the blocks it just broke out of the walls a moment before...

I would suggest that when building the walls, simply leave the gaps open for where the windows will go. This way it won't need refilling to build the ceiling, and won't need to do 3x the work (place wall, break wall, place glass)

Another suggestion is to first display a message about fueling up, say "If your turtle needs fuel, place X coal in slot 1 and hit enter to refuel"
Upon hitting enter, it uses the full stack in slot 1 to fuel.
Then clear the screen and prompt to fill it with blocks, with a "Hit enter to begin" message at the end so the turtle doesn't run off and out of reach while you are still filling it up with blocks.

The only thing I can think of for the dropped block pickup problem would be to keep track of the slot number its on and not move backwards.
What I mean is, for example floors are slots 1-2. Once it uses up slot 1 and moves to slot 2, blocks it picks up will end up in slot 1. Once it moved to slot 2, it shouldn't go back to slot 1 even if there are now blocks in it. Same with the walls in 3-6 and glass in 7-9.
I wish turtles had better inventory management built in ;}

Despite the few small issues, this program is still great and has a lot of potential. Thank you, and good work!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users