Srry about all the questions, I am kinda of a noob coder :D.
I want to create a multiple number of objects under a certain path and put them into a list. Kinda looks like this maybe:
mob/var/list/list1 = new()
then If I want to add those types of to that list:
usr.list1 += typesof(/obj/cards/Pack1/)
usr.list1 -= /obj/cards/Pack1
The first bit is the list I want to add to. The next bit is to add the types of objects that are under that tree and in other sub categorys. and remove the original one so no mess ups occur.
I mean I want to add anything under that, even these ones:
usr.list1 += typesof(/obj/cards/Pack1/)
/obj/cards/Pack1/Monsters
/obj/cards/Pack1/Spells
/obj/cards/Pack1/Traps
Please let me know if you need more of a debrief.
http://www.byond.com/forum/?post=195055
And as for adding the actual objects to the list instead of their types, you need to loop through a list of types and add a 'new' instance of each object. // The final list of objects |
If you want to add the actual objects to the list instead of just the type paths, you'll need to use a for(var in list) loop, where the list is typesof(), then create a new object from each reference and add them to your list of cards individually. This is only necessary if you need them to function as actual objects from within the list or if they need to retain certain variable changes.