r/ComputerCraft • u/MerlinLikeTheWizard_ • Sep 22 '22
I made self Replicating Turtles!
https://youtu.be/MXYZufNQtdQ1
u/stick_404 Sep 22 '22
I just have to say this is super impressive! And after watching a few older videos of yours, are you planing to make a fully autonomous bot base?
3
u/MerlinLikeTheWizard_ Sep 22 '22
Yep! In my wild dreams I am picturing something very like that. Though I would just add "fully autonomous expanding bot base."
1
u/Lower_Practice2564 Oct 10 '22
Hello Sir, if you wouldn't mind, I have some questions?
I had given up on this project, seeing it as impossible, for a number of reasons. One is that, in my version, a mining turtle could not aquire wood, only an axe turtle could, and also I do not recall turtles being able to craft anything at all? Are you using a different version which allows mining turtles to craft/ collect wood?
I found turtles quite obnoxious about randomly turning off. When they do this, they tend to be in some obscure and essentially impossible location when they are turtles whom I have given some autonomy. Do you have a work-around for this issue, or do turtles inherently de-activate somewhat randomly?
I noticed the one turtle literally turned on another turtle, can turtles use turtles?
Thank you. This is a project I always wanted to do. I have built autonomous turtles in the past and used them to procedurally generate bases for me, however, I always thought a project of this complexity, where a turtle can 'survive' like this was out of the scope of ComputerCraft!
1
u/MerlinLikeTheWizard_ Nov 22 '22
Great questions!
In the version I was using (CC: Tweaked for 1.18), mining turtles can mine wood, and crafty turtles can be made using a crafting table. I thought this was the case in all versions, but maybe you were using one I'm not familiar with.
Yes, it's true turtles turn off when in unloaded chunks, and this was a problem. My (slightly cheating) workaround was to write a data pack to continuously load them in, or otherwise to follow them as the player.
Yes! If I remember right, turtles can use peripheral.call('bottom', 'turnOn') to switch turtles / computers on. They then run startup.lua from any neighboring disk drive. This was the big feature that allowed the whole program to be possible in the first place, and I was so happy when I found it.
Thanks, it was fun putting all the pieces together to make it work.
1
6
u/fatboychummy Sep 22 '22
Nice, self replicating turtles are always cool to see.
I also see you do tutoring for CC... Never thought I'd see that honestly, haha.
As an aside, had a cursory glance (at work, don't have a lot of time to look atm) around your code there, I will say that you definitely need to
localize things. I see a few locals in there, but it's a good practice tolocalize every variable you use in Lua.