ID:1450733
 
(See the best response by Albro1.)
Code:
var/pix = 0
var/piy = 32
var/width = 32
var/height = 4
var/mob/M = locate(/mob in obounds(src, pix, piy, width, height))
src << "[M] located"


Problem description:
I assumed that this would give me any mobs with a pixel inside the 32x4 bounding box I've described. But it's not working and I've tried many other variations. But M is always null. I did read the F1 thing.

Ref: A turf, obj, or mob.
Dist: A number (distance in pixels).
x_offset, y_offset: Shift to bounding box position (from Ref's bounding box)
extra_width, extra_height: Adjustment to bounding box size (from Ref's bounding box)
x, y, z: Lower left corner of bounding box in absolute coords; x=1,y=1 is lower left of map
width, height: Size of bounding box in absolute coords

The player's bounding box is a 16x32. I figured x_offset of 0 would place the bounding box at the same x coordinate as the lower left of the player. The y_offset makes the starting y pixel coordinate that of the player's head. (Still on the player). The height and width variables would adjust the stretching of this box from their original position.

So what am I not getting?
Best response
Since you already typecasted M as a mob, it should suffice to do this:
var/mob/M = locate() in obounds(src, pix, piy, width, height)
That seems to have been it. Thanks.
No problem. In reality it was just a syntax error with locate().