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

[1.4] some turtely ideas

Started by tetrapack25, 07 July 2012 - 09:24 PM
tetrapack25 #1
Posted 07 July 2012 - 11:24 PM
1. Cameras for turtles (and stationary computers?)
The camera would be a (very expensive) module that could be crafted onto the turtle just like the modem. It would give the turtle/computer a visual range of 10 blocks and a field of view of 90°:


0 1 2 3 4 5 6 7 8 9 10  Z

_ _ _ _ _ _ _ _ _ _ _ _  X
_ _ _ _ _ _ _ _ _ _ # _  9
_ _ _ _ _ _ _ _ _ # # _  8
_ _ _ _ _ _ _ _ # # # _  7
_ _ _ _ _ _ _ # # # # _  6
_ _ _ _ _ _ # # # # # _  5
_ _ _ _ _ # # # # # # _  4
_ _ _ _ # # # # # # # _  3
_ _ _ # # # # # # # # _  2
_ _ # # # # # # # # # _  1
@ # # # # # # # # # # _  0
_ _ # # # # # # # # # _  -1
_ _ _ # # # # # # # # _  -2
_ _ _ _ # # # # # # # _  -3
_ _ _ _ _ # # # # # # _  -4
_ _ _ _ _ _ # # # # # _  -5
_ _ _ _ _ _ _ # # # # _  -6
_ _ _ _ _ _ _ _ # # # _  -7
_ _ _ _ _ _ _ _ _ # # _  -8
_ _ _ _ _ _ _ _ _ _ # _  -9
_ _ _ _ _ _ _ _ _ _ _ _

_ = Not visible block
@ = Turtle
# = Visible block

So instead of


turtle.compare()

you could also type


turtle.compare(-6,4,9)

which would compare the block with the coordinates X=-6 Y=4 Z=9 (0,0,0 being the turtle as shown above) with the block in the selected inventory slot. As already said this would also be useful as a peripheral for stationary computers as a security system or even a web cam if it could detect entities. Which brings me to the next topic:

2. Detecting entities :)/>/>
Well guess what… enabling turtles to detect entities. For example


turtle.detectEnt()
turtle.detectEntUp()
turtle.detectEnt(-6,4,9)

detects if there is an entity in front of/above the turtle/at -6,4,9.
It could also compare entities like this:


turtle.compareEnt("pig")

or get another players user name:


turtle.getName()

this function would return the name of the player in front of the turtle or at the specified coordinates.
Together with the camera this would open a crap load of new possibilities for adventure maps, trading turtles, combat turtles…. wait… just some TNT giving the player/mob 4 seconds to run away doesn't really make a combat turtle does it? Well off to the next topic:

3. Emulating keys
Basically instead of crafting a diamond pick onto a turtle the turtle should be able to emulate left and right clicks with the selected item (maybe even all the other keys like E to pick up a block with the portal gun from the portal gun mod). So for example to mine a block of obsidian the turtle would select a diamond pick and then use


turtle.key("m1",9.4)

to hold mouse 1 for 9.4 seconds. Then he would only need a way to pick up the obsidian block laying on the groung. As already mentioned this would make it possible to use turtles in combat as this would also work with swords, bows, bricks (with the throw that brick mod. Shame on you if you didn't know about is!) and of course ROCKET LAUNCHAS form SDK's mod! However this would require more precise aim than just turning 90°. So for example


turtle.aim(45,-45)

would make the turtle aim at the lower left corner of his field of view because the first argument is the angle between the new line of sight and the default line of sight (aiming straight forward) when looking down on the turtle (counter clockwise). The second argument is the angle between the new and default line of sight when looking at the right side of the turtle (also counter clockwise). The aiming does not affect the turtles field of view. the only way to do so is to rotate the turtle it self. A camera is not required for aiming. Also because the turtles would have to carry different tools, weapons and arrows they would definitely need some more inventory slots (maybe some tool only slots).

4. Cables
As already suggested a dudejillion times: CABLES!!! to connect the computer to peripherals similar to the ribbon cables from red power 2. Maybe you could even attach a modem to the peripherals and then connect them to the computer via wi-fi. The computers should have a program by default which would scan the surrounding area for wireless peripherals and make it possible to connect to them.

5. Upgrade slots
I never really liked the way you have to craft modules like picks or modems onto turtles mainly because you cant remove them and if you upgrade a turtle you have to back up all the data he has stored (correct me if I'm wrong). Instead they should have some separate slots in their GUI where you could place or pump in the modules via build craft/red power pipes. Not sure if a turtle should be able to up/downgrade itself if it has the modules in its inventory but other turtles definitely should (explained below).

6. Interacting with GUIs
For example to move 32 blocks of cobble stone into a chest the turtle would first select the cobble then emulate a right click on the chest (as explained above) and then use something like


turtle.place(32,1)

which would move 32 of the selected item to slot 1 of the chest. or


turtle.get(10,2)

to move 10 of the items in slot 2 of the chest to the selected slot (or the next available slot if the selected slot is full). Same for furnaces or workbenches (because crafting table is for babies!). The turtles should also be able to interact with text boxes and buttons in GUIs form other mods. Not sure if all this should require an extra module.


That's it for now. If you have more ideas feel free to post them below. If I get the permission I would even like to help realizing these suggestions (at least as an addon).
Mendax #2
Posted 10 July 2012 - 01:30 AM
I guess a turtle could need a CPU that you can take out, or a memory chip…
juanitierno #3
Posted 11 July 2012 - 04:53 PM
My first post:

Turtles DESPERATELY need:

1) a way to find out wich direction they are facing.
2) a way to accurately and easily find out their own location.

I feel for anything complex, keeping track of turns and trying to use the (in my limited experienced) buggy and complicated GPS are no-go.

Thanks!
Cloudy #4
Posted 11 July 2012 - 05:02 PM
GPS is not buggy, nor complex. You simply put some base stations down, making sure to give them correct locations, then gps.locate() should return the location on a wireless turtle.
juanitierno #5
Posted 11 July 2012 - 07:44 PM
I wont say i positively didnt make a mistake, but i set up 4 computers with modems, making sure none shared an axis, then tried to write a simple move program but on each step the gps readings where not coherent, for exmaple:

100,100,65
move 1 step

103,102,65
move 1 step

104,100,65
move 1 step

107,105,65
move 1 step

etc.

Ill try writing the simplest program and see if i can reproduce :)/>/>
Cloudy #6
Posted 11 July 2012 - 07:47 PM
There must have been a mistake in the hosting - it uses maths which should be consistent every time.
juanitierno #7
Posted 11 July 2012 - 08:41 PM
re-checked and apparently GPS works fine, must have made a boo-boo in the setup.

Still, turtles as mobile robots should know where they are, that way you can take them far away from the GPS setup and they would still work. Far more advanced programming would be possible with less dependencies.
tetrapack25 #8
Posted 11 July 2012 - 10:00 PM
I actually like the GPS thing because it's more realistic and WAAAAAY MORE BALANCED than just magically outputting the coordinates. This system gives you a challenge to work around its limits. For example you could make the turtle save his coords to a text file every move. Or make the turtle place down GPS servers on its own every [whatever the range of a modem is] Blocks. Or…
However your right with your first idea: A way to find out the direction they are facing would be really nice. Maybe they would have to have a compass in their inventory and selected to do that…
What brings me to a new Idea: what about making them able to interpret maps? You would place a map into their inventory and they would know the coordinates and material of every block seen on the map (only the surface). so you could type something like


turtle.compare(176,35)

assuming the highest block at X=176 and Z=35 is visible on the map and the turtle knows its own coordinates (or maybe the coordinate system is centered on the turtle?). I'm not sure if turtles should be able to edit maps but it would be definitely really nice for printing.
Aquilamo #9
Posted 16 July 2012 - 11:24 AM
For access to a chest you can use RP2 machines (transposer/filter/retriever)
Xfel #10
Posted 16 July 2012 - 06:08 PM
Or you can use the programmable devices from the ARP peripherals. They also have to be placed first, but at least you can program the filter. If dan add turtle extensions, the peripherals will definetely be usable as one.
Cyclonit #11
Posted 18 July 2012 - 12:22 PM
1. Cameras for turtles (and stationary computers?)

I like this idea a lot and hope someone will implement this as soon as peripherals for turtles are available (1.4). A LOS restriction should be added though.
Pinkishu #12
Posted 18 July 2012 - 01:14 PM
re-checked and apparently GPS works fine, must have made a boo-boo in the setup.

Still, turtles as mobile robots should know where they are, that way you can take them far away from the GPS setup and they would still work. Far more advanced programming would be possible with less dependencies.

just use your own movement functions which keep track of the position and facing?
Xfel #13
Posted 18 July 2012 - 04:42 PM
The problem happens if the turtle gets unloaded while moving. Then, you don't get whether the movement was successful or not, as the turtle_success/turtle_failure event just disappears. So you can't be shure about coordinates any more!
Pinkishu #14
Posted 18 July 2012 - 06:52 PM
there are turtle success/failure events? Oo
MysticT #15
Posted 18 July 2012 - 07:56 PM
there are turtle success/failure events? Oo
Take a look at the turtle api (in rom/apis), it just calls the native function and waits for one of those events (wich are triggered when the movement, dig, etc. is completed).