ID:167374
 
can anyone help me out, i'm trying to make a fence and when u enter it u move up a space.


turf
fence
icon = 'turfs.dmi'
icon_state = "fence"
density = 1
Enter(mob/M)
M.x+=1
Well first off it will not work because it is dense
In response to A.T.H.K
oh right *smacks head* right ive done that..just gotta do the if(usr.dir = 1) and tha..
In response to Andrew001
hmm..its too fast..couldnt i use a walk proc ?
In response to Andrew001
Yes or the sleep() proc
In response to A.T.H.K
no..the sleep proc only delays it, i want it so it doesnt flicker between the movements..
In response to Andrew001
flicker=become a 'walk' icon state? If so, move the char 2 tiles up using their coordinates. Of course, seeing as you want to place them up 1 tile only, you can always move them back / forward a bit too much and then get them back again. Sounds lame, but helps.
In response to Mysame
turf
fence
a
icon = 'turfs_spring.dmi'
icon_state = "fence"
Enter(mob/M)

if(M.dir==1)
M.y+=2
if(M.dir==2)
M.y-=2

In response to Andrew001
First of all, that's probably best done in Entered(). Enter() is for checking if an atom is allowed to pass.

And, though you've given it an argument (mob/M), it can be something else but a mob that enters.
If you wish to continue passing mob/M as an argument, do a check first; if(istype(M)).
Just so we can block out the runtimes.

Also, atom.dir==1, it's much less complicated using; atom.dir==NORTH , SOUTH, WEST, EAST. Mind the caps.