ladders
parent_type = /obj
icon = 'objects.dmi'
up
icon_state = "ladderu"
Entered(mob/M)
if(ismob(M)&&M.key)
M.loc = locate(M.x,M.y,M.z--)
Won't work. Nothing happens, at all. Even if I remove the if(ismob) part.
ID:268851
Dec 5 2004, 5:23 pm
|
|
ladders Won't work. Nothing happens, at all. Even if I remove the if(ismob) part. |
Dec 5 2004, 5:56 pm
|
|
It's quite simple really - the "Enter(), Entered(), Exit(), Exited()" procs are only called when you "Enter()/Exit()" their contents through "Move()". So, even though you're walking over the object, you're not actually in its contents - you're in the turfs contents.
|
In response to Teh Governator
|
|
So... what would I do to do that? Modify Move()? Or make it a turf?
|
You need to work with turf/Entered(), not obj/Entered(), to achieve the result you want. One solution is to check each obj in the turf for some special trigger, like so:
obj Incidentally doing M.z-- and setting M.loc is going to be counterproductive. locate(M.x,M.y,M.z--) returns the current location, and M.z-- will move M for you; then M.loc is being reset to the old location. If this was --M.z instead, it would be redundant, but it would work. The best of both however is M.z-1. Lummox JR |
In response to Lummox JR
|
|
Thanks, Lummox. :)
That did the trick. [Edit] Another question now... for(var/mining/wall/W in view(5)) It all works, except it doesn't delete the stuff on the floor below(the wall). Otherwise, it works. |