ID:1784975
 
Keywords: movements, proc
(See the best response by Fushimi.)
Code:


Problem description:
Trying to make it so whenever my character bumps into a certain dense obj, procs that are already in the works are cancelled.

Along with this, the mob's movement mirrors the obj. For example, if I'm jumping, then a missile comes and hit me from the right (while moving towards the left), the jumping ceases, and I begin to move towards the left with the object.
Best response
Killing a living procedure is not possible unless object that holds these is deleted, or src is set to null.
However you can stop a loop, by having a variable set to TRUE and adding it to the clause.

As of how the bumping would be handled;

obj/missile
density = 1 // Makes the object be dense, so it bumps.
Bump(O) // The Bump procedure is called before an object (mob/obj) walks into another object and both densities are true.
if(ismob(O)) // Checks if the object we bumped into is a mob, and if so, we make it move with us.
O.dir=dir
step(O,O.dir)
..()
mob/var/tmp/kill_CurrentSkill = FALSE
mob/proc/myCurrentSkillOnGoing()
while(myskillconditions)
if(kill_CurrentSkill)
kill_CurrentSkill = FALSE
break
src << "You are casting a skill..."
sleep(20)

mob/Bump(O)
if(isobj(O))
if(istype(O, /obj/StopsCurrentSkill))
src.kill_CurrentSkill = TRUE
..()

obj/StopsCurrentSkill
density = 1



Just a quick example of what I think is what you are attempting to do.