ID:179645
 
I'm trying to make a list like the contents list, so that objects can be inside it. I tried this:

the_list += the_object

but that only put the text into the_list.
I also tried this:

the_object.Move(usr.the_list)

and that didn't do anything. Is there any way I can do this, so that the object itself enters the list, so that you can click on it and the icon is there like in the contents list?

Thanks in advance.
You could try making it an object list, such as
var/obj/list/the_list
and then adding things to it (but not moving them to it).
In response to Cinnom
ok thanks
WizDragon wrote:
I'm trying to make a list like the contents list, so that objects can be inside it. I tried this:

the_list += the_object

but that only put the text into the_list.

That will work. I think what you mean to say is that whatever you're doing to display the_list to the user isn't showing the icons.

I also tried this:

the_object.Move(usr.the_list)

and that didn't do anything. Is there any way I can do this, so that the object itself enters the list, so that you can click on it and the icon is there like in the contents list?

The reason Move() isn't working is that the_list is not an atom; it's not a valid value for the_object.loc.

I think you're confusing lists with actual items' contents lists, where the concepts aren't really the same. You can move an object into a list, and have the list function as a sort of virtual atom, a container of sorts, but to do it you'd have to set the_object.loc=null when you added it to the list, and set the_object.loc to some other value when you removed it.

When displayed in the stat panel, I believe any list should still function the same as contents. I could be wrong; this could be a special behavior of the contents list, but I don't think it is.

Lummox JR