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

[1.4.6][SMP] turtle.place() sometimes places down vice forward

Started by arg, 06 January 2013 - 11:40 PM
arg #1
Posted 07 January 2013 - 12:40 AM
ComputerCraft Version: 1.4.6 (on a FTB Server / Direwolf20 pack)

I wrote a program that essentially draws pixel art using turtles. It does this column by column, starting from the bottom, moving upward, and calling turtle.place() to place the appropriate block.

Occasionally the block will be placed below the turtle instead of in front of it. It seems to happen randomly, and adding a 1 second delay between when it does the move and when it places the block didn't seem to help.

I have not been able to find a circumstance that causes it. It seems to happen about every 100 block places or so.

Searched forum and didn't find anything similar sounding.

Any info appreciated, thanks :)/>


Solved, extreme user stupidity :(/>
Edited on 07 January 2013 - 02:57 PM
PixelToast #2
Posted 07 January 2013 - 06:03 AM
thats weird .-.
try making the turtle use placedown instead
arg #3
Posted 07 January 2013 - 08:44 AM
thats weird .-.
try making the turtle use placedown instead

Unfortunately that would be impractical with my design, or at least require a major rewrite. The image is actually printed by multiple turtles, each responsible for a single material. If they placed blocks down, it would mean the turtles would have to travel in the drawing space, which would of course be filled with blocks placed by the turtles in front of them.

I'll play with it a bit more later, try to isolate it a bit. I tested same program in single player and it seems to work perfectly fine, so maybe has something to do with SMP/lag or something. I was skeptical because this seems like the kind of thing other users woulda noticed.. but it's very hard to picture this being a programming thing (the bot only ever calls turtle.place(), and it's very clear from where the block is missing and actually placed that it's as if the turtle did a place down.. )
Cloudy #4
Posted 07 January 2013 - 09:52 AM
Yeah, I can't see a reason how this would happen. What surface are they trying to place on?
Doyle3694 #5
Posted 07 January 2013 - 10:05 AM
Can you like add some screenshots and code you tried?
arg #6
Posted 07 January 2013 - 10:10 AM
Yeah, I can't see a reason how this would happen. What surface are they trying to place on?

Wool usually, though I've seen it happen when placing in "empty space" and stone.

Here is a picture of it occuring on stone: http://img37.imagesh...30104211236.png (bottom-middle ish where the stone juts out).
Edited on 07 January 2013 - 09:17 AM
arg #7
Posted 07 January 2013 - 10:16 AM
Can you like add some screenshots and code you tried?

http://img37.imagesh...30104211236.png (bottom-middle ish where the stone juts out).

I'll try to make some simplified code that reproduces the problem later. The code I'm using is still pretty rough (it kinda sprawled from another project, I plan on re-writing in a less-hackish way once I get it working smoothly). If your curious anyway: http://pastebin.ca/2299866
Edited on 07 January 2013 - 09:17 AM
Lyqyd #8
Posted 07 January 2013 - 11:28 AM
Why is line 282 a placeDown?
immibis #9
Posted 07 January 2013 - 01:29 PM
Why is line 282 a placeDown?
Yup. Your code calls placeDown instead of place when it switches inventory slots.
arg #10
Posted 07 January 2013 - 03:16 PM
.. well.. damn!

Thanks guys, and sorry for wasting time :S

Not sure how the hell this worked in single player though.. must have been an older version of the code or something (I move the code around quite a bit and it's actually generated via another script).. either way that's just painfully embarrassing (if it's any conciliation, I did spend a fair bit of time trying to duplicate the "problem" with of course absolutely no success) :S