ID:171008
 
Theres one thing i want to know about. How do you make a mob go a certain path but if he bumps into something it will still remember the path? In Castle, Abra coded it and I have no idea how he did it. Any ideas gurus?
Tazor07 wrote:
Theres one thing i want to know about. How do you make a mob go a certain path but if he bumps into something it will still remember the path? In Castle, Abra coded it and I have no idea how he did it. Any ideas gurus?

Not exactly sure what you mean here. A computer controlled mob following a pre-determined path, is that what you want? And if an obstacle gets in the way, find a way to the next turn in the path?


/Gazoot
I'm not positive that Abra did it this way, but for his Castle game, I would have made the mobs continually move forward 1 step at a time, then have certain turfs along the way change the direction of the mob. Very simple to make, and map designers can easily make new (though predictable) movement patterns.

turf/turning
icon = 'arrow.dmi' // so you can see it in the map maker
New()
..()
// reset icon to normal, so the arrows are not visible in the game
icon = 'defaultgroundicon.dmi'
Entered(atom/O)
if(istype(O, /mob/critter))
O.dir = src.dir // turn mob to turf's direction

Just generate instances from directions in the map editor, and you can paint the turning turfs easily on the map.