ID:269278
 
mob
var
hp
proc
usrabuse()
usr=src//Question right here.
world<<usr
world<<src
usr.hp++

Is it okay if you do something like that?
Hell Ramen wrote:
mob
var
hp
proc
usrabuse()
usr=src//Question right here.
world<<usr
world<<src
usr.hp++

Is it okay if you do something like that?

It's legal, but questionable. There's little reason you'd want to do something like that in a proc, unless for instance it was being used to call a verb and you wanted the verb to behave as if something else had called it.

In this case, hp++ is so much cleaner to write, and you don't have to screw with usr one iota.

Also, you should always always always put some space (at least 1 tab) between code and a // comment.

Lummox JR
In response to Lummox JR
Since this matches the "usr abuse" topic, may I ask a question so I don't take up the forum with a separate topic altogether when I could be using an existing one.

What about datums? Like in a datum's New(), src will be either datum.name, or the datum's path. I've tried passing in mob/M to the parameter of datum/New(), and setting a var to the mob that was passed, but that sets the name to the datum's name/path, even if I send src as the parameter from mob/Login().
In response to Audeuro
Audeuro wrote:
Since this matches the "usr abuse" topic, may I ask a question so I don't take up the forum with a separate topic altogether when I could be using an existing one.

What about datums? Like in a datum's New(), src will be either datum.name, or the datum's path. I've tried passing in mob/M to the parameter of datum/New(), and setting a var to the mob that was passed, but that sets the name to the datum's name/path, even if I send src as the parameter from mob/Login().

I'm not quite sure I follow what you're saying here. Can you please post some example code and describe what's going on?

Lummox JR
In response to Lummox JR
Sure..


Well, wait a second. Now it's not doing it, how odd. Earlier, I was setting up my administration datum for a game and it keep printing out /ADMINISTRATION as the mob/M I passed. Looking back at my code, I had put var/Caller instead of var/mob/Caller, and I didn't even check to see if what was passed was a mob, but would that really effect it?
In response to Audeuro
Audeuro wrote:
Sure..


Well, wait a second. Now it's not doing it, how odd. Earlier, I was setting up my administration datum for a game and it keep printing out /ADMINISTRATION as the mob/M I passed. Looking back at my code, I had put var/Caller instead of var/mob/Caller, and I didn't even check to see if what was passed was a mob, but would that really effect it?

Nope, that wouldn't affect it. It looks like you're merely passing the wrong thing to new().

Lummox JR