ID:146633
 
The problem is on line 23 "the Click(mob/M in world) part".

Code problem and info stated below the code.
/*
note the below code isn't actualy what i'm using in what i'm
making, its just an example.
*/

mob
var/online=0
var/uploads=0
var/age=0
var/description=""
mob
Login()
online+=1
Logout()
online-=1
Stat()
statpanel("Status")
stat("Player List","")
PlayersRefresh()
for (var/mob/P in usr)
stat(P)
stat("Players Online:","[online]")
Click(mob/M in world)
src<<"[M.name]"
src<<"[M.uploads]"
src<<"[M.gender]"
src<<"[M.age]"
src<<"[M.description]"
proc/PlayersRefresh()
for (var/mob/P in usr)
del P
var/mob/A
for (A in world)
if (A.client)
var/mob/P = new(usr)
P.name = A.name


Code Problem: The problem is, that it comes up with
the following message below, when it is suppose to show the clicked
user's info. for some reason it believes the clicked mob/M is the
statpanel name and this is also stated in the blow content.

runtime error: Cannot read "Status".name
proc name: Click (/mob/Click)
&nbsp;&nbsp;source file: CodeTesting2.dm,23
&nbsp;&nbsp;usr: ElderKain (/mob)
&nbsp;&nbsp;src: ElderKain (/mob)
&nbsp;&nbsp;call stack:
ElderKain (/mob): Click("Status")


~ElderKain~ [email protected]
Make it mob/M, you don't need the "in world" part, seeing as it's a proc.
try this
for(atom/M)
if(istype(M,/mob/Player)

or
for(mob/M as mob in world)
atom/Click()'s argument is the location of the atom that was clicked. It can be a statpanel or a location on the map. src is the atom that was clicked and usr is the player who clicked something.

atom/Click(location)
world << "[usr] has clicked [src] while \he was just resting on [location]."
In response to Hell Ramen
The closest thing I could somewhat even get close to work
is this.
mob
var/online=0
var/uploads=0
var/age=0
var/description="None"
Click(mob/M)
for(M as mob)
usr<<"Name: [M.name] ( [M.key] )"
usr<<"Uploads: [M.uploads]"
usr<<"Gender: [M.gender]"
usr<<"Age: [M.age]"
usr<<"Description: [M.description]"

and there still is a problem with it. The info comes up, but
it comes up twice and the second info that comes up isn't right.

Can ne1 help. I tried many things and it still isn't working.
In response to ElderKain
mob
var/online=0
var/uploads=0
var/age=0
var/description="None"
Click(mob/M)
if(ismob(M))//You were looping through all of the mobs!
usr<<"Name: [M.name] ( [M.key] )"
usr<<"Uploads: [M.uploads]"
usr<<"Gender: [M.gender]"
usr<<"Age: [M.age]"
usr<<"Description: [M.description]"


edit: I don't think you even need "M", just replace it with src (even the top thing and all that stuff)
In response to Hell Ramen
Hell Ramen wrote:
edit: I don't think you even need "M", just replace it with src (even the top thing and all that stuff)

In fact, you can't even use the M. atom/Click() just doesn't work that way. It's argument is equal to "the stat panel in which the object was clicked or its location on the map" (DM Ref).
In response to Wizkidd0123
Wizkidd0123 wrote:
Hell Ramen wrote:
edit: I don't think you even need "M", just replace it with src (even the top thing and all that stuff)

In fact, you can't even use the M. atom/Click() just doesn't work that way. It's argument is equal to "the stat panel in which the object was clicked or its location on the map" (DM Ref).

i wonder then how i can get it to work then. this is like my 3rd day strait, trying to figure this out, Any ideas that work would be helpfull.
In response to ElderKain
ElderKain wrote:
i wonder then how i can get it to work then. this is like my 3rd day strait, trying to figure this out, Any ideas that work would be helpfull.

Perhaps if you'd actually read YMIHere's post, since he already told you how to fix this problem, you'd make some headway.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
ElderKain wrote:
i wonder then how i can get it to work then. this is like my 3rd day strait, trying to figure this out, Any ideas that work would be helpfull.

Perhaps if you'd actually read YMIHere's post, since he already told you how to fix this problem, you'd make some headway.

Lummox JR

I already tried that exact code and nothing even came up. and plus read Wizkidd0123's post he even states even an atom/Click()just doesn't work that way. I game a small bit of code on my first post. thats like a snipit that can actualy work in a blank dm file which will give an exact look. basicly i'm wanting it is where when a user clicks the name of the other person that shows up on the statmenu thing. it will come up with that person't info. Its just basic fill and replace. What it is supose to be like is like how in icon chatterz, when the name ic clicked, it shows the player's profile. I hope that explain what exactly i'm talking about.
In response to ElderKain
ElderKain wrote:
I already tried that exact code and nothing even came up. and plus read Wizkidd0123's post he even states even an atom/Click()just doesn't work that way. I game a small bit of code on my first post. thats like a snipit that can actualy work in a blank dm file which will give an exact look. basicly i'm wanting it is where when a user clicks the name of the other person that shows up on the statmenu thing. it will come up with that person't info. Its just basic fill and replace. What it is supose to be like is like how in icon chatterz, when the name ic clicked, it shows the player's profile. I hope that explain what exactly i'm talking about.

YMIHere's code will in fact produce output. It tells you who clicked, what you clicked, and where you clicked it. What WizKidd said is that atom/Click() doesn't work in the way you've been using it, in which you're trying to make the argument be the thing that was clicked.

Seriously, I enjoin you to actually read YMIHere's post. And I don't just mean to copy and paste the code, see a result that isn't what you want even though it is instructive, and declare it doesn't work. (And it does work, in that it shows you how the vars interrelate, which is exactly what he intended.) I mean look at the actual text in his post, in which he tells you exactly what usr, src, and the argument all are. You could also read the reference, which explains the same thing.

Lummox JR
In response to Lummox JR
I did read every single bit, and one thing pops out in which i'm trying to explain

Args:
Location: the stat panel in which the object was clicked or its location on the map

When i do make somethng that does give out info, the atom/click() brings up an error which states the statpanels name, not the src in which is being clicked. i keep explaining it to you Lummox JR i don't want the statpannel name to popup, i'm wanting the user name and info to popup.
I tried exactly what YMIHere stated. i even coded it to give the info i needed. It just recognizes the src as the statpanels name. I know what you mean by looking at the code, and even if i do put it in my info or some1 elses, I get the same problem over and over again.
In response to ElderKain
ElderKain wrote:
I did read every single bit, and one thing pops out in which i'm trying to explain

Args:
Location: the stat panel in which the object was clicked or its location on the map

When i do make somethng that does give out info, the atom/click() brings up an error which states the statpanels name, not the src in which is being clicked. i keep explaining it to you Lummox JR i don't want the statpannel name to popup, i'm wanting the user name and info to popup.

And I keep explaining to you that the argument to atom/Click() is not the thing you clicked, but where you clicked it. YMIHere said that as well. If you don't want to use the statpanel's name for anything, then obviously you don't want to use that argument.

I tried exactly what YMIHere stated. i even coded it to give the info i needed. It just recognizes the src as the statpanels name.

No, it recognizes the argument as the statpanel's name, like we said. src is completely different.

I know what you mean by looking at the code, and even if i do put it in my info or some1 elses, I get the same problem over and over again.

You keep getting the same problems because you won't stop and pay attention. The argument to atom/Click() is not the thing you clicked. I can't possibly make that any clearer. YMIHere's code will precisely tell you that, and if that didn't make things clear, then you either didn't use it right or you didn't really take more than a cursory glance at the output.

From what you said, it sounds like you didn't actually use YMIHere's code, but rather that you tried to use it as a basis for modifying what you were already doing. It's quite clear, however, from his code itself that it was never meant for that purpose; it was only meant to show you what usr, src, and the argument are. Therefore, comment out your entire Click() proc, temporarily replace the entirety of it with YMIHere's example, and take a close look at what it actually shows you and in what order.

Lummox JR
In response to Lummox JR
I tried what you said but only one problem with it, it only
recognizes pre-defined variables that are defined in dreammaker
like the src.name and src.gender but anything else it isn't
recognizing.
sorry about that earlier. I have a habbit of trying to correct
people who try to help me *Even though I know lil bout what i'm
taking about* it's a habbit i'm trying to break.

Here is what i'm using now. i get an error that states the
src,key, src.uploads, src.age, and src.descriptin are
undefined vars.

and another problem, it basicly tried to tell the info for
anything clicked it gave the info for, even the objects.
Note: for the test i just used the usr<<"Name: [src.name]"
mob
var/online=0
var/uploads=0
var/age=0
var/description="None"
atom/Click(location)
usr<<"Name: [src.name] ( [src.key] )"
usr<<"Uploads: [src.uploads]"
usr<<"Gender: [src.gender]"
usr<<"Age: [src.age]"
usr<<"Description: [src.description]"
In response to ElderKain
ElderKain wrote:
Here is what i'm using now. i get an error that states the
src,key, src.uploads, src.age, and src.descriptin are
undefined vars.

thats because uploads, age, and description are defined under /mob, not /atom (which is the type of src in the click proc).

and another problem, it basicly tried to tell the info for
anything clicked it gave the info for, even the objects.

thats because both obj, mobs, and turfs are atoms.

try something like this:

 mob
var/online=0
var/uploads=0
var/age=0
var/description="None"
Click(location)
usr<<"Name: [src.name] ( [src.key] )"
usr<<"Uploads: [src.uploads]"
usr<<"Gender: [src.gender]"
usr<<"Age: [src.age]"
usr<<"Description: [src.description]"


this way, when a mob is clicked (since it's under /mob) it will tell the clicker thier name,key ect.
In response to DarkCampainger
that there is the closest thing i can get to work. One prob, for some reason it doesn't recognize the src.key in the option, ne1 know why?

[Edit]
Also it doesn't recognize if the mob vars have been edited. It just rtecognizes the base info. Only way it remembers like lets say if there was a stat(src), but that only shows your own info. and also if it is in another statpanel stat, then it only shows the base.
In response to ElderKain
Kain, in atom/Click():

src: The object that was clicked
argument: The location of src.
usr: The mob of player the who clicked on src

You probably have description, uploads, and age defined under a sub-type of atom (probably mob). key, of course, is pre-defined under mob. Since src in atom/Click() is equal to the atom being clicked, your example forces the compiler to look in vain for atom.key, atom.description, atom.uploads, and atom.age, none of which exist.

Remember, it's safe to use usr in atom/Click(). (http://bwicki.byond.com/ByondBwicki.dmb?UsrLecture)

On a side note, I'd like to know why you're using your own "description" variable instead of atom.desc.
In response to Wizkidd0123
Wizkidd0123 wrote:
Kain, in atom/Click():

src: The object that was clicked
argument: The location of src.
usr: The mob of player the who clicked on src

You probably have description, uploads, and age defined under a sub-type of atom (probably mob). key, of course, is pre-defined under mob. Since src in atom/Click() is equal to the atom being clicked, your example forces the compiler to look in vain for atom.key, atom.description, atom.uploads, and atom.age, none of which exist.

Remember, it's safe to use usr in atom/Click(). (http://bwicki.byond.com/ByondBwicki.dmb?UsrLecture)

On a side note, I'd like to know why you're using your own "description" variable instead of atom.desc.

lol I'll look into that info and do a lol more thourgh studying on the atom info and stuff. and as for the description thing, i have the src.desc set to "Player" so side procs will recognize like if(src.desc="Player") it will call some proc *Info i'm not at liberty to give out complete info on what i'm doing the coding for.