I know about optional "signText" argument. This problem is easily solvable if developers agree to add my suggestion.
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Optional argument for turtle.place...()
Started by Sebra, 10 October 2012 - 03:58 PMPosted 10 October 2012 - 05:58 PM
I want an optional argument for turtle.place…() functions to describe direction of block placed. If block cannot be placed in that particular direction then return false. Direction can be "top", "bottom", "left", "back",… or numerical.
I know about optional "signText" argument. This problem is easily solvable if developers agree to add my suggestion.
I know about optional "signText" argument. This problem is easily solvable if developers agree to add my suggestion.
Posted 10 October 2012 - 06:21 PM
cant you do turtle.detect() before you attempt to place?
Posted 10 October 2012 - 06:37 PM
Actually, we have most of that anyway…
turtle.place() returns false if you can't place it.
turtle.placeUp() and turtle.placeDown() takes care of two of your arguments right there. All you have to do is turn to one side, and they become turtle.placeRight() or turtle.placeLeft().
turtle.place() returns false if you can't place it.
turtle.placeUp() and turtle.placeDown() takes care of two of your arguments right there. All you have to do is turn to one side, and they become turtle.placeRight() or turtle.placeLeft().
Posted 10 October 2012 - 07:13 PM
Sorry for bad explaining.
Now turtle able to place a torch in the block in front of it. I want it to be able to select at which wall in that block should be torch attached. If I'm not mistaken now turtle place block at any side it can including itself.
Ability to place blocks above and below turtle is another functionality. I know about it.
Now turtle able to place a torch in the block in front of it. I want it to be able to select at which wall in that block should be torch attached. If I'm not mistaken now turtle place block at any side it can including itself.
Ability to place blocks above and below turtle is another functionality. I know about it.
Posted 11 October 2012 - 12:54 AM
Ah, I see what you're saying. You want to be able to pick which block a torch, redstone torch, button, or lever attaches to when you place it if there are multiple options… This would be useful I suppose… I just don't know what would be an effective method of implementing it.
Posted 08 December 2012 - 04:02 PM
I signed up to post about this but I found this thread so I'm bumping it instead. This is needed functionality because the only reliable way to accomplish this simple task right now is to destroy every nearby block that could potentially prevent the placement you want, which is extremely far from ideal.
A trivial situation in which the absence of such a feature can be an annoyance is a turtle mining a 1x2 tunnel that wants to place torches above itself at certain intervals. Said turtle repeatedly runs turtle.dig(), turtle.forward(), turtle.digUp(), and turtle.placeUp() to place a torch whenever necessary.
By default, it seems that when travelling along the z-axis in the world, the torches are placed on the wall higher on the x-axis, and second priority is the wall lower on the x-axis, which is fine for this situation as those torches are placed on the side walls. However, when travelling on the x-axis, the torches will be placed on the wall above and in front of the turtle. This is a problem because after the next turtle.dig(), turtle.forward(), turtle.digUp(), the block that was destroyed in the turtle.digUp() operation was supporting the torch, and now that torch is knocked off and torch item left sitting on the ground until it despawns.
If there were some way to control the direction of the placed torch (and other similar items), this trivial situation would be easily solved without forcing the turtle to repeatedly double back and hope that the effectively undefined direction (undefined from the turtle's perspective at least, as it doesn't know whether it's travelling along the x or z axis) that the torch ends up being placed with happens to result in the torch being attached to the wall.
A trivial situation in which the absence of such a feature can be an annoyance is a turtle mining a 1x2 tunnel that wants to place torches above itself at certain intervals. Said turtle repeatedly runs turtle.dig(), turtle.forward(), turtle.digUp(), and turtle.placeUp() to place a torch whenever necessary.
By default, it seems that when travelling along the z-axis in the world, the torches are placed on the wall higher on the x-axis, and second priority is the wall lower on the x-axis, which is fine for this situation as those torches are placed on the side walls. However, when travelling on the x-axis, the torches will be placed on the wall above and in front of the turtle. This is a problem because after the next turtle.dig(), turtle.forward(), turtle.digUp(), the block that was destroyed in the turtle.digUp() operation was supporting the torch, and now that torch is knocked off and torch item left sitting on the ground until it despawns.
If there were some way to control the direction of the placed torch (and other similar items), this trivial situation would be easily solved without forcing the turtle to repeatedly double back and hope that the effectively undefined direction (undefined from the turtle's perspective at least, as it doesn't know whether it's travelling along the x or z axis) that the torch ends up being placed with happens to result in the torch being attached to the wall.
Posted 15 December 2012 - 11:19 AM
I also was confused why my branch mining program was placing torches in its own path even when I told it to turn right before turtle.placeUp()
Put me on board for this feature request!
Put me on board for this feature request!
Posted 15 December 2012 - 01:05 PM
Trophy get! Bump a very old thread.I also was confused why my branch mining program was placing torches in its own path even when I told it to turn right before turtle.placeUp()
Put me on board for this feature request!
Posted 15 December 2012 - 01:26 PM
It still hasn't been added, so why not?Trophy get! Bump a very old thread.I also was confused why my branch mining program was placing torches in its own path even when I told it to turn right before turtle.placeUp()
Put me on board for this feature request!
Posted 15 December 2012 - 01:31 PM
Good point. I believe I heard Cloudy in IRC talking about it though.It still hasn't been added, so why not?Trophy get! Bump a very old thread.I also was confused why my branch mining program was placing torches in its own path even when I told it to turn right before turtle.placeUp()
Put me on board for this feature request!
Posted 15 December 2012 - 07:20 PM
And what was results of that talk? I hope he will answer. ;)/>