ID:270638
 
I am sorry if this has been posted before, but after literally almost 2 hours of searching on the forums I couldn't find what I needed. Maybe I am using the wrong keywords. Well I was wondering if there was anyway to have one icon be able to have like part of it "density = 0" and the other part "density = 1" For example:



Ignore the orange part on the right that somehow got in my cropping.

Ok so the right the gray part is a sidewall. But that isnt an icon thats included with the grass. It's "over" the grass as I am going to call it. But if I make the sidewall icon a completely dense icon the whole tile would be unable to go through. And that is what I am trying to solve. So for the sidewall icon I am trying to figure out if the left side thats empty can be made non-dense and the wall itself to be dense.

The only other way I can think of doing this is making the sidewall a whole icon. But I'd perfer not to for graphic issues.

Any help would be appreciated.
U could use the pixel_x and pixel_y variables...

something like...
turf
Entered(mob/M)
M.pixel_x+=watever the num is
In response to Flame48
But doesn't pixel_x and pixel_y essentially move the whole tile left or right; up or down?
In response to Sanosake Sagara
No. In that Entered() proc, mob/M was passed as an argument, M being the mob that just Entered() the turf. See?

Though, he didn't check IF it WAS a mob, so if an obj or anything would enter it, it'd runtime.

But pixel_x would be quite buggy there. Or so I'd see it. And as that fence thing there is only a few pixels thick, I'd say;

client
North()
if(locate(/obj/northernfence) in usr.loc) {usr.dir=NORTH;return 0}
..()


That's an example. If the client will go north, but there's a fence on the same tile of him, yet the tile is drawn to be standing north (northernfence in the code), it won't move, yet he will face the tile thanks to usr.dir=NORTH.

If anyone got a better approach, I'd be glad to hear it. I'm not actually pleased with my own :x
In response to Mysame
What you could do, is to make four lists(Let's say 'northdense','westdense','eastdense' and 'southdense'), and put all the objs that have a density on one specific side in the correct list.

And then, overide client/North(), client/South(), etc, and use a modified version of Mysame's code to loop through all the objs in that loc, and see whether it is in the correct list. And tadaaa!

O-matic
Directional density...
atom
var
dir_density = 0
proc
dir_density(dir)
if(istype(dir, /atom)) //you can pass an object instead
dir = get_dir(src, dir)
return dir_density&dir
Enter(atom/movable/M)
.=..()
if(M.density || M.dir_density)
var/enter_dir = get_dir(src, M)
if(dir_density(enter_dir)) .=0
for(var/atom/A in contents)
if(A.dir_density(enter_dir))
.=0
break

Then just make an object's dir_density variable contain the bit flags for the directions you want to block movement from.
(edit)
Something else just hit me. You'll also probably want to check for directional density in the Exit function as well, or you'll still be able to walk over your wall in the other direction.
(/edit)
obj/wall
north
dir_density = NORTH
south
dir_density = SOUTH
northeast
dir_density = NORTH | EAST
obj
elevator
south_door
dir_density = NORTH | EAST | WEST
doors_on_two_sides
dir_density = NORTH | SOUTH
ramp
Enter(atom/movable/M)
.=..()
if(!(M.elevation<=elevation+1 && M.elevation>=elevation-1))
. = 0
Entered(atom/movable/M)
M.elevation = elevation
rising_to_the_north
dir_density = EAST | WEST
circular_staircase
lower_left
dir_density = WEST | SOUTH
lower_right
//I think you get the point