ID:448755
 
Keywords: cross, crossed
(See the best response by Albro1.)
Quick noobish question: how do I use Cross() and Crossed() correctly??

Sorry for the trouble; help will be appreciated.

Cross() is basically the pixel-perfect version of Enter(). It is called when one object's bounding box tries to enter another's. You could use Cross() to cause something to happen or reject someone from going over an object.
Crossed() is the counterpart of Entered(), and is called when Cross() returns true and allows the object to enter another object's bounding box. You can use this for things like buttons that are pressed when you step on them.
Does that answer your question?
Does that helps me if I want mob.client not having density between them??

But with everything else.
You'll have to explain that a little better to me. What exactly are you trying to do?
All right. I want every player to have density with everything else but themselves. I just thought cross() and crossed() had to do with it.
Best response
Yeah.
mob/Cross(atom/a)
if(ismob(a))
return TRUE
else return FALSE

There's other ways to do this, such as through Bump(), but this would work too. You'll have to discuss with the real programming gurus around here on what is better and more efficient, though.
Albro check you pager i paged u
I'm on my phone, you will need to reach me via this site.
Albro's way would work but it would do so for every mob not just players, you want something that checks if they are a player then allows/disallows entry.
mob
Cross(atom/A)
if(!src.client) return FALSE
if(ismob(A, /mob))
var/mob/M = A
if(!M.client) return FALSE
return TRUE
else
return FALSE

Not sure how well that will work but i think it's about right.
You used istype() format with your ismob().
While reading your code posts I actually found my own way through it. Since Albro1 makes all mobs have no density with every other mob, but GreatFisher's was good but didn't actually work for me it gave me an idea and used this instead:

mob/Cross(atom/a)
if(ismob(a))
if(src.client)
return TRUE
else return FALSE
else return FALSE


And it actually works fine. Thanks both for the help! I really appreciate it.
You should be returning ..() instead of FALSE for atoms that aren't mobs. Other than that, the solution is perfectly fine.