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

Add more turtle.turn directions

Started by bobiniki, 27 March 2013 - 07:35 AM
bobiniki #1
Posted 27 March 2013 - 08:35 AM
What?
I want to suggest to change turtle.turnLeft/Right function to turtle.turn(direction) or just add more turtle.turnUp/Down. In either way I would like to pitch,yaw and roll the turtle.

Why?
Because I want full support of 3D turtle graphics and being able to easily implement L-systems and such. I suggest instead of having 3 pairs of functions like dig, digUp and digDown, to have just one dig function that digs in front of the turtle depending on its current orientation.

That said, I have another suggestion and that is to change most of the functions like forward, backward etc. to be merged into one function move(direction) (like peripherial.wrap(direction)) and use this direction style everywhere.

I hope I was clear enough and you understand the need of such improvement. After all turtles are inspired by turtle graphics and as such they should behave that way.
Sammich Lord #2
Posted 27 March 2013 - 08:38 AM
Why would they want to change they way existing systems work? This will break plenty of working scripts.
bobiniki #3
Posted 27 March 2013 - 08:45 AM
Why would they want to change they way existing systems work? This will break plenty of working scripts.

Because there is no way you can do L-systems which are core concept of turtle graphics. And I said that it is not necessary to change them, but add more turtle.turn functions. Like turtle.turnUp() and turtle.turnDown()
Kingdaro #4
Posted 27 March 2013 - 09:23 AM
Holy christ that's really complicated.
Xfel #5
Posted 27 March 2013 - 09:52 AM
Well, a turtle cannot face up or down, so these functions wouldn't be of any use. If you really need it, implement yourself.
bobiniki #6
Posted 27 March 2013 - 09:55 AM
Well, a turtle cannot face up or down, so these functions wouldn't be of any use. If you really need it, implement yourself.

Currently it can't face up/down. That's what I want to be implemented. I can't do it myself with the current functions.
Sammich Lord #7
Posted 27 March 2013 - 10:00 AM
Why would it need to place up and down due to the current functions being able to interface with the blocks that are below and above it anyway?
Lyqyd #8
Posted 27 March 2013 - 10:08 AM
I'm having trouble thinking of a final result that is not achievable with the current system of turtle movements and facing directions. I don't think you have sufficiently explained/justified this idea. As far as I can tell, you are simply trying to offload some of the work of creating whatever system you envision onto the mod developers. Is there a simple and succinct explanation that justifies breaking the existing movement system like you suggest? From what I can see, this sort of thing can already be accomplished with a tricky wrapper API that would track the imaginary facing direction and execute actual movements, rotations and placements accordingly.
Cloudy #9
Posted 27 March 2013 - 10:12 AM
There's no chance of this happening. It just wouldn't fit in with Minecraft, which is why I assume it doesn't mirror the Logo turtle API exactly. It is also completely necessary, considering you can move up/down/forward/backward using commands, and by turning left can move also.

Your other changes that you want, where you want the turtle movement behaviour functions to change - that is definitely not going to happen. We are not going to break all the existing scripts for something that you can easily replicate in Lua code yourself.
bobiniki #10
Posted 27 March 2013 - 10:12 AM
Why would it need to place up and down due to the current functions being able to interface with the blocks that are below and above it anyway?

Because I want real turtle graphics. The problem isn't not being able to place blocks up/down. See wikipedia for turtle graphics.

For example you start with normally orientated turtle. Then you type turtle.turnUp() then the turtle looks up. Then if you type turtle.forward() the turtle moves straight up. Then you can type turtle.turnUp() and the turtle turns with it's face backward. And if you type turtle.foreward() again, the turtle moves backward(the initial orientation).
Pinkishu #11
Posted 27 March 2013 - 10:15 AM
Why would it need to place up and down due to the current functions being able to interface with the blocks that are below and above it anyway?

Because I want real turtle graphics. The problem isn't not being able to place blocks up/down. See wikipedia for turtle graphics.

For example you start with normally orientated turtle. Then you type turtle.turnUp() then the turtle looks up. Then if you type turtle.forward() the turtle moves straight up. Then you can type turtle.turnUp() and the turtle turns with it's face backward. And if you type turtle.foreward() again, the turtle moves backward(the initial orientation).

and why exactly does it have to "turn up", then move forward instead of just moving upwards?

you dont nee dthe turtle to visually turn anyway you can just save the current orientation and make a turnUp function that changes it
then when you call forward it check wheres it pointing and moves that way
lieudusty #12
Posted 27 March 2013 - 11:01 AM
Sounds complicated…
Cranium #13
Posted 27 March 2013 - 11:27 AM
This is ridiculously overcomplicated and useless. There is no practical application that turtles would be in that would require this change. If you want it to go up, then just go up. Why make it so freaking hard?
If you want "turtle graphics", then just make your own API to track the imaginary facing. Everything that is described on the Wikipedia page you linked is currently possible with the way that turtles are implemented now. There is no reason to break everything just for the sake of convenience for one proposed task.
Dlcruz129 #14
Posted 27 March 2013 - 11:36 AM
I'm not too fond of this idea. First, it's unnecessary. Second, the engine is on the bottom of the turtle; therefore it would be unable to hover.
bobiniki #15
Posted 28 March 2013 - 08:35 AM
Thanks for the feedback. Now I will eventually try to implement such functionality as CC API.

Thanks again!