ID:140490
 
Code:
obj
Spikes
density = 1
icon='obj.dmi'
icon_state="spike"
Bump()
usr.die()
turf
Spikes
density = 0
icon = 'obj.dmi'
icon_state="spike"
Enter(mob/M)
M.die()


Problem description:
I want it so when you fall on Spikes you call the die proc. It's just not happening. What's wrong?

Bump() is called on the object that bumped into something, NOT on the person who was bumped... if you want something to be called from a bumped object, you need to define a custom procedure for it ([link]).
In response to GhostAnime
I don't think you understand, I need it so you FALL on these spikes, and death check is called. It's a sidescrolling game. (edit: OP is me, brother's account.)
I've tried checking mob's direction, and I still get the same outcome each time. (I go through the spike, nothing happens). Density IS 1.
In response to Kirone
The post linked to would explain how to do that. Just because you are moving people SOUTH relatively often does not change anything.

Unless you are doing something silly like modifying x/y/z directly, I suppose.
In response to Garthor
Garthor wrote:
The post linked to would explain how to do that. Just because you are moving people SOUTH relatively often does not change anything.

Unless you are doing something silly like modifying x/y/z directly, I suppose.

I have a loc proc that adds 1 according to the set gravity, so yes. I guess I am modifying it directly.
In response to Kirone
That's your problem, then. You need to not do that. Use step() or Move() instead.
In response to Kirone
Code:
turf
Spikes
icon='Spikes.dmi'
Enter(A)
if(ismob(A))
var/mob/M = A
if(M.client)
M.icon='DeadGuy.dmi'
sleep(15)
M.loc=locate(1,1,1)
M<<"<font color=red><font size=3>You fell on the spikes and died!"

How about you totally change up the coding like this?
In response to FangBlade
Note that you also should not be using Enter() for this purpose. Entered() would be more suitable, or Bumped().
In response to Garthor
I don't think anyone's listening-- when you JUMP on top of the spike, you go right through. Density is SET to 1. How can I make it so when it FALLS onto the spike that it calls the DEATH proc?

Sheesh.
In response to Kirone
You're the one who isn't listening, I'm afraid. Why are you modifying x or y? step() exists and should be used in it's place.
In response to Kirone
The problem you describe is a result of you modifying y values directly. To fix this problem, don't do that.

In the future, if people aren't understanding what you're saying, there are two likely reasons:

1) You are not expressing yourself clearly.
2) You are not understanding their responses.

Getting pissed at the people trying to help you is not the solution to either of these problems.
In response to Moonlight Memento
I've tried step. I am using a side scrolling engine, and it does checks on the turf or objects below it. I tried adding a check for /obj/DEATH/Spikes, but that doesn't seem to work either.


Here's a snippet of the check:

proc/CheckLure(var/mob/m)
var/obj/chk = locate(m.x,m.y-1,m.z)
if(istype(chk,/obj/DEATH/Spikes))
m.Die() // call death proc
In response to Kirone
Yes. That is still incorrect as you are still not doing what we are telling you to. I could correct it, but that would just encourage you to do it that way, which is incorrect, when the correct option is to be using step() to move players instead of modifying x/y/z or loc directly.