ID:176305
 
So if certain mobs move in water and/or rock they can move? but others cant go on it (example: a boat going in water, but others cant)
turf/Water
Enter(mob/P)
if(istype(P,/mob/boat)) //if its a boat
return 1 //allow it
else //if not
return 0 //don't allow
In response to Weedman
how do i make it so the density is one tho...cuz at he start of the game it randoms ur starting spot and i dont want them to go on the water
In response to Weedman
Weedman wrote:
<code> > turf/Water > Enter(<font color="#ffffdd">atom/movable/</font>P) > if(istype(P,/mob/boat)) //if its a boat > return 1 //allow it > else //if not > return 0 //don't allow </code>
Look up Enter().
Also, I don't think you closed the DM tag... you should.

As for the density question... perhaps use another variable?
turf/
var/canstart = 0
New()
..()
if(canstart == 0)
canstart = density

Then check in your random location proc if canstart == 0. If it does, he/she can start there. For the water, use canstart = 1 and density = 0
-<font color="#33ff33">Nova</font>
In response to Nova2000
k, tnaks
In response to Koolguy900095
Enter() can be called without actually doing anything. To check if you can enter a turf, just call T.Enter(src). That way it takes into account other mobs, and special conditions.
In response to Nova2000
Actually, you should return ..() to allow movement into the turf instead of return 1. That way, if there is another mob/obj blocking you, you can't move into it.