ID:155354
 
As the title says, how would I go about detecting an object in a screen_loc var?
Try this.

mob
DeleteSpHud() // Delete a special part of the hud
for(var/obj/HUD/H in src.client.screen) // Loop through screen objects.
if(H.screen_loc == "1,1")
del(H)
You don't want to look at the screen_loc var, you want to look at the list client.screen.

client/verb/CheckObjInScreen(screenloc)
for(var/obj/Obj in screen)
if(Obj.screen_loc==screenloc)
world<<"[Obj] is in [src]'s screen at [screenloc]"
return Obj


I think something like that should work. I've never made anything like it, but that's the general idea. You need to check the objects in client.screen against the location you're looking to identify. You could also return a list by adding Obj to the list if you have multiple objects in the location.