ID:1778397
 
Keywords: lists, newbieissues
(See the best response by Albro1.)
Code:
        L.Add(new/obj/ScrnLet/A, new/obj/ScrnLet/B, new/obj/ScrnLet/C, new/obj/ScrnLet/D, new/obj/ScrnLet/E, new/obj/ScrnLet/F,new/obj/ScrnLet/G, 
new/obj/ScrnLet/H, new/obj/ScrnLet/I,new/obj/ScrnLet/J,new/obj/ScrnLet/K, new/obj/ScrnLet/L,new/obj/ScrnLet/M, new/obj/ScrnLet/N,
new/obj/ScrnLet/O,new/obj/ScrnLet/P, new/obj/ScrnLet/Q, new/obj/ScrnLet/R,new/obj/ScrnLet/S,new/obj/ScrnLet/T, new/obj/ScrnLet/U,new/obj/ScrnLet/V, new/obj/ScrnLet/W,
new/obj/ScrnLet/X, new/obj/ScrnLet/Y, new/obj/ScrnLet/Z)


Problem description:
No problem, just more questions.

I know there has to be a more efficient way of adding all of those objects to my list. They're all listed under 'ScrnLet', so I was wondering how I could just cook up some to add every child of 'ScrnLet' to my list.

Second, is it possible to effect an obj's client_screen in the proc or list? Since these objects are just letter icons I made so that I can add messages to the screen momentarily (such as level completion messages, and a way to display score on screen, etc).

Finally, can the same be done with the object's icon_state? As in, when I use the list to display an object on the client screen, is it possible to determine which state the icon is in.
Best response
Look up typesof().

It returns a list containing all types underneath your specified path, plus the original path. You'll need to manually remove this like so:
L.Add(typesof(/obj/ScrnLet) - /obj/ScrnLet)


This does not initialize any of these items via new, however. This is only adding the type paths in. If you want to dynamically add these in and initialize them, you can use a for or while loop.

for(var/v in typesof(/obj/ScrnLet) - /obj/ScrnLet)
L.Add(new v)

I am not sure about what you mean with your second question, and not understanding that won't let me understand your third.
Ah. What I mean is.. For example.

Say on the login screen, I use my lists of Letters to display the message "Welcome!" on the screen.

(Follow me?)

For that to work, all my objects that were being displayed would need to have a pre-determined 'Screen_loc' value so that it could properly be displayed on the screen.

However, if I were to use those same Letters/obj later on in my game, their positioning would be in the same place as the screen_loc value has already been defined.

I'm wondering how to change the value during runtime (or to edit it in various locations of the vcode, without compromising the previous positioning).

Get it?
screen_loc can be changed at runtime. It doesn't "lock" itself or anything. When you need to change it, change it.

My question is why you would need so many other places to use it, when you can just use the built-in maptext.
Uh. I'll up maptext, I suppose. And I need it in different places for the login screen, then to display messages after completed levels.

Anywho, I'll tinker with it just to be sure. But can objects within a list have their icon_states called at will as well? (*Since have a blinking state for each letter*)
Think of a list as just a container. It allows you to take a bunch of objects and gives you an easy way to reference them all, or just one, or a select few. The objects themselves are not changed, they are just "organized".