ID:178658
![]() Apr 19 2002, 7:35 pm
|
|
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?
|
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 |
hmm..its still not working would this be right?
SeaUrchin |
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. |
turf/rock
Entered()
src.loc=locate(get_step(usr,usr.dir))