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

Turtle.turn And Chunk Unload

Started by Ordinator, 28 August 2013 - 03:46 AM
Ordinator #1
Posted 28 August 2013 - 05:46 AM
If the method turtle.turnLeft() (or right) is called and the chunk is unloaded before it returns, will the turtle be guaranteed to have finished the turn before the startup script is called when the chunk reloads?

I understand that turtle.forward / back may not complete if the chunk is unloaded but what about turtle.turnLeft / Right?

Also the same question for graceful server shut down: will the turtle get to the expected direction when the server restarts?

Sorry if this has been asked answered before. if so, I could not find it
jay5476 #2
Posted 28 August 2013 - 06:28 AM
I presume the way minecraft works is when a chuink loads and unloads it gets the previous unloaded state and tile entities, if its an unload I believe the turtle turns off immediately and only if the command was executed before the unload it will turn
Ordinator #3
Posted 28 August 2013 - 07:00 AM
I presume the way minecraft works is when a chuink loads and unloads it gets the previous unloaded state and tile entities, if its an unload I believe the turtle turns off immediately and only if the command was executed before the unload it will turn

When you call turtle.turnLeft(), visually the turtle takes time to turn. If the game is interrupted while this animation is playing, what direction does the turtle have when it restarts?

It's possible that the turtle block is instantly turned to the new orientation and what is seen in game is only a little animation. In this case the only thing that is interrupted in a crash is the animation and the turtle already has the new orientation.

It's also possible that the turtle block is turned after the animation completes in which case it would not have the new orientation.

So it could be either way depending on how the computeracft mod was implemented.

I was just wondering if someone who knows the code can definitively answer this.
Lyqyd #4
Posted 28 August 2013 - 10:54 AM
Turning always succeeds.
Ordinator #5
Posted 28 August 2013 - 01:01 PM
Turning always succeeds.

Best possible answer! Thanks for that!
jay5476 #6
Posted 28 August 2013 - 05:47 PM
yes I believe turning will always work because the game updates the turtle has turned then shows the animation? idk if im correct
PixelToast #7
Posted 28 August 2013 - 05:55 PM
the nbt data of the turtle changes, and while its loaded it will change its rotation