ID:838322
 
(See the best response by Kaiochao.)
Hey guys, I really have no idea how to finish this.
When someone uses a specific verb, I'd like for them to be immobile until they use it again, like a toggle.

I'm a little clueless how to manipulate movement.



The default behavior of Move() is what moves movable atoms. The client also has a Move() that calls its mob's Move().
All you need to do is override Move() for what you want to halt. When halted (a variable is true, for example), don't call the default behavior, ..().

Also, to make sure, when you do call ..(), you should return its value to be proper.

Sometimes I wonder if anyone has ever used the guide or reference, who asks these questions on the forum. I'm sure you could have found this answer by doing a little work before posting. The help forum isn't your personal how-to shortcut for DM's basic features, that's the DM reference's purpose.
That doesn't really help me much man. If I wanted to know how Move() works I'd look up 'Move' with F1. I need to know how to write this.

If I knew what to look for, I'd have just looked at the guide. I figured since this is called Developer Help, I might be able to get my questions answered here, I guess some people don't see it that way though.

Where do I over ride Move?
Best response
To add to the collection:
mob // the player
var halted = 0 // the condition

Move() // the proc (notice, the keyword 'proc' isn't before it)
if(halted) // the condition is met
return 0 // stop the procedure without calling default behavior
return ..() // call and return default behavior when the code reaches here

verb/toggle_halted() // an example verb
halted = !halted
src << "Your movement is [halted ? "dis" : "en"]abled."

I suppose you just didn't know the right words to search for.

Searching for "lock movement" seems to get results.

Oh, and here's another resource to teach you more about proc inheritance, AKA overriding, redefining, etc.
http://www.byond.com/docs/guide/chap06.html
Ah, so you actually redefine Move(), and it indeed overwrites it's normal behavior.

The rest is surprisingly simple. I wasn't aware you could use ternary conditions within text strings like that, nice bit of information.

Thanks for the help Kaiochao~
It's contextual, but you generally want to disable the client's ability to issue commands for the mob to move, rather than the mob's actual ability to move. That way for example, if you were to have an event that teleports every player in the world somewhere at random, the fact halted = true won't bug it up.