ID:262788
 
... because I get 1,102 errors... I just changed the user from /mob to /mob/player, as shown...
world
mob = /mob/player

Every reference to 'usr' or 'usr.[something]' is an error. I did this to all references to the player...
mob/player
var
[vars]
proc
[procs]
verb
[verbs]

...but left some references, as in the death proc, alone. Where do 1102 errors come from? Did I mioss something in all those libraries and demos?

--Vito

Vito Stolidus wrote:
...but left some references, as in the death proc, alone. Where do 1102 errors come from? Did I mioss something in all those libraries and demos?

Well, you're abusing usr massively all over your code. No wonder you have all those errors!

No put usr in proc. Ungh!

This has come up enough times for you that you really should know better by now. Why do you keep trying to debug code at all if you're not going to fix it?

DM knows usr is supposed to be a /mob, but it knows nothing more specific than that. What you need to be using is either src or another var.

Now in your death proc, you should have two important vars: src, the victim, and the killer. In order for the proc to know who the killer is, you need to tell it; send the killer as an argument to the proc.

Fix your usr abuse and you'll fix most of your errors. In verbs, all you'll need to do is type-cast usr to a /mob/player var, like so:
var/mob/player/M = usr

In procs, you need to get rid of all references to usr. Change it to whatever is appropriate. Add arguments to your procs as needed.

Lummox JR
In response to Lummox JR
I don't use usr in procs... and not in the deathproc obviously. I'm talking my massive manual spellcasting verb and other verbs in the 1102 errors.
var/mob/player/M = usr

this is what I need? In every verb? I can do that. One question: are usr and src interchangeable in Click() and other such procs or am I going to be yelled at again?

--Vito
In response to Vito Stolidus
usr in click is the mob clicking the item. src is the item itself.
In response to CaptFalcon33035
that's how I've been doing it. 'usr' still gives an error, though. Do I need something special there, like that one line?

(((][)))
[edit]: rechecked. about 900 of the errors come from one section of code, heavy with Click() and DblClick() procs. I'll bet the other 188 (I got it down a few through changing of type paths) are from the same kind of thing. Should I use the mob/player/M = usr (or whatever) line in Click()/DblClick() procs?
(((][)))

--Vito
In response to Vito Stolidus
It might be that you made it so the vars are under player, but when you do mob/Click() they don't have the vars.
In response to Kalzar
So... How do I fix that?

--Vito
In response to Vito Stolidus
Vito Stolidus wrote:
So... How do I fix that?

Easy. Either define all those vars for all mobs, or use type-casting exactly like I said.

Lummox JR
When you change the basic definition of a type of thing in your code, whether it be changing /mob to /mob/player or /obj/jar to /obj/vase, you have to change every reference that used /mob to /mob/player, /obj/jar to /obj/vase. If you don't it will spit out a ton of errors. Go through and be sure you've changed every refernce to your players from /mob to /mob/player.
In response to Lummox JR
I tried doing that little statement in procs, like in verbs... but it not work. I have it in the Login() statement, it shouldn't be giving me these troubles...

--Vito
In response to AZ0123
did that... fixed about 25 errors of 1102.

--Vito
In response to Vito Stolidus
Vito Stolidus wrote:
I tried doing that little statement in procs, like in verbs... but it not work. I have it in the Login() statement, it shouldn't be giving me these troubles...

Is Login() defined under /mob or /mob/player? Because if all player mobs are /mob/player, then it really should go there. And in Login() of course you should be using src in place of usr anyway.

Lummox JR
In response to Lummox JR
I just defined it there, I didn't use it. Checking something...

This was the way one library handled it. What did I do wrong? this is the only difference between it's code and mine, save length and complexity.


mob/Login()
var/mob/player/M
M = new/mob/player
usr = M



--Vito
In response to Vito Stolidus
Vito Stolidus wrote:
I just defined it there, I didn't use it. Checking something...

This was the way one library handled it. What did I do wrong? this is the only difference between it's code and mine, save length and complexity.
mob/Login()
var/mob/player/M
M = new/mob/player
usr = M


Um... a library did that? Which library? The author must be smacked.

What good does it do to create a new /mob/player and then set usr to that value? It seldom does any good to monkey with the value of usr, unless you're 1) writing for a code size challenge and need a handy local var, or 2) need to call a verb as if it was a proc.

Lummox JR
In response to Lummox JR
so, how am I to solve my 1088 errors?

--Vito
In response to Vito Stolidus
Delete all your code?
In response to Jp
har. seriously. Why do the Click() procs give me trouble?

--Vito
In response to Vito Stolidus
Because you aren't using them correctly?

In client.Click(var/atom/arg):
src is the client of the clicker (Of type /client)
usr is the mob doing the clicking (Of type /mob)
arg is the atom that has been clicked on (Of type /atom)

In atom.Click(var/arg)
src is the atom that has been click (Of type whatever Click() is being used under)
usr is the mob owned by the client doing the clicking (Of type /mob)
arg is src.loc
In response to Vito Stolidus
Vito Stolidus wrote:
so, how am I to solve my 1088 errors?

Well among other things, you could move all those var declarations from underneath /mob/player to /mob like you were already told to.

Lummox JR
In response to Lummox JR
That would cause major issues... The objective of using /mob/player for them is to fix the same problem your idea would create.

--Vito