ID:144495
 
Alright, my aim here was to create a ladder turf so that the player would not have to execute a verb in order to use it. Ladder code is like this:

Code:
    ladder
icon = 'ladder.dmi'
Entered(mob/M)
if(ismob(M) && M.canclimb)
if(icon_state=="up")
M.Move(usr.z++)
else
M.Move(usr.z--)


The ladder WORKS but,

runtime error: Cannot execute null.Enter().
proc name: Move (/mob/Move)
usr: Magicsofa (/mob/player)
src: Magicsofa (/mob/player)
call stack:
Magicsofa (/mob/player): Move(1)
the ladder (157,241,1) (/turf/ladder): Entered(Magicsofa (/mob/player), the floor (157,242,1) (/turf/floor))
Magicsofa (/mob/player): Move(the ladder (157,241,1) (/turf/ladder), 2)

So essentially it doesn't matter - if you climb the ladder and a dense object is there, you still occupy the spot. Anyway, I don't know what to do with this. I could override mob/Move(), telling it not to call Enter under this condition, or something? I wonder if there is a way to pass src to the Enter proc?

thanks


oh yeah I replaced usr with M...dur
:/ not sure what you mean but try this nifty demo I made http://developer.byond.com/hub/DarkEmrald/DE_Music should have a thing or two about telporting wit ease.
Your call to Move() is invalid. Move() takes an atom as an argument, not a pair of coordinates. Use M.Move(locate(M.x,M.y,M.z++)) and M.Move(locate(M.x,M.y,M.z--)) respectively.
In response to Android Data
ah, thank you
In response to Android Data
hm I had to use M.Move(locate(M.z++)) or else it would start an infinite loop...weird
In response to Magicsofa
Magicsofa wrote:
hm I had to use M.Move(locate(M.z++)) or else it would start an infinite loop...weird

Whoops, sorry! Calling Move() executes the procs like turf.Entered() which you're using to move to the ladder. The result? You keep going up and up and up till' there are no more z levels left.
In this case, you should just set M.loc directly or make a check of some sort if the movement was not initiated by another ladder.