16 posts
Posted 31 August 2012 - 12:22 AM
Would is it be possible to program a mining turtle to follow you around? I think this would be really cool
209 posts
Location
In your fridge.
Posted 31 August 2012 - 12:32 AM
No. There is no API for mob detection, if it runs into you or a zombie, it can't tell the difference, nor can it tell whether it's a mob or a block. With the addition of Melee Turtles, dan200 might add API's to allow this, but I can't tell you, as I'm not on the team. It would be quite helpful though.
Why don't you post such API's as a suggestion? There's a spot on these forums just for those, and I personally would like to see something like that.
1548 posts
Location
That dark shadow under your bed...
Posted 31 August 2012 - 08:37 AM
use the CCsensors mod to detect your player ID's location and use a GPS satellite so the turtle can navigate there
137 posts
Location
the Netherlands
Posted 31 August 2012 - 11:50 AM
if it runs into you or a zombie, it can't tell the difference, nor can it tell whether it's a mob or a block.
Well, it can tell the dif between blocks and mobs, here is the pseudocode:
if turtle.detect() then
print("This is a block")
else
if turtle.forward() then
turtle.backward()
print("This was empty space")
else
print("Something is blocking the way, that isnt a block")
end
end
This way I had programmed a 'dog' program months ago. Which you could control by standing in the way.
209 posts
Location
In your fridge.
Posted 31 August 2012 - 12:01 PM
Well, it can tell the dif between blocks and mobs, here is the pseudocode:
if turtle.detect() then
print("This is a block")
else
if turtle.forward() then
turtle.backward()
print("This was empty space")
else
print("Something is blocking the way, that isnt a block")
end
end
This way I had programmed a 'dog' program months ago. Which you could control by standing in the way.
I suppose that works. Provided you don't mind moving forward one block at a time, while there's creepers about. A turtle detecting in a five-block radius would be far more efficient, no? Not to mention any entity would do that, and as you said, it's pseudocode, it only tells in a roundabout fashion. But kudos for figuring that out, nevertheless.