ID:173555
 
how to I make the info from a list appear in a stat panel? I've got most of it, I just need one var. I'll put it some ~~ things around the part I dunno

mob/var/list/friends = new()

mob/Stat()
statpanel("Friends")
stat("Friend list:", ~M.friends~)

the M.friends part is the one I think is wrong. how do I make it list all the objects or text thingies in the list?
mob/var/list/friends = new()

mob/Stat()
statpanel("Friends")
for(var/M in friends)
stat("Friend list:", M)

Basically, each time it calls the Stat() proc, it'll search friends var/list and show the value of M. There's more ways to do this. But this may be what you want. You may want to change the stat() though, cause how it currently is, will create a new stat in the panel with each name.

mob/Stat()
statpanel("Friends")
var/FRIENDLIST
for(var/M in friends)
FRIENDLIST += "[M],"
stat("Friend list:", FRIENDLIST)


The way you tried should return /list Where you wanted it to show the friends right? (I dont really know much coding, but thats my deduction)
In response to Evil Incarnate Inc
I'm not using "friends" really, it was just an example because I need to use this a few times in the code. I need really to have it select from a list of messages like var/list/colors = ("red","yellow","green") and have it put all 3 of those in the stat. Also, yours wouldn't work because that's putting the mobs themselves in the list, and not just their name.