ID:140948
 
Code:
mob
icon = 'mob.dmi'

turf
grass
icon = 'turf.dmi'
icon_state = "2"
water
icon = 'turf.dmi'
icon_state = "water"
density = 1
Block
icon = 'turf.dmi'
icon_state = "1"
density=1

atom/movable/Move(NewLoc, Dir)
if(Dir == 1)
var/obj/block/block
for(block in locate(src.x,src.y-1,src.z))
jump()
return ..()
if(src.y<2)
jump()
return ..()
else
return ..()
mob
proc
takedown()
spawn(5) usr.y -= 1
atom
proc
jump()
spawn(1) usr.y++
spawn(3) usr.y++
spawn(5) usr.y++
spawn(7) usr.y++
turf
floor
blackness
icon = 'blackness.dmi'
atom
var
jumpover = 1
canjump = 0
activategrav = 1
obj
block
density = 1
icon = 'Turf.dmi'
icon_state = "1"
notblock
density = 0
icon = 'Turf.dmi'
icon_state = "1"

mob
Login()
src.loc = locate(1,1,1)
sleep(10)
spawn() src.gravity()

proc
gravity()
if(src.y>=2)
takedown()
spawn(3) src.gravity()


Problem description:

i jump, and screen goes black :(
Something is sending you outside the map causing the BSON. Something with coordinates.

Bump

You are being moved off the map by your jump proc. Add a check to make sure that y+1 isn't greater than world.maxy
Actually, in this case your gravity() proc is to blame. Think about exactly what happens when your y is equal to 2 and you aren't moving.

For something like this, you really should be using step() and get_step() for all your movement. Jumping should be handled from a proc called by client/North(), not atom/movable/Move(). And to check if you're standing on something solid, you should do:

var/turf/below = get_step(src,SOUTH)
//if we are unable to enter the turf below us
if(!below.Enter(src))
//then we're standing on something dense
else
//we aren't standing on something dense


Though you may have to write different logic eventually if - for example - you don't want people to be jumping off of other people's heads. In which case, looping through the contents of the turf looking for something that can be jumped off of (indicated by a variable, ie atom/var/jumpable) is better than looking for a single specific type.