For my Pokemon game,i was wondering if i could lock the user view...i mean that he can move in only X steps in his view,He can not get out of it..what is the code for this?
mob var atom/view_source // The center of this view. view_distance // The distance from the view that // they are allowed to move.
Move(atom/loc) if(view && istype(view) && (get_dist(src, view) > view_distance) // If the view is set and it's an /atom, but if // the new location to move to is outside their // allowed view, block them. return 0
// Otherwise, allow them to move as normal. return ..()
This won't work for views that can move (such as if it's a mob following a path for, say, an escort mission or something). This would require you to modify the moving thing's Move() proc also, to force others to follow along.
Look into client.eye in the DM reference.