ID:176389
 
Is it possible to make stairs that when you step on them it adds layers to a mob? Basically I have an overpass. I want people uder it to be covered by the turf, but if they take these "magical" stairs up to the top the mob will show up over the turf. I hope you can understand what I'm asking.
Jnco904 wrote:
Is it possible to make stairs that when you step on them it adds layers to a mob? Basically I have an overpass. I want people uder it to be covered by the turf, but if they take these "magical" stairs up to the top the mob will show up over the turf. I hope you can understand what I'm asking.

Yes, this is possible; I believe someone may have done it, but I forget who.

I thought of doing this myself at one point, but didn't have much reason to at the time.

Lummox JR
maybe something like adding layers to your guy to?

you might need to make the stairs bigger to make it so you can't walk off the stairs....

turf
Stairs
icon = 'Stairs.dmi'
icon_state = "Stairs"
Entered(O)
usr.layer = 1
Exited(O)
usr.layer = 0

thats kinda how I would do it
In response to Shy_guy197
Shy_guy197 wrote:
maybe something like adding layers to your guy to?

you might need to make the stairs bigger to make it so you can't walk off the stairs....

turf
Stairs
icon = 'Stairs.dmi'
icon_state = "Stairs"
Entered(O)
usr.layer = 1
Exited(O)
usr.layer = 0

thats kinda how I would do it

GADS! Why do you people keep doing this?!

DO NOT use usr in Entered()! Do not use usr in movmenet procs!

Dream Tutor: usr Unfriendly

The problem is also considerably more difficult than your code will deal with, but this isn't going to help anything.

Lummox JR
In response to Lummox JR
I think it might be in part due to an erroneous listing in the reference, or that somehow they've been tricked into assuming usr = user. Hmm...
turf/pit
Entered(O)
usr << "OUCH. You fell in a pit!"




In response to tenkuu
well I can't help show the hard way but... I't would be that hard to do... how do you do it?

turf
Stairs
icon = 'Stairs.dmi'
icon_state = "Stairs"
Entered(O)
usr.layer = 1
Exited(O)
usr.layer = 0

mob.Move()
for(var/turf/Floor/L)
if(usr.layer == 1)
if(usr.loc==locate(L.x-1, L.y, L.z)
return
if(usr.loc==locate(L.x+1, L.y, L.z)
return
..()

i'm not a expert coder but... this should work for only going up stairs.. straight up that is...
In response to Shy_guy197
Good job at totally ignoring Lummox JR's post and further infecting BYOND with the usr virus.
In response to Shy_guy197
Duh!

I just told you usr doesn't belong in movement procs. You not only repeated the previuos erroneous code, but you actually used it in Move() too! At least when people put it in Entered() and Exit() it's a somewhat honest mistake because they forget what they're supposed to use and src isn't it. In Move() src is correct, so use it.

Lummox JR
In response to tenkuu
tenkuu wrote:
I think it might be in part due to an erroneous listing in the reference, or that somehow they've been tricked into assuming usr = user. Hmm...
turf/pit
Entered(O)
usr << "OUCH. You fell in a pit!"

That's been pointed out more than once, and recently I posted it anew in Bug Reports in hopes of getting it fixed.

Lummox JR
In response to Lummox JR
well I wasn't ignoring I was simply trying to help

_>

oh well use another way other than mine because like I said... I'm not an expert coder
In response to Shy_guy197
Don't help people with things you don't know how to do.
In response to Garthor
to tell you the truth.. I don't wanna be mean but... he didn't get a reply then I replied with the simple need to help... then I try to say sorry and you came back and say Don't help people with things you don't know how to do.... which no one else was replying to him am I right? only one reply and it really didn't help...

anyways I was trying to find the best possible way that I would do it... not what an expert would do... so I'll just say this I'm sorry for trying to help by posting about something I had no idea what to do...