ID:146844
![]() Jan 9 2005, 5:12 pm
|
|
obj terror TO1 icon = 'terroists.dmi' icon_state = "1" density = 1 Click() var/obj/h = new/obj/hit(src) h.pixel_x = rand(1,36) h.pixel_y = rand(1,36) This is an overlay. When i click it. Nothing happens. :( |
When you click on an overlay, the atom it belongs to's Click() proc is called.
So, say you had a /mob/player with an overlay. If you clicked on the overlay, /mob/player/Click() would get called. |
You don't. Not without making the head object an actual object (rather than an overlay) that follows the rest of the player around, anyway.
|
This requires that the mob and the mob's head are completely on seperate turfs(pixel_x and pixel_y).
atom/Click() takes a Location as an argument. That location is the location of the object clicked. So if that location variable doesn't equal the mob's location, that means that they must have clicked on an overlay that is above a different turf. :) |
That's because when an object is added to an atom is an overlay, it's not the object itself that you see but a "snapshot" of the object that, for all purposes, acts like its atom.
Translation: An overlay's Click() proc is its atom's click proc, which is why that isn't working.