ID:144499
 
Code:
mob/Stat()
statpanel("Spell List One",src.spell)
statpanel("Spell List Two",src.spell2)
statpanel("Spell List Three",src.spell3)
if(statpanel("Spell List One"))
stat("\icon[src.spell[0]]","[src.spell[0].name]")
stat("\icon[src.spell[1]]","[src.spell[1].name]")
stat("\icon[src.spell[2]]","[src.spell[2].name]")
if(statpanel("Spell List Two"))
stat("\icon[src.spell2[0]]","[src.spell2[0].name]")
stat("\icon[src.spell2[1]]","[src.spell2[1].name]")
stat("\icon[src.spell2[2]]","[src.spell2[2].name]")
if(statpanel("Spell List Three"))
stat("\icon[src.spell3[0]]","[src.spell3[0].name]")
stat("\icon[src.spell3[1]]","[src.spell3[1].name]")
stat("\icon[src.spell3[2]]","[src.spell3[2].name]")


Problem description:

It says that the embedded variables are bad embedded expressions.
You can't use the \icon text macro in a statpanel. If you're trying to display an image in the statpanel, you'll have to display an actual reference of an object with the icon and icon_state set accordingly.
In response to Unknown Person
Nope same errors
In response to Shlaklava
Can you post a)Your updated code and b) the place where you declare mob's spell variable?
Shlaklava wrote:
Code:
//The Lists
mob/var/list
spell
spell2
spell3
//The Stat
mob/Stat()
statpanel("Spell List One",src.spell)
statpanel("Spell List Two",src.spell2)
statpanel("Spell List Three",src.spell3)
if(statpanel("Spell List One"))
stat("[src.spell[0]]","[src.spell[0].name]")
stat("[src.spell[1]]","[src.spell[1].name]")
stat("[src.spell[2]]","[src.spell[2].name]")
if(statpanel("Spell List Two"))
stat("[src.spell2[0]]","[src.spell2[0].name]")
stat("[src.spell2[1]]","[src.spell2[1].name]")
stat("[src.spell2[2]]","[src.spell2[2].name]")
if(statpanel("Spell List Three"))
stat("[src.spell3[0]]","[src.spell3[0].name]")
stat("[src.spell3[1]]","[src.spell3[1].name]")
stat("[src.spell3[2]]","[src.spell3[2].name]")
In response to Unknown Person
Unknown Person wrote:
You can't use the \icon text macro in a statpanel. If you're trying to display an image in the statpanel, you'll have to display an actual reference of an object with the icon and icon_state set accordingly.

Aside from that, I believe his actual error lies in the fact that he's trying to display an item in a list that can't be accessed.

ex:
list[0]
In response to Teh Governator
Hehe...my bad on that one; was switching between C++ and this.

Ummm...still the same errors. I don't get whats wrong though.
In response to Shlaklava
Your actual problem lies at the expression src.spell[number].name. DM lists don't work like that, since you can't directly access an object's variable from a list, since it can be anything. You will have to type cast to fix this.
Ok, question - what's stored inside of the spell lists? Because, I'm not so sure that you can do the whole [list[1].name] mabo.
In response to Shlaklava
Simple display the list within stat().

if(statpanel("Spell List One"))
stat(src.spell)
In response to Teh Governator
Teh Governator wrote:
Ok, question - what's stored inside of the spell lists? Because, I'm not so sure that you can do the whole [list[1].name] mabo.

I am going to try the type cast since the Spell is only a child of /datum