ID:151728
 
First and foremost: I understand what i am asking about is wrong, and try not to do it.

What is so wrong about putting usr in a proc? I mean, are we just told not to do this and just blindly follow, not bothering to ask why?
In response to Kaiochao
Thanks.
The rule of thumb here (or atleast the idea that I've been following for awhile) is that if you don't know if you NEED to use usr, use src.

In functions like atom/Click(), usr is the only way to access the clicker. But in things like verbs (atleast ones that are rooted on mob, for example), when people are using usr, they really want src (minus the times they really need usr).

In general, you will probably be safe using usr in verbs and stuff as it's pretty uncommon for someone to make a verb that calls other people's verbs, but it's not uncommon for someone to make a verb that calls a function that belongs to another object. Which is why people say "no usr in proc" and let verbs fly, since they're specifically meant to be called by the client.

But yeah, almost every time someone is using usr, they really want src. They might be the same thing when you use it, but they're not really the same thing. So just for the sake of newbies around the world, if you don't NEED to use usr, use src.
In response to Keeth
Keeth wrote:
The rule of thumb here (or atleast the idea that I've been following for awhile) is that if you don't know if you NEED to use usr, use src.

I do hope that's not the main rule of thumb here, since it's a pretty bad one to give to beginners to take generally. It doesn't solve the underlying problem: you're only saying "if you're going to use usr, use src instead!" which is not only misleading but still makes beginners think there is magic involved and src (instead of usr) will magically always be the variable they need. Of course, this is not the case especially in procs, since they could be called from anywhere and on various objects (though beginners don't always understand this concept due to Dream Maker automatically calling procs on src), and the usr value comes from the caller of the proc, as an invisible argument.
As you know, the only right answer is "use what variable is appropriate in that specific situation", since in every situation there could be a different variable representing the object/mob desired, which could be neither of src and usr. For example in movement procs, you most often need to use the argument to intercept the 'potential player' (or atom) instead, like in Bump(), Entered()...
In response to Kaioken
I accidentally wrote it under the assumption people knew what usr and src were and forgot that I was supposed to be explaining that.

Stupid me.

In my defense, it was very early in the morning.