ID:175412
 
Well, Im trying to make it so the stairs will always send you one Z level up or down (depending on the stairs) but there is something wrong with this:
turf
stairsup
icon = 'stairs.dmi'
stairs
icon_state = "stairsup"
Entered()
usr.loc = locate(usr.x, usr.y, usr.z+1)

(the "usr.z+1)" part is suppose to be attatched to the line above.)

Everytime I go on the stairs my screen goes black instead of talking me to the room i have layed out on the Z level above.

Thanks,
o)-< Aleis >-(o
Well, first thing is you shouldnt use usr in Entered()
You want to do something like:

turf
stairsup
icon = 'stairs.dmi'
stairs
icon_state = "stairsup"
Entered(mob/M)
M.loc = locate(M.x, M.y, M.z+1)


The other thing is make sure that you have something on the map exactly 1 z-level above the stairs (ie. if the stairs are at 50,50,1 make sure there is something at 50,50,2)
In response to Nick231
I see.. I'll try that and get back to the forum in a minute. I see how i messed up now.

Thanks,
o)-< Aleis >-(o
In response to Aleis
AH! I think my usr.x and such would've worked. I had stairsdown instead of stairsup on the map. Therefore the guy was going to a Z level that didnt exsist.

Thanks anywho,
o)-< Aleis >-(o
In response to Aleis
usr may seem to work for now, but come later on you will find that it may cause errors, using Entered(mob/M) has the same effect (M is the usr) it is explained more in depth here: http://www.byondscape.com/ascape.dmb/LummoxJR.2002-1104/
In response to Nick231
sorry, im not a subscriber to BYONDscape, but i see how it could affect things (sorta). Anyway, its working now so thanks for the help.

o)-< Aleis >-(o
In response to Aleis
You don't need to be a subscriber for the articles (at least, not the ones I've been to). Lummox's "usr Unfriendly" saved my life* on many an occasion.

*What I mean is, it saved me from completely scrapping my code and starting over.
In response to Aleis
Aleis wrote:
sorry, im not a subscriber to BYONDscape, but i see how it could affect things (sorta). Anyway, its working now so thanks for the help.

The usr Unfriendly column is non-subscription content, by my request. I figured it'd save a lot of grief if newbies could be directed to it.

Lummox JR