ID:165801
 
I want to represent ranks in a skill through icons on a statpanel. As the character's skill increases the icon on the statpanel will change. Can anyone help me out?
make an object, and show it in the stat panel, and change its icon with their rank
In response to Falacy
Yes... that's what I want to do. I'm pretty sure I can handle the other stuff but how would I make the icon correspond with a mob/var?
In response to ExoDimensional
ExoDimensional wrote:
Yes... that's what I want to do. I'm pretty sure I can handle the other stuff but how would I make the icon correspond with a mob/var?

Really good tutorial:
http://www.byondscape.com/ascape.dmb/Shadowdarke.2003-0322/

A clickable icon in a statpanel:
http://www.byondscape.com/ascape.dmb/Zilal.2002-0110/
In response to TheMonkeyDidIt
var/obj/LEADER = new // the icon
mob
stat()
statpanel("blah")
switch(src.rank)
if("leader")// the users rank
stat(LEADER)// the icon to show
obj
LEADER
icon = "blah.dmi"
icon_state="LEADER"


Don't copy and paste it won't work and it should work but i rushed it not at home..
In response to A.T.H.K
I think I'm getting close. So this is what I did:

var
obj
zero = new
one = new

obj
zero
icon = 'rank.dmi'
icon_state = "0"
one
icon = 'rank.dmi'
icon_state = "1"
mob
Stat()
statpanel("Class")
switch(src.balance)
if(src.balance==0)
stat("Balance ",zero)
if(src.balance==1)
stat("Balance ",one)


I get an "expected a constant expression" errors on the two if() lines. Hmm?
In response to A.T.H.K
A.T.H.K wrote:
Don't copy and paste it won't work and it should work but i rushed it not at home..

I can tell you rushed. You kinda contradicted yourself there, heh. I think you meant that it won't work in it's present state due to indentation, icons, among other things, but if he created something similar of his own and had those things, it'd work.

-Exophus
In response to ExoDimensional
var
zero = new /obj/zero
one = new /obj/one

obj
zero
icon = 'rank.dmi'
icon_state = "0"
one
icon = 'rank.dmi'
icon_state = "1"
mob
Stat()
statpanel("Class")
if(!src.balance)
stat("Balance",zero)
else
stat("Balance",one)
>

Try that.

Also with a switch inplace switch(src.blah) you don't need if(src.blah == 1) you only need if("1") and etc.

And for ==1 thats a no no use if(src.blah) for ==1 and if(!src.blah) for ==0.
In response to A.T.H.K
Hey it works now. Thanks alot.

Edit: Wait, one more problem. The word "one" is written on the right of the icon, how do I eliminate this?
In response to ExoDimensional
Name the obj zero
obj
Zero
icon='blah.dmi'
icon_state="0"
name = ""
In response to A.T.H.K
y dont u just set the players rank=an object and then change that objects stuff by using usr.rank <.<