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

placing rotated blocks with place/Up/Down()

Started by luaanon, 30 March 2013 - 06:18 PM
luaanon #1
Posted 30 March 2013 - 07:18 PM
In CC v1.5.2, turtles place most rotatable blocks (tested with pistons/logs/stairs) so that they're oriented opposite of the turtle's facing. In other words, most blocks always face the turtle when place() is used, and placeUp/Down() uses the same orientation as place().
There is no way in vanilla CC (that I'm aware of) for turtles to place these blocks oriented Up or Down.
Oddly, wood logs are always placed facing Up.

The only work-around I know of is to use the Prototype Omniwrench from Omnitools (via turtle.place()) when it gets updated.
It does have a major limitation: while it works with vanilla minecraft blocks, most rotatable mod blocks can't be rotated with it.

I propose adding a parameter to place/Up/Down() that specifies how the placed block should be oriented (if it can be). This would allow for a consistent method of placing rotatable blocks in all 6 directions, 2 of which are currently impossible. It would support all turtle placeable blocks whereas Omnitools only supports a small subset.

If there isn't a method in MC to directly rotate blocks, I imagine this would still be implementable by adjusting the fake player's orientation,looking vector, and/or other fiddly bits. It may require a block to be present in the proper spot for the rotatable block to be placed against.

Example parameter details:
  • If the parameter == 1, then rotate the placed block so that it faces the turtle (like how it does atm).
  • If the parameter == 2, then rotate the placed block so that it faces away from the turtle.
  • If the parameter == 3, then rotate the placed block so that it faces left from the turtle's facing.
  • If the parameter == 4, then rotate the placed block so that it faces right from the turtle's facing.
  • If the parameter == 5, then rotate the placed block so that it faces up.
  • If the parameter == 6, then rotate the placed block so that it faces down.
If no parameter is specified, default to 1. This prevents the proposed change from breaking existing scripts.
Lyqyd #2
Posted 30 March 2013 - 09:14 PM
The first parameter of turtle.place is already used for sign text, FYI.

On an unrelated note, I don't see this as being likely to happen.
Cloudy #3
Posted 31 March 2013 - 12:55 AM
Turtles do place stairs on the ceiling fine. I know, I've tested it. Pistons are a special case and are unlikely to be fixed without special casing.

Either way, we're not going to add a parameter as it just wouldn't make any sense.
luaanon #4
Posted 31 March 2013 - 02:18 AM
Fair enough. Was worth a shot.
L0laapk3 #5
Posted 03 July 2016 - 04:30 PM
I made an account just to second this. Currently there is not enough control ove the orientation of logs, many setups are not possible to build (think 2 droppers facing into eachother, pistons facing up/down(!)) or require other temporary blocks to be placed and removed.

However, In my opinion it would make more sense to have absolute instead of relative rotations, to match turtle.inspect().

Here is my suggestion:

similar to colors, add a global rotations object, containing up, down, north, east, south, west, also, each representing numbers.
allow this parameter to be passed to turtle.place(), turtle.placeUp() and turtle.placeDown(). If parameter is of type string then use it as sign text, if its a number then use it as rotation.

If no rotation is passed, use the default rotation system that is used now.
pofferman #6
Posted 05 July 2016 - 07:30 PM
I made an account just to second this. Currently there is not enough control ove the orientation of logs, many setups are not possible to build (think 2 droppers facing into eachother, pistons facing up/down(!)) or require other temporary blocks to be placed and removed.

However, In my opinion it would make more sense to have absolute instead of relative rotations, to match turtle.inspect().

Here is my suggestion:

similar to colors, add a global rotations object, containing up, down, north, east, south, west, also, each representing numbers.
allow this parameter to be passed to turtle.place(), turtle.placeUp() and turtle.placeDown(). If parameter is of type string then use it as sign text, if its a number then use it as rotation.

If no rotation is passed, use the default rotation system that is used now.
^+1