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

Turtle facing south placing ladders problem

Started by Diamond_anvil, 28 June 2013 - 06:48 AM
Diamond_anvil #1
Posted 28 June 2013 - 08:48 AM
Title: Turtle facing south placing ladders problem
N00b question:
How do I get ladder placement to work no matter what direction the turtle is initially placed?

I've been working on my first piece of Lua/CC Turtle code (yes it is yet another tower builder at the moment) and I am stumpped by the eratic behavior of this piece of code. For the life of me I can't seem to figure out how to get the ladders to always line up when I place them. From what I can figure out the ladders only seem to place properly when I set the turtle down facing south. I have no idea why or how to properly place the ladders so they always end up where I want them. This is just a working code fragment from a future larger project. Suggestions on how to handle users not following directions, the ability to pick up where it left off after a restart, and general code cleanup are very welcome.
To run the code place at least 10 buildable blocks (no sand, gravel, and the like) in the first 12 slots, 4 or more ladders in slots 13-15 and enough fuel to move 4 steps up in slot 16.
I haven't fully vetted the refueling code yet as I have been placing fueled up turtles for testing.
Thanks for any help/suggestions you may have

http://pastebin.com/Ecn5uarB

stuff that may be relevant: FTB Ultimate 1.4.7 v 1.1.2
Spoiler"modid" : "ComputerCraft",
"name" : "ComputerCraft",
"version" : "1.5",
"url" : "http://www.computercraft.info",
"credits" : "Type 'help credits' on an in-game computer",
"authors": [
"dan200",
"Cloudy"
Lyqyd #2
Posted 28 June 2013 - 12:46 PM
Split into new topic.

Certain placements are indeed a bit wonky. Your best bet is to find something that works and just use it, until the placement code is improved.
Diamond_anvil #3
Posted 28 June 2013 - 01:08 PM
Ugh… the hours I have spent tearing code apart and rewriting it to try and fix that very problem… I'm still hoping for some code cleanup suggestions and error ideas.
YardKing42 #4
Posted 02 July 2013 - 09:46 PM
I know that some objects follow the compass rule so they end up facing the same direction no matter which way the turtle was facing at the time.
On the bright side you could use this bug (assuming it is one) to find south!