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

[1.4/1.5] Add mob detection to turtles

Started by RavynousHunter, 25 August 2012 - 04:04 AM
RavynousHunter #1
Posted 25 August 2012 - 06:04 AM
Basically, having attack turtles is great, but I haven't found a way yet to have one that can detect mobs near it, perhaps via a craftable upgrade (like modems). I was thinking something along the lines of…


-- Detects mobs on a given side of the turtle.
-- Returns mob name, ie: "Creeper," or "Zombie."
detectMob(side)
  -- mob detection code
end

With that, I envision players being able to create sentry turtles to guard their houses, quarries, what have you. Also, if having it being able to detect mobs outright is a bit too meta, you could teach it about different mobs by putting a drop unique to a given mob in its inventory and running a program that lets it consume said drop and learn what mob its associated with, like giving it gunpowder would teach it what a Creeper is, or a raw steak would teach it to detect cows. Sort of like how you teach dogs to track different kinds of animals. And, attacking a mob would consume one move's worth of fuel, meaning you'd have to refill your sentry more often than you would have to refill, say, a lumberjack turtle.

Also, you could have it gather the experience from any slain mobs, up to a certain amonut, and have them drop the experience on its owner's command, with a loss of, say…33%, to make power leveling with robots more difficult.

Perhaps you could also have the wireless modem act as a range extender for its detection, so it can detect mobs in a 5x5 area around it. It'll return the distance, relative to the turtle, of the closest learned mob, allowing it to "see" further, thereby making it more effective.
Lettuce #2
Posted 31 August 2012 - 12:18 PM
I'll second that, though without "mob tracking" with drops, and to keep programming a bit more simple, keep fuel levels only changing when it moves. But I LOVE the idea of mob detection, especially if a modem could allow it to detect in a five-block radius. In fact, in the "Ask a Pro" section, under "Mining Turtle pet!" someone wanted something to that effect, but obviously for a different purpose. This kind of API would be quite versatile indeed. Not even sentries necessarily, but even a farmer that gives cows wheat, or like a pet. There would be quite a few possibilities.
lieudusty #3
Posted 01 September 2012 - 03:50 AM
I like this idea!
RavynousHunter #4
Posted 02 September 2012 - 08:30 AM
I'll second that, though without "mob tracking" with drops, and to keep programming a bit more simple, keep fuel levels only changing when it moves. But I LOVE the idea of mob detection, especially if a modem could allow it to detect in a five-block radius. In fact, in the "Ask a Pro" section, under "Mining Turtle pet!" someone wanted something to that effect, but obviously for a different purpose. This kind of API would be quite versatile indeed. Not even sentries necessarily, but even a farmer that gives cows wheat, or like a pet. There would be quite a few possibilities.

Aye. The sentries were just my first line of thought, since I made an attack turtle with the goal in mind of having them for creeper defense around sensitive electronics…even though I've since warded them with reinforced stone. The last thing I'd want is to have a creeper somehow make it past my grid of interdiction torches and end up blowing one of the walls off my HQ.

Though, I've just had an idea to add to that…craftable waypoints, in a similar vein to the path marks you can make for certain BuildCraft machines. That way, you can have a set route your little buddies can patrol, and perhaps you can include dyes into the recipe, so each dye marks a different patrol route, and you could set your turtle to patrol the Red route, or what have you.
Lettuce #5
Posted 02 September 2012 - 06:26 PM
Though, I've just had an idea to add to that…craftable waypoints, in a similar vein to the path marks you can make for certain BuildCraft machines. That way, you can have a set route your little buddies can patrol, and perhaps you can include dyes into the recipe, so each dye marks a different patrol route, and you could set your turtle to patrol the Red route, or what have you.

I think that might go against the spirit of the mod, you can always use variables instead, whereas mob detection doesn't exist, and you can't make it exist.
matejdro #6
Posted 02 September 2012 - 08:53 PM
I think it goes against the spirit of the mod. I like the idea that every information about the world is provided through true/false. So you have to compare what you already know instead of simply knowing information. Returning actual type of the mob would break this.

But on the other hand, I have no idea how could mob detection be made properly to be in the spirit of the mod. Because in current state, killing turtle is only useful in stationary situation (like killing at the end of your mob grinder). You can send it to the random rampage, but that would just waste fuel compared to the output I think.
Lettuce #7
Posted 03 September 2012 - 08:03 PM
I support it. Maybe without the ability to tell what the mob is exactly, but basically: is it a mob, and how far away?
kaj #8
Posted 03 September 2012 - 09:18 PM
Really good idea.

I think having them detect ranged entities could be fun, but very op and easy to abuse the shit out of.
The same for mob/player identification (Although the farmer idea is intriguing) and exp gathering.

I do like the idea of a turtle that detects an entity right in front of it (and kills it / or milks / feeds it etc).
A turtle sentry program could be (easily?) made by the author allowing turtle.detect() to also detect entities.

I think turtles need some sort of life form detection.