ID:2337408
 
area
shopkeeper
Entered(mob/M)
M.move=1
Exited(mob/M)
M.move=0


Problem description: How do you get a player or computer to halt movement by being in a specific spot? I thought by both being mob they would respond to this code, but only does it respond to players only. Not to mention if starting off in that area as a player you can still move. It's obvious I need a crash course in DM. However, are good source codes available? Anyways. Basically how do I use area to respond to either player or computer and halt their movement. Please and thanks!

Ideally, all you'd need is this:
// The type we're working in...
area/shopkeeper

// This proc represents the question:
// "Can [mover] exit [src]?" (src being this area)
Exit(atom/movable/mover)

// If [mover] is a mob, then:
if(ismob(mover))

// The answer is no.
return FALSE

// Otherwise:
else

// The answer is determined elsewhere
// by a previous override in the same or inherited type,
// or just the default behavior specified in the Reference (F1).
return ..()

The issue then becomes, how is a player supposed to properly leave this area? You're gonna need some more logic for that.
360artificialintelligence wrote:
I thought by both being mob they would respond to this code, but only does it respond to players only. Not to mention if starting off in that area as a player you can still move. It's obvious I need a crash course in DM.

The DM Guide is a great place to start, though I've been away for a while so I'm not sure if it's still up to date. Kaiochao's post is a great example of how to do what you want to do, and how to think about what's happening in DM code in general.

Understanding what DM code is doing and when is a difficult concept when you haven't done much programming before. I wrote an article a long time ago on this topic, you could consider it a crash course: http://www.byond.com/forum/?post=43124

Still the guide is a very important resource. Make good use of it : )