ID:156543
 
So I was wondering, because I've seen in some games where it lists all objects. How can I do that?
You'd want something like this...

for(var/obj/O in world) // loops through every /obj in the game
world << "[O] : [O.x],[O.y],[O.z] ([O.desc])" // displays its information to the world, for example; "Ball : 22,45,1 (Very rubbery)"


I suggest reading up on for() loops in either the DM guide or the reference. You can alternatively Add() them into a list variable for use later. Be wary that sometimes looping through EVERY SINGLE obj in the world can be CPU-unfriendly, so you're better off not looping through every object in the world whenever a single object is created and you want it to be added into a list of objects, rather adding the objects separately whenever New() is called.

Of course if you just want to output all the objs to the world you can ignore the previous paragraph.