ID:262975
 

obj/Gate
Gate
name="Crystal Quest";
icon = 'Tiles.dmi'
icon_state = "gate"
density=1
Bump()
set background = 1
src.density = 0
flick("gateo",src)
sleep(25)
src.density = 1


Its not sensing the bump from a mob.

Bump() is called for the thing doing the bumping (the player, in this case), not the thing being bumped (the gate, in this case)... So your gate's Bump() proc is never called...

What you need to do for a proper bump system is add in your own Bumped() proc (an arbitrary name, but it's the most fitting) under the atom/movable type (atom/movable is any type of atom that can move; mobs and objs), and override atom/movable/Bump() to call the Bumped() of the thing being bumped into...

Luckily, Bump()'s default argument is the thing being bumped, so you can just program it as follows:

atom
movable
Bump(atom/movable/a)
a.Bumped(src)
proc
Bumped(atom/movable/a)


Now, change your gate's Bump() into a Bumped() and it will work...

You'll notice I'm also passing the bumper as an argument in our new Bumped() proc... This is handy if you want to use your objs' Bumped() procs to refer to the mob that bumped into them (like to put a bumped item into the bumper's contents, display a message to the bumper, etc)
In response to SuperSaiyanGokuX
Look up

Enter

In the DM Reference

Edit: ignore that i kinda posted in wrong topic...
In response to Yorae
I don't know if that's necessary... Yeah, you can set up your own Bump()-like system by overriding Enter(), but since BYOND has one built right in, you might as well just use that...