ID:179615
 
Ok, I fixed my previous problem. My current code is:

mob/var/list/obj/spells

mob/var/Stat()
statpanel("Inventory",contents - spells)
statpanel("Spellbook")
stat(spells)

mob/magic_seller/Talk()
shop code here
var/obj/spell/magic = new buying.type //buying is the spell that you're buying, I'm using fireking's shop code
magic.Move(usr)
if(usr.spells >= 7)
usr << "You know too many spells already, sorry."
del(magic)
return
usr.spells += magic
usr << "You learned the spell of [src]!"
usr.GP -= buying.cost

It all compiles fine. The bold part is the problem. When you add magic to the spells list, the first spell is fine. All the spells after the first one, however, get a runtime error: type mismatch, and they're not added to the spells list. Is there anyway to correct this?

Thanks in advance.
I hate to bump myself, but I really would like a reply to this, like why it isn't working or an idea, at least. Pleeeeaaaase help!
In response to WizDragon
did you declare the list with more than one open spot? like this. mob/var/list/spell[1]? that may be the problem

PS. unless your post is three or more pages back, you probably shouldn't bump. I usaully check about 2 to 3 pages back on the forums. (you may have heard this from nadrew...)
In response to Nebathemonk
I didn't hear that from Nadrew, oh well, I've heard it now. ^_^

Thanks!

There is one more thing, however.

mob/var/list/obj/spells[1]

Stat()
statpanel("Spellbook")
stat("Spells")
stat(spells)

That leaves a space between "Spells" and the spells list on the statpanel "Spellbook." Is there any way that I can fix this? Also, why isn't there a len var for the spells list?

Thanks again
In response to WizDragon
Ack, I'm going to write out a webpage for something I posted a while back and get back to you on it. (The bump post thing)