ID:135815
 
I got this idea from WildTangent.

A collision mask would be visualed as a line of binary bits:
11001011

Each density variable would use it like that. I figure most games is already adapted since only 0 and 1 can be used for density. Anywho, here are my examples:
A body:
density=1 (01)

An intangible ghost:
density=2 (10)

A wall:
density=1 (01)

A ghost-proof wall:
density=3 (11)

The ghost may pass walls, but the solid body may not. The ghost may also not pass through the enchanted wall.

The numbers of the two colliding objects would be ANDed together. If true, the object if blocked, else it may pass.
11010000
-and-

00101111 // May pass
10000000 // May not pass
00000000 // May pass anything
11111111 // May not pass anything (If the density max was 255)

I've never used C++ before, but I'd suppose just an && would be nneeded to be changed to &, and the ability to use other numbers with density to be enabled.
It's very simple to provide this functionality on your own by overriding turf.Enter(). You would have to provide a new variable for density, since as you pointed out density may only be 1 or 0.
atom
var
fancy_density = 0 // provide a new density var
mob
fancy_density = 1 // default for mobs
area
Enter(atom/movable/A)
if(A.fancy_density & fancy_density)
return 0
else
return 1
turf
Enter(atom/movable/A)
if(A.fancy_density & fancy_density)
// let A know what blocked it
A.Bump(src)
return 0
// see if anything in the turf blocks entry
for(var/atom/movable/O in contents)
if(O.fancy_density & A.fancy_density)
A.Bump(O)
return 0
// passed all the density checks, let it in already
return 1
In response to Shadowdarke
Might I add that this is a perfect example of a good use for my BitFlag GEM :P (btw, your collision mask is an example of bitflag usage).
In response to sapphiremagus
Trying to download that rewards me with: Error: Unzip failed!

(using version 337)

In response to tenkuu
Hmm. Definitely a BYOND bug. The zipfile on the server is fine, so something's going awry. I'll put it on the bug list.
In response to Air Mapster
It's already on the bug list.
In response to Nadrew
Nadrew wrote:
It's already on the bug list.

Yes, but now's it's on the Verified bug list.
In response to Air Mapster
It wasn't before? I could have sworn I moved it..if I'm dreaming about BYOND I need help.

[edit]
I went ahead and moved this to the priority list, this bug is pretty damned annoying.
In response to Air Mapster
Air Mapster wrote:
Hmm. Definitely a BYOND bug. The zipfile on the server is fine, so something's going awry. I'll put it on the bug list.

Nevermind. sapphiremagus, your download url returns a 0-length file. That's why the zip fails to open. Not a BYOND bug! :)
In response to Air Mapster
DOH! That's what I get for trying to save Dantom some space by hosting it on my machine :(

[EDIT]
All files that I had transferred to my machine are now back up on BYOND Space. I'll be troubleshooting and trying to get apache to like me again, but until I'm sure it's stable I'll have to use Dantom's space. Sorry guys :(