im trying to creat a door that as you walk through it it opens but im having problems. please help
obj/door
icon = 'door.dmi'
icon_state = "door1"
density = 0
opacity = 1
Entered(mob/M)
if(usr.cl >=0)
flick("door1open",src)
icon_state = "1open"
thanks
ID:176799
![]() Dec 9 2002, 11:56 am
|
|
Making doors turfs is usually a bad idea, because it means you need more turfs of different kinds (door-stone, door-wood, etc.) This is a somewhat nicer way to do it:
<code> atom proc Bumped(atom/movable/A) obj door Bumped(atom/movable/A) if(ismob(A)) var/mob/M = A if(istype(M) && M.cl >=0) flick("door1open",src) icon_state = "1open" mob Bump(atom/A) A.Bumped(src) </code> This gives you a Bumped() proc for everything that can be bumped. This is useful in so many different ways. I'm not sure if you can change mob/Bump() to atom/movable/Bump(), but you should try it. This moves the clutter of the bumping procedures to the object that is being bumped, instead of a long, nasty bump proc for mobs/objs. |
Try this small change:
You need to check istype(M) to make sure it's a mob entering the door and not some obj.