ID:179280
 
I want to control the movement of the mobs in the game with scripted routines, I do not want the player to be able to do ANY type of movement themselves, however I am finding it difficult to figure out how to set the map location for starting mobs and to disable the arrow keys so that they can't move the bots manually. posible override the North, East, South, West procs so that they do not have any actual event associated, it seems it should be easier than that

I also only want the mobs to move in 2 directions forward and backward and make facing changes, it is a puzzle game of movement not a fighting game.
I figure I can call the turn proc for facing changes but forward movement based of facing direction eludes me.
*edit*

I completely missed the point of your post. I really oughta read these thigns before I post. :)

Keeping this info up anyway incase anyone wants to use it:

Heres a method that should work for ya. It's a little crude, and will probably cause lots of lag if you plan to have many players on at once, since it's making a loop for each player. But it works.

First make all your tiles dense to avoid player movement.

Add a turf or area named start (using turf in this example) and put it where you want the player to start.

add these lines to the end of your mob/Login()

src.loc = locate(/turf/start)
moveloop(src)

This is passing src on to a proc named moveloop, so you gotta define that.

mob/proc/moveloop(mob/M as mob)
while(1)//start a infinite loop
sleep(30)//wait 3 seconds
M.loc = locate(M.loc.x, M.loc.y + 1, M.loc.z) //move the player north one


And there it is.

You can add more specific instructions by setting up variables. make the first line in the proc look something like

while(M.movenorthcounter <= 29)

then have it move the player like normal, but add a variable called M.movenorthcounter and add M.movenorthcounter += 1 after the M.loc line, and then the player will take 30 steps north.
In response to Zagreus
that really is looking like a good start but another question.

Can I keep the mob facing west while moving i.e. Being moved or pushed to the north?

Zagreus wrote:
*edit*

I completely missed the point of your post. I really oughta read these thigns before I post. :)

Keeping this info up anyway incase anyone wants to use it:

Heres a method that should work for ya. It's a little crude, and will probably cause lots of lag if you plan to have many players on at once, since it's making a loop for each player. But it works.

First make all your tiles dense to avoid player movement.

Add a turf or area named start (using turf in this example) and put it where you want the player to start.

add these lines to the end of your mob/Login()

src.loc = locate(/turf/start)
moveloop(src)

This is passing src on to a proc named moveloop, so you gotta define that.

mob/proc/moveloop(mob/M as mob)
while(1)//start a infinite loop
sleep(30)//wait 3 seconds
M.loc = locate(M.loc.x, M.loc.y + 1, M.loc.z) //move the player north one


And there it is.

You can add more specific instructions by setting up variables. make the first line in the proc look something like

while(M.movenorthcounter <= 29)

then have it move the player like normal, but add a variable called M.movenorthcounter and add M.movenorthcounter += 1 after the M.loc line, and then the player will take 30 steps north.