ID:178658
 
How would I make it where when you run into something and keep pushing it that way, the mob that your pushing will keep moving wherever your pushing and you'll move right behind it?
Use the Entered proc to tell if you enter an object, and make that objects density=0. I will give an example by showing how to push a rock.


turf/rock
Entered()
src.loc=locate(get_step(usr,usr.dir))
Override the mob/Bump() proc.

mob
Bump(O)

if(ismob(O)) // make sure src bumped into a mob
var/mob/M = O // create a mob alias to O
var/turf/T = get_step(M, src.dir) // get the turf on the other side of M from src
var/bump_loc = M.loc // store the location the mob was trying to move to
if(M.Move(T,M.dir)) // if M is able to move to T (preserve the old direction of M)
src.Move(bump_loc) // try to move to the bump_loc again
In response to Shadowdarke
hmm..its still not working would this be right?
    SeaUrchin
icon='npcs.dmi'
icon_state="Sea Urchen"
Bump(O)
if(ismob(O))
if (usr.normalsheilda==1)
var/mob/M=O
var/turf/T = get_step(M,src.dir)
var/bump_loc = M.loc
if(M.Move(T,M.dir))
src.Move(bump_loc)
else
if (usr.normalswordb==1)
var/mob/M=O
var/turf/T = get_step(M,src.dir)
var/bump_loc = M.loc
if(M.Move(T,M.dir))
src.Move(bump_loc)
else
usr<<"<B>Ow thats spiky better not touch it bare handed</B>"
usr.health-=1
In response to SuperGoku15
Is the pushing player a SeaUrchin? I htink you are confused about which mob the Bump() proc should belong to, which is a common mistake. I'll write up a FAQ entry on Bump(). [Edit] The Bump FAQ entry is at http://www.deadron.com/byond/ByondBwicki.dmb?HowToBump

This Bump() proc should belong to the mob who is able to push things, not the mob that can be pushed.