ID:154222
 
I didn't know where to put this, so I figured I'd put it here....
How would you set it up so that in the map maker, you layed down a series of turf (ex. turf/path/1, turf/path/2,etc.), that in map maker is visible, not in the game though, and once a mob enters the turf/path/1 they automagically walk_to turf/path/2. I've thought this over and this is as far as I can get:
turf/path
icon='forallicare.dmi'
New()
icon=null
1
Enter(mob/M)
M.walk_to(M........)
????????????????

Far as I can get.
Help? *he squeaks*
unimatrix wrote:
I didn't know where to put this, so I figured I'd put it here....
How would you set it up so that in the map maker, you layed down a series of turf (ex. turf/path/1, turf/path/2,etc.), that in map maker is visible, not in the game though, and once a mob enters the turf/path/1 they automagically walk_to turf/path/2. I've thought this over and this is as far as I can get:
> turf/path
> icon='forallicare.dmi'
> New()
> icon=null
> 1
> Enter(mob/M)
> M.walk_to(M........)
> ????????????????
>

Far as I can get.
Help? *he squeaks*

An interesting problem, with many possible solutions. Here's one that comes to mind.

First create an icon named 'path.dmi' with direction states. You'll need 4 if you just want N,S,E,W... 8 if you want diagonal paths as well. Make the pictures of the icons arrows which point in the different directions, so you can tell where the path is going in the map editor.

Place the tiles in your map, and set the dir variable to the direction you want to push the mob that enters it. You should visually see a line of arrows showing the whole path and direction.

Here's the code (untested):

turf/path
icon = 'path.dmi'
invisibility = 100 // don't worry, you'll still see it in the map editor

Entered(mob/M)
var
walk_lag = 5 // set this to taste
walk(M, dir, walk_lag)

Just remember that Entered() is only called when an object is called through Move() (walk calls move, so you're ok here). If you set the loc variable directly, it won't work.

This code could also be worked to move objects around, like on a conveyor belt.
In response to Skysaw
I'm sorry I wasn't clear....I meant to have the mob follow a path laid out...like this:
X_________
          |
          |________


And follow that from the X...
In response to unimatrix
unimatrix wrote:
I'm sorry I wasn't clear....I meant to have the mob follow a path laid out...like this:
X_________||________


And follow that from the X...

My solution would do this perfectly. You just need to lay out the path bits tile by tile in the map editor. By direction, it would look like this:
e e e e s
        s
        e e e e e