ID:143717
 
Here's the code:

var
list/baseset = list()

World
New()
for(var/obj/colors/C in typesof(/obj/colors/))
baseset.Add(C)

return ..()


That code is supposed to add every object under obj/colors/ to the list baseset, however it does not. I even tried the following:

var
list/baseset = typesof(/obj/colors/)


Neither of the two will add all of the certain object to the list. Am I doing something wrong?
First, you have a capital W on world, and I'm not sure what that'll do. Second, try var/C in typesof(/obj/colors/) instead. var/obj/colors/C will only apply to real objects of type /obj/colors. typesof() returns a list of typepaths.
Well the thing is, it is adding them to the list but only as the type path. You see, you'll have to actually create the objects in order for them to show up in the list. Here is a simple way to do it.

world
New()
.=..()
spawn() SortList(baseset)//call proc

var/tmp/list/baseset=typesof(/obj/colors/)//list containing colors
proc/SortList(list/selected)
for(var/S in selected)//for all the type paths in the list
var/obj/B=S//define the type path to be an obj
var/obj/A=new B//create the obj
selected.Remove(S)//remove the type path from the list
selected.Add(A)//add the object to the list
for(var/obj/A in selected)//search the list for unwanted objects
if(A.name=="")//if its unidentifiable by name
del(A)//delete it