ID:160395
 
I want to show a bunch of stuff in a Stat Panel, but if I remember correctly, its limited to two arguments. So I wanted to do something like
stat("[obj.icon] Stat:",stat)

But I don't know how to get the obj's icon to appear instead of its name or what not. I tried
stat("\icon[obj] Stat:",stat)
//and
stat("[\icon obj] Stat:",stat)

but neither work. I know that in basic text, \icon obj works and shows the icon, but it doesnt work in Statpanels. I know you can get icons to appear in the statpanel I've done it before (But with only 2 items instead of 3).

Any help?
This has been discussed so many times...

[link]
In response to A.T.H.K
My bad, didn't think to check. Since those topics are so old, I'd rather not bump them back up. Unfortunatly though, the suggestion I tried to use, which is using image() doesn't work, and I don't know why. The other suggestions dont seem logical because the icon is just there as an Icon, not to be clicked on or anything so theres no reason to make an obj for it, plus there are going to be a lot of them in the statpanel so making tons of objs for nothing is pointless and a waste of memory.

var/image/I = image('skillicons.dmi',"blade")
stat("[I] Blade:",blade)
//or
var/image/I = image(icon='skillicons.dmi',icon_state="blade")
stat("[I] Blade:",blade)</DM
Do not work. As suggested in the 3rd link at the link you posted.
Yes I do have a 'skillicons.dmi' and I do have a "blade" icon state, so that is not the problem. Both are spelt correctly, I checked (Just to root out that suggestion, because I know its not the problem)

I looked it up in the documentation and it should work. I tried making the stat() just stat(I) and that does not work either.
In response to Polantaris
It doesn't work for you because you've used a text string in the argument to stat(), not the object reference. Also, the first argument is the Name, the 2nd is what you want, the Value. I think you can't put objects in the name, though you can probably put all kinds of HTML there just like the value.
Know that when an object reference is used as an embedded expression in a text string, a special value is used in its place. For datums, if they have a variable named name, it displays it (sometimes appending "The"), otherwise it displays its type, same for some other things. For images if I remember correctly, it actually displays nothing, instead of outputting the text "/image".

The \icon macro didn't work for you (BTW look it up to see the syntax it should be used with, 'icon text macro' in DM Ref) because it works by generating an HTML <IMG> tag, and by default info controls (such as statpanels) do not support HTML - that needs to be turned on through the interface editor for the control. Also, note normally browse_rsc() is needed to use <IMG> tags, but if you're displaying the icon of an object (more specifically, /atom, /image, /icon...) then it's not needed, as in that case the icon file is already in the RSC.

And I'm with ATHK here; these things are asked a lot, and if you just search enough you'll definitely get your answer. If you'd think the handful of posts ATHK linked to there are the only ones regarding this matter, you'd be way off.`
In response to Kaioken
Kaioken wrote:
It doesn't work for you because you've used a text string in the argument to stat(), not the object reference. Also, the first argument is the Name, the 2nd is what you want, the Value. I think you can't put objects in the name, though you can probably put all kinds of HTML there just like the value.

If you read all my posts, you would have read that I tried a obj reference as well. I didn't know that there was a specific argument requirement until recently (Before your post) because of the fact that I thought that stat() didn't really care what you inputed, but in another thread (which you've also replied to) I've figured this out.

Know that when an object reference is used as an embedded expression in a text string, a special value is used in its place. For datums, if they have a variable named name, it displays it (sometimes appending "The"), otherwise it displays its type, same for some other things. For images if I remember correctly, it actually displays nothing, instead of outputting the text "/image".

I'm not an idiot, I know about the fact that its name variable is used. I've been around longer than 5 minutes. (FYI, the appending "The" is displayed (Or at least it used to be becausse of this) when the first letter in the name is lowercase.)

The \icon macro didn't work for you (BTW look it up to see the syntax it should be used with, 'icon text macro' in DM Ref) because it works by generating an HTML <IMG> tag, and by default info controls (such as statpanels) do not support HTML - that needs to be turned on through the interface editor for the control. Also, note normally browse_rsc() is needed to use <IMG> tags, but if you're displaying the icon of an object (more specifically, /atom, /image, /icon...) then it's not needed, as in that case the icon file is already in the RSC.

You realize that you have contradicted yourself. Let me quote you on another post, "...I'm pretty sure he could also use an tag (or the \icon macro) in the Name argument." Really? Then how would it work in the name argument when it won't work according to this post?

And I'm with ATHK here; these things are asked a lot, and if you just search enough you'll definitely get your answer. If you'd think the handful of posts ATHK linked to there are the only ones regarding this matter, you'd be way off.`

I don't. You realize that I'm screwed either way. If I respond to something not working in an old thread, I get yelled at for updating an old thread, but if I post here, I get yelled at for posting in a thread thats new when theres older ones that would better help me.

And just as a side note, I've noticed how helpful these forums are when there are people who tyrade like everyone is an idiot newbie, like you have to me. By the way I read your post, I feel like you are treating me like I've been on BYOND for 10 minutes, get one error and bitch and whine until I get an answer, which is wrong. I've used \icon, and I've used its syntax properly before, the only reason I stated using it at all is so that I don't get it suggested because I know it doesn't work. I've used it correctly in syntax and it was just an attempt to see if it would work. God forbid I tried to give as much detail as possible without getting bashed for it about how I cant use it right and should look it up.
In response to Kaioken
Kaioken wrote:
It doesn't work for you because you've used a text string

Read

stat("[I] Blade:( THIS IS A TEXT STRING!!!!!!!)",blade)


stat("Blade:",I)
In response to Polantaris
Polantaris wrote:
If you read all my posts, you would have read that I tried a obj reference as well.

Problem: If you tried that, then it should have worked. It didn't, so I replied according to that.

I didn't know that there was a specific argument requirement until recently (Before your post)

Issue: You should look the proc up before you use it. If you're having issues with it (like in this case), look it up again once or twice. It doesn't have to do with your competence, I do the same.

I thought that stat() didn't really care what you inputed

Right, no comment.

I'm not an idiot, I know about the fact that its name variable is used. I've been around longer than 5 minutes.
(FYI, the appending "The" is displayed (Or at least it used to be becausse of this) when the first letter in the name is lowercase.)



I like to think I'm not an idiot, either. ;)

You realize that you have contradicted yourself.

Nope, you simply misunderstood and confused 2 different things. Well, it happens.

Let me quote you on another post, "...I'm pretty sure he could also use an tag (or the \icon macro) in the Name argument." Really?

Yes, really. I also said the same thing in the post in this thread, FYI.

Then how would it work in the name argument when it won't work according to this post?

Supplying an object reference to display doesn't work in the Name, but the <small>[\icon macro, which is inherently different in functionality than an object ref/]</small> HTML should work anywhere throughout the info control, provided it's enabled.

I don't.

Sure, I talked hypothetically. Thing is, this has been asked so many times I doubt you wouldn't be able to get more than enough coverage needed without actually posting for it. It's also a matter of work-time efficiency on the forums, but nevermind that.

You realize that I'm screwed either way. If I respond to something not working in an old thread, I get yelled at for updating an old thread,

Well, that depends on who replies. I wouldn't have an issue with it, provided the new post is relevant. It's better than a new topic because of you've followed that old topic precisely, a reply there is more in-context.

but if I post here, I get yelled at for posting in a thread thats new when theres older ones that would better help me.

The thing isn't really that they'll help 'better'. It's that they're 'already there', so you could get the information faster, and also people don't have to work to answer the same question again, so they can tackle the tougher questions (and what not) instead.

And just as a side note, I've noticed how helpful these forums are when there are people who tyrade like everyone is an idiot newbie, like you have to me.

Ah, look, you wouldn't be the first to take my attitude wrong, but this is an internet forum. You can't go about comprehending someone's attitude precisely from mere text, there is no emotion in it. In actuality I haven't even suggested such a thing, and I happen to remember your name as a non-newbie - the only one that has suggested you are is you.

By the way I read your post, I feel like you are treating me like I've been on BYOND for 10 minutes, get one error and <snip> and whine until I get an answer, which is wrong.

I think you're overreacting, or being too sensitive. The way I work is simple, and I don't see a problem with it: you have a problem/question/issue, I answer it to the best of my ability. Yes, this includes supplying information I'm aware you may already know - but if you don't, then it's useful and good that I did. If you already knew it, then no harm done (at least unless you decide to take it that way).
In short, I just supply more information than strictly required to provide more coverage. Nowhere in my post I said "you definitely don't know that [...]" or something. And posts are also for all, not only for the guy who asked the question, mind you - even if I said something you knew already, not all readers necessarily do, etc.

God forbid I tried to give as much detail as possible without getting bashed for it about how I cant use it right and should look it up.

Uh, ... God forbid I try to give as much detail as possible in my answer without having it being taken in the wrong way and getting bashed. =P Except, I don't mind as much as you do, so it's all fine.
In response to Kaioken
Umm? [link]

"I figured out a problem I was having with my statpanel stuff (post in Developer How-To.) Apparently you cannot have an obj image and such in the 1st argument of the procedure stat()."


Haha ...