ID:269835
 
in my code i have it so that you choose a obj from a list of them in your view, what i want to do is this:
for(obj type you picked in view())
blah blah

does anyone know how to do this?
If I understand you correctly, you want to pick a random object in your screen? If so, just add all objs to a list, and use the useful pick() function.

mob/verb
pick_random_object()
var/list/objects = list()
for(var/atom/a in view(src))
if(istype(a,/obj/blah))
objects += a // add all objects of pathtype /obj/blah
var/random_object = pick(objects) // pick randomly an object from the list
src << "You have picked the random object in the view, [random_object]!"

obj/blah


~~> Dragon Lord
In response to Unknown Person
nope, the player chooses a object, then i want to find its type path
In response to Rky_nick
Every existant object has a type variable. Just read off of that.

mob/verb
read_type(obj/o as obj in view(src))
src << "The pathtype of [o] is [o.type]."


~~> Dragon Lord
In response to Unknown Person
ty