ID:270293
 
Okay, my water obj is dense and when it bumps into dense turfs with a certain variable set to 1 I want the water to move into it's tile. Someone suggested to me to use Bump(), but after I looked it up real quick in the reference I saw it only works with Move(). However, the water moves with step_rand(). I saw get_step_rand(), but I don't know how to use it (when the step_rand fails) to find the dense object and check if it has the var set to 1 and if it does move the water into its tile. If someone knows an easier way to do this I'd appreciate your input, but I have all the vars set for the objs in all ready so I wouldn't want to change from that indentification system.
Justin Knight wrote:
Someone suggested to me to use Bump(), but after I looked it up real quick in the reference I saw it only works with Move(). However, the water moves with step_rand().

step_rand() calls Move(), so Bump() would work. You also could overwrite Enter() to allow these water objects in.

~~> Unknown Person
In response to Unknown Person
Unknown Person wrote:
step_rand() calls Move(), so Bump() would work. You also could overwrite Enter() to allow these water objects in.

Okay, although what I didn't tell you is that i've already tried in numerous ways with Bump(), and it's not working for me, even if I make it as simple and straightfoward as possible. For example:
    water
icon_state = "water"
layer = MOB_LAYER+2
density=1
Bump(var/obj/A)
if(A.movable||A.waterable)
src.loc=A.loc

I don't know why the water won't move into an object's tile if it's movable or waterable; this is very straightfoward code. I tried overriding the Enter(), but I also heard that it was only for turfs and areas, not objects. I set the objects' densities to zero and overrode the Enter(), actually based off of one of your code segments, but to mobs it acted as the object was stil undense.
In response to Justin Knight
step_rand obviously already checks, if the new location has density. Try: step(src, pick(NORTH, SOUTH, WEST, EAST, NORTHWEST, SOUTHWEST, SOUTHEAST, NORTHEAST))
In response to CIB
That's not the same as step_rand?
In response to Justin Knight
No, it isn't. step_rand only moves to a non-dense location, so it doesn't call Bump()
In response to Justin Knight
I'd actually use Enter(). Also, Enter() is located under /atom, so it will work for mobs, objs, turfs, and areas.

  Enter(obj/O)
if(isobj(O))
if(O.movable||O.waterable) {src.loc=O.loc;return ..()}
return 0
In response to CIB
Now it's completely ignoring densities and going anywhere on the map it feels like.
In response to Mega fart cannon
turf
Enter(atom/A)
if(istype(A,/obj/Water))
if(movable||waterable)
return 1
return ..()

I think that's a bit more of what you're looking for
In response to DarkCampainger
Yea, also, you have an extra "||" operator at the end of that if() statement. :P
In response to Justin Knight
Are you sure, that you deleted all the Enter() and whatever stuff again? You only need the Bump() proc.