ID:160988
 
How would I make it so some people can see things and others cant? And could this also apply to the density of the object, as if it is dense to one person, but not to another?
Koriami wrote:
How would I make it so some people can see things and others cant?

Look up the see_invisible and invisibility vars.

And could this also apply to the density of the object, as if it is dense to one person, but not to another?

That's a little more complicated. If you wanted nothing to be dense to a person, you would just set that person's density to zero. However, if you wanted only specific objects to be dense to a single person, depending on what you want it could be handled multiple ways. (For example, using the Bump() proc and istype() proc if you wanted a certain type of object to not be dense to a person.)
You can use images and objects together for this one:
obj/special_view
var
list/viewers //A list of mobs that can see the image.
image/image

image_icon //The icon of the image.
image_icon_state //The icon state of the image.

//By default, density is zero.
density = 0

New()
//When the /obj is created, so is its image.
image = new(image_icon, image_icon_state)

//Set the image's location to src's loc.
image.loc = src.loc

loc.divert_handling = src //See below for info on
//this.

Enter(mob/m)
//If m is in the viewers list, then this will return
//false, meaning they can't enter. If they aren't,
//this will return true, meaning they can.
return !(m in viewers)

proc
AddViewer(mob/m)
m << image //Allow them to see the image.
viewers += m //Add them to the viewers list.

RemoveViewers(mob/m)
viewers -= m //Remove them from the viewers list.

//Unfortunately, I know no other way to disallow
//a player from seeing a /image object, except
//like this.

//Delete the image, then recreate it.
del image
image = image(image_icon, image_icon_state)
for(var/mob/m in viewers)
//Resend the object to the players.
m << image

turf
//This will make the turf divert handling of movement
//to a specified /atom (for this case, it'd be the
// /obj/special_view object).
var/atom/divert_handling

Enter(mob/m)
if(divert_handling)
//If divert_handling is true, make the object
//that *should* be stored there handle entering.
return divert_handling.Enter(m)

//If it isn't, let the turf handle it.
return ..()

Exit(mob/m)
if(divert_handling)
//This is here for consistency. It works the
//same as Enter(), above.
return divert_handling.Exit(m)

//If it isn't, let the turf handle it.
return ..()