After performing some tests of my own, I would say that the problem is that when the turtle attempts to move forward, it first disables the redstone output to the tile under it, then doesn't bother to re-enable it (by triggering another block update there) if it finds out that it can't complete the operation. Because redstone updates only occur every couple of server ticks and your turtle is coded to constantly attempt to move, you never see the redstone turn on at all.
Does that match your observations?Edit:
No, the above's wrong. But I reckon it's along the right track.
What I reckon's happening is that the turtle first goes forward, then before redstone can update and figure out that the signal's on, it turns it off again in order to move forward again. But it doesn't move forward again, because there's a block there.
So although the turtle ends up providing a signal to the redstone under it, the redstone updated when it was off, and no further block updates occur because the turtle isn't moving any more…
So why does the redstone come on as soon as the turtle stops attempting to move forward? Well, I reckon that's because the turtle is triggering block updates around it when the script ends!
Try this script to see what I mean; pressing a key to "stop moving" won't light the redstone, but pressing a key
after that to "exit the script" will!:
rs.setOutput("bottom",true)
print("Press any key to stop moving")
parallel.waitForAny(
function()
while true do turtle.forward() end
end,
function()
os.pullEvent("char")
end
)
print("Press any key to end")
os.pullEvent("char")
Edit 2:
Erg, that's not it either. Just doing this in the Lua console also fails:
turtle.forward() os.pullEvent("char")
… so the failed movement attempts have nothing to do with it. Ditto if you add extra os.pullEvent("char")'s to the line. No redstone update until the whole line resolves, even though the turtle successfully went forward and never failed a movement attempt.
It's like, the first time the turtle moves over redstone, it won't trigger a redstone update until the
next successful movement (including turning), or until the script ends. Why that would matter, I dunno, but that's how it's acting.
Edit many:
It's term.setCursorBlink() that triggers the update. When the script ends, or when the Lua console command completes, blinking is enabled and the redstone state beneath the turtle corrects itself.
This is probably because that same function toggles the animation that plays on the front of regular computer blocks. Turtles don't play that animation, but odds are some of that same code is triggering.
So, in a nutshell, when a turtle emitting a signal beneath itself first moves over redstone, it won't trigger the needed block update to light that redstone (or it might, but not at the correct time). Making the turtle move again or calling some other block-update-triggering function (such as term.setCursorBlink()) seems to correct things.