I've been trying to get my mobs to stop moving diagonally and move s, w, e, n to get to me instead.
The codes I've tried stop the mob from moving diagonally, but if I am on a spot diagonally of them, they will ignore me and not come after me. If I am standing directing in front of or to the sides of them, they will chase me like they are supposed to. Is it possible to make them chase after me, even if I'm on a spot that's diagonal from them?
... Or, is there a way to make them just not attack in a diagonal direction?
What I am trying to do is get zombies to puke (as a basic projectile) and make it so they can only puke n,w,e,s so there isn't any diagonally flying puke.
ID:156390
Oct 20 2010, 8:54 pm (Edited on Oct 20 2010, 9:24 pm)
|
|
In response to Gunbuddy13
|
|
That could be massively shortened (and fixed) with some voodoo:
move(newloc, newdir) I posted a better solution to this a while ago but I don't feel like searching for it myself. Just try searching "author:Garthor diagonal", maybe "cardinal" as well. |
In response to Gunbuddy13
|
|
I can't believe I couldn't figure that out. God, I'm stupid.
That worked perfectly, thanks man! Now they don't stand there all retarded. Thanks to both of you actually, both codes did exactly what I needed. +1 INTERNETS FOR YOUS |
Instead of moving northeast, it will randomly pick to try to move north or east. This is a very basic solution, advanced pathfinding would still be your best bet