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

[1.31+] Turtle digital compass

Started by Neowulf, 16 March 2012 - 03:33 PM
Neowulf #1
Posted 16 March 2012 - 04:33 PM
Pretty simple, give turtles (and PDAs/laptops if they get implemented) a function that returns the current heading. 1 for north, 2 for east, 3 south, 4 west.

It would be useful in areas not covered by your GPS network, and even in areas of GPS coverage as a way to save on the vector calls or if moving your turtle forward to test it's heading is not desirable.
Jan #2
Posted 16 March 2012 - 06:47 PM
Something like this maybe:

turtle.readCompass()
When there is no compass in the inventory of the turtle, it returns false (or nil or -1).
When there is a compass, it gives you the direction you are facing (f=0,1,2,3) as seen on the debug screen (F3)

(and maybe an override-option in the configs, so you can even use the compass if there is no compass in the inventory)
Sebra #3
Posted 16 March 2012 - 07:03 PM
I want such compass. For turtle at least.
Neowulf #4
Posted 16 March 2012 - 07:15 PM
I'd prefer changing the turtle recipe to add it, swapping the top middle iron ingot for a compass. It would only add 3 more iron and 1 redstone to the final turtle requirements.
Bard #5
Posted 17 March 2012 - 02:20 PM
Or you could add let's say 4 upgrade slots (or more or less) where you can put upgrades in the same way IC2 machines work, that way anyone could code them as addons too.
And each upgrade would edit some part of the turtle or add functions to it.
Compass could be one of them, maybe building the upgrade item with a compass and 4 pieces of redstone.
Sebra #6
Posted 17 March 2012 - 02:39 PM
"top", "right", "left", "front" slots? With Pickaxe and Modem as a upgrades too.
Back and bottom sides are used by "engine".
Xfel #7
Posted 18 March 2012 - 08:39 AM
That's a very good idea. This would enable the community to write extensions for turtles, too.
Bard #8
Posted 19 March 2012 - 01:03 AM
"top", "right", "left", "front" slots? With Pickaxe and Modem as a upgrades too.
Back and bottom sides are used by "engine".

Yeah, like this all the stuff the community seems to be wanting lately could be added as turtle-upgrades.
You use right-left slots for tools, like the pickaxe, a block-id analyzer, an item vacuum, a lamplight (since turtles are blocks it should work right?) whatever
Top gets any kind of sensors, like the Compass
Back gets utility stuff like expanded inventory, a tank for liquids, modem, whatever.

Then… just an idea (sorry for the OOT), three/four internal slots. Normal turtles come out with an "All Purpose Movement System" that occupies all four of them that lets the turtle fly and all, like usual.
Except you can remove it and place other smaller kinds of engines (like a land-climb one that only uses two slots, or a railroad-bound engine that uses only one), so you get 2-3 free slot to add more mods of any kind (except tools)
passinglurker #9
Posted 19 March 2012 - 02:04 AM
i find the compass idea logical cause minecraft already has a compass item we can use in the recipe. so basically its hard to explain why a turtle doesn't have a compass?