ID:152940
 

Problem description:

Im making a maze type game, but players have to have density otherwise they can walk through walls, how am I to fix this?

mob
player
icon = 'player.dmi'
density=1

that's like the first thing you learn in the DM guide
In response to Popisfizzy
then players blocxk other players, i need something that will let them walk through each other, but not the walls....
In response to Derekjeterisgod
just make the spaces in between the mazes two wide instead of one
In response to Popisfizzy
Popisfizzy wrote:
just make the spaces in between the mazes two wide instead of one

I know theres a way to have a player density of 0 and a wall density of 1... Like in DWMA2 they have a player density of 0, but there is a wall density too
In response to Derekjeterisgod
mob/Move()
if(var/mob/M in get_step(src,src.dir))
src.loc=locate(M)//Moves it on top of M
else
..()


*** Untested ***
In response to Flame Sage
pdensity.dm:2:error:var/mob/M:undefined var
pdensity.dm:3:error:M:undefined var
pdensity.dm:3:error:locate:undefined proc
pdensity.dm:4:error:else :'else' clause without preceding 'if' statement
pdensity.dm:4:error::missing expression


i dont know what id need to plug in to fix that
In response to Derekjeterisgod
You copied and pasted it, tsk tsk tsk; thats veery bad =P.

Anyway just retab it, here on the forums its all done with spaces.

O-matic
In response to O-matic
well now i got 2 errors...

pdensity.dm:2:error:var/mob/M:undefined var
pdensity.dm:3:error:M:undefined var
In response to Derekjeterisgod
Hmm change it to for()
Also, put a return at the end, indented, so that it does not contiouslly warp you.

Note: This is just a patch job, this probablly isn't the best way to do it, but it works.
In response to Flame Sage
lol, players cannot move now
In response to Derekjeterisgod
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:
is what i was suppose to edit to?
In response to Derekjeterisgod
mob/Move()
for(var/mob/M in get_step(src,src.dir))
src.loc=locate(M)//Moves it on top of M
return
..()
In response to Derekjeterisgod
well, i gtg ill check back later SOMEONE HELP!
In response to Flame Sage
k ill try that
In response to Derekjeterisgod
i think i can edit that in, just add density to player so they will use the walk through, but i gtg ill let you know if it works
In response to Derekjeterisgod
my god -_- MOBS HAVE AUTO DENSTY 1!!
In response to Mega Zero x
wouldnt it be easier to make your walls use Enter()?

mob
player
density = 0

turf
wall
Enter(mob/M)
if(istype(M,/mob/player/))
return 0
In response to Farkas
mob/Bump(mob/M)
if(M.client && src.client)
src.loc=M.loc
..()


try that
In response to Dark Weasel
I think 2/10 people got what Derekjeterisgood tried to say.
He wants players be able to walk through players but not through walls. And that you would use:

mob/player{density=0}
turf/wall
Enter(mob/player/M)
if(istype(M,/mob/player))return 0
else{..()}
Page: 1 2