ID:263346
 
Code:
    Alarm
icon = 'turf.dmi'
icon_state = "whatcher"
objs = 1
Entered(o)
//world << "test" didnt do anything
for(var/mob/M in world)
if(src.owner == "[M.key]")
M << "[o] went over your alarm!"


Problem description:
its supposed to alert the owner of the person who stepped over it but it does nothing. The enter entered exit exited processes dont listen to logic. Or my logic is crap. I dont know anymore.

Rky_nick wrote:
Code:
>   Alarm
> icon = 'turf.dmi'
> icon_state = "whatcher"
> objs = 1
> Entered(o)
> //world << "test" didnt do anything
> for(var/mob/M in world)
> if(src.owner == "[M.key]")
> M << "[o] went over your alarm!"
>

Problem description:
its supposed to alert the owner of the person who stepped over it but it does nothing. The enter entered exit exited processes dont listen to logic. Or my logic is crap. I dont know anymore.


>       Entered(mob/o)
//or even
> Entered(atom/o)
//but this would announce it every time something went over it. An object or a mob.
>

In response to Mechanios
tried both. no luck.
In response to Mechanios
Mechanios wrote:
> 
> Entered(mob/o)
> //or even
> Entered(atom/o)
> //but this would announce it every time something went over it. An object or a mob.
>


Entered(mob/o) does not restrict it to only mobs.
In response to Rky_nick
Entered() isn't being called because Enter() isn't returning 1. Maybe the turf is dense?
In response to DeathAwaitsU
I should probably explain a few things
1. its an object
2. its not dense
Rky_nick wrote:
Code:
>   Alarm
> icon = 'turf.dmi'
> icon_state = "whatcher"
> objs = 1
> Entered(o)
> //world << "test" didnt do anything
> for(var/mob/M in world)
> if(src.owner == "[M.key]")
> M << "[o] went over your alarm!"
>


This is a really silly way of doing this. Instead of storing the owner's key, you should store a reference to the owner itself. Then you can just simply do an output to the owner variable.

As far as Entered() not being called, this is an /area or /turf, right? /obj types don't call Entered() when you move over them.

Hiead
If the Alarm object is a movable atom (/obj or /mob) then any entering/exiting procs will not be called when an object steps on the object, but when an object goes inside the object's contents. You will have to make your own "trigger" proc that gets called when an object enters a turf, and triggers an objs inside the turf.

turf/Entered(atom/A)
..()
for(var/atom/movable/O in src)
O.Trigger(A)

atom/movable
proc/Trigger(atom/movable/O)

obj/Alarm
Trigger(atom/movable/o)
for(var/mob/M in world)
if(src.owner == "[M.key]")
M << "[o] went over your alarm!"


~~> Unknown Person
In response to Rky_nick
As Hiead said in [link] : /obj types don't call Entered() when you move over them.

If you want it to call Entered(), than you have to rewrite the Move() for mob or whatever that may call it... it would be less of a hassel just to make it into a /turf or an /area though.

- GhostAnime
In response to GhostAnime
Thank you all very much, I have created a fix for my problem. (this was actually an ongoing problem because I've had trouble with this before.