ID:175140
 
In my game you get spells and I want the player to be able to look at his spells in the spells statpanel, but the coding I made isnt working...Hree's what I put:
mob
var
list
spells = list()
mob
Stat()
statpanel("Spells")
stat(src.spells)

mob
verb
Test()
src.spells += /obj/Spells/Force_Field


Is there anything wront with my coding or am I missing something? Thanks for helping!
A type path won't show up as anything but a type path when you display it in a list in stat(). You have to add an actual object for the icon to appear.

Lummox JR
In response to Lummox JR
I changed it to this:
mob
verb
Test()
new/obj/Spells/Force_Field(src.spells)


But it still doesnt work...How can I fix it?
In response to Koolguy900095
Koolguy900095 wrote:
I changed it to this:
mob
verb
Test()
new/obj/Spells/Force_Field(src.spells)


Nope, that won't work. A list is not an atom; it's not a "physical" location for an obj. You can't set the obj's loc var to the list.

Atoms aren't located in lists; they're located in other atoms. Any number of lists, though, may refer to the atom.

A more correct form would be this:
spells += new/obj/Spells/Force_Field()
That obj will continue to exist even though it's located in null, because there's a reference to it in the spells list. However the obj is not located there; it's just referenced there.

Think of an atom like a box, and a list like an address book.

Lummox JR
In response to Lummox JR
Thank you! I learned alot!