ID:146331
 
Code:
mob/Move()
for(var/mob/M in get_step(src,src.dir))
src.loc=locate(M)//Moves it on top of M
return
..()


Problem description:

Its for a player to walk over another player, but when a player walks on top of another player the screen goes black.....

mob/Bump(mob/M)
if(!M)
src.loc=locate(M.x,M.y,M.z)
return
<_< not the best thing probaly but it works
In response to Cheetoz
hmmm, it made the players density = 0 didnt work
In response to Derekjeterisgod
no...it just automatically moves a player on top of another, try walking on top of a npc the (!M) only does it to players
In response to Cheetoz
You're gonna need to check the atom's density, or you could use the Enter() procedure on M's loc.
In response to Cheetoz
nope, with the code out i cannot walk through walls, with it in its changing my density every time i try to walk through a wall
In response to Derekjeterisgod
...well then i have no clue cause it clearly says Bump(mob/M) so unless you have mob walls something is wrong
In response to Crashed
how would that be done?
In response to Derekjeterisgod
if(!Enter(locate(M.x,M.y,M.z)))return

This would never allow you to teleport ontop of M unless you or M has density set to zero.
In response to Crashed
yea a density of 0 thats why i told him Bump()
In response to Crashed
so

mob/Bump(mob/M)
if(!Enter(locate(M.x,M.y,M.z)))return
src.loc=locate(M.x,M.y,M.z)
return
In response to Derekjeterisgod
One: That return at the end is not needed.
Two: That would never work. The atom needs to be dense for you to bump it, but you cannot stand on top of it because you disable it to be 'walked on'.
In response to Crashed
to me it seems he just combined our lines of code, i only had the return in there because i edited his and forgot to take it out
In response to Cheetoz
what would the code be for player density to equal 0 and not walk through walls...
In response to Derekjeterisgod
....I just set up a test game that i can zip up if you wish, it works perfectly fine
In response to Cheetoz
sure
In response to Derekjeterisgod
http://developer.byond.com/hub/Cheetoz/Demo

You should see that, it wont bump EITHER the wall or the player but then lets say you multi-key / get a friend, it will bump them without a problem
In response to Cheetoz
nope.. the players are just there its not walking threw them i multi keyed it and it didnt work
In response to Derekjeterisgod
you gotta walk through your multi key genious
Derekjeterisgod wrote:
Code:
> mob/Move()
> for(var/mob/M in get_step(src,src.dir))
> src.loc=locate(M)//Moves it on top of M
> return
> ..()
>

Problem description:

Its for a player to walk over another player, but when a player walks on top of another player the screen goes black.....

It would, since you're not using locate() correctly. locate(object) does not give you the object's location. That would be the loc var.

Lummox JR