ID:262165
 
mob
Stat()
if(loggedin==1)
Workhp(src)
Deathcheckplayer(src)
statpanel("Stats")
stat("Health: [Hp2]")
stat("Skill: [obj/var/Skillsel]")


My question is to do with the stat("Skill:obj/var/Skillsel]") I know this code does not work at the moment and it is this part i am wondering is there a way to define paths within a stat as i am trying to make it so when you select a skill the picture of the skill shows up in the selected skill stat.
Make a new instance of the object and display that in the statpanel.
mob
var/skill/a_skill
New()a_skill=new
Stat()stat("Skill:",a_skill)
In response to Loduwijk
Or you can do this:

mob
Stat()
if(!skills) skills = list()
..()
statpanel("Player")
stat("Health:",src.health)
statpanel("Skills",src.skills)
In response to Mega fart cannon
Also, when adding a skill...
src.skills.Add(new /obj/asdf)
I think.
In response to Hell Ramen
Hell Ramen wrote:
Also, when adding a skill...
src.skills.Add(new /obj/asdf)
I think.

Hmm....I think this is more neater:

src.skills += new/obj/asdf
In response to Mega fart cannon
Ok, thankyou for that but i already knew how to add a new skill it was just the stat panel i needed help with so thankyou everyone but i cant think whether my question has been answerd as i dont believe i included enough code or worded it very well, so here is a little more.
Edit:What I am trying to do is make it so when you click on the skill in your skills list (i already got that bit sorted and everything) a picture of the skill with its name next to it will be shown next to the Skill: stat in the main stats window.
Edit2: i also missed out a little bit of code that (I've only been including bits that are needed.)
mob
Login()
src.skills += new/obj/HandToHand

mob
Stat()
if(loggedin==1)
var/skill/a_skill
Workhp(src)
Deathcheckplayer(src)
statpanel("Stats")
stat("Health: [Hp2]")
stat("Skill: [obj/var/Skillsel]")
stat("Health: [Hp]")
statpanel("Skills")
stat(src.skills)
obj
HandToHand
icon='hand.dmi'
name="Hand To Hand"
Click()
src.Skillsel = /obj/HandToHand

obj
var
Skillsel = "None"
In response to Hellgate_uk
*Bump*