Jump to content




Optional argument for turtle.place...()


10 replies to this topic

#1 Sebra

  • Members
  • 726 posts

Posted 10 October 2012 - 04: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.

#2 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 10 October 2012 - 05:21 PM

cant you do turtle.detect() before you attempt to place?

#3 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 10 October 2012 - 05: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().

#4 Sebra

  • Members
  • 726 posts

Posted 10 October 2012 - 06: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.

#5 BrolofTheViking

  • Members
  • 55 posts

Posted 10 October 2012 - 11:54 PM

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.

#6 ''''''''''''''''''''''''''

  • New Members
  • 2 posts

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.

#7 mehmattski

  • New Members
  • 1 posts

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!

#8 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 15 December 2012 - 01:05 PM

View Postmehmattski, on 15 December 2012 - 11:19 AM, said:

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!
Trophy get! Bump a very old thread.

#9 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 15 December 2012 - 01:26 PM

View PostHuman, on 15 December 2012 - 01:05 PM, said:

View Postmehmattski, on 15 December 2012 - 11:19 AM, said:

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!
Trophy get! Bump a very old thread.
It still hasn't been added, so why not?

#10 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 15 December 2012 - 01:31 PM

View Postimmibis, on 15 December 2012 - 01:26 PM, said:

View PostHuman, on 15 December 2012 - 01:05 PM, said:

View Postmehmattski, on 15 December 2012 - 11:19 AM, said:

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!
Trophy get! Bump a very old thread.
It still hasn't been added, so why not?
Good point. I believe I heard Cloudy in IRC talking about it though.

#11 Sebra

  • Members
  • 726 posts

Posted 15 December 2012 - 07:20 PM

And what was results of that talk? I hope he will answer. ;)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users