ID:150150
 
Okay this one I've been puzzling over for a while, how do you make so that you can see out but not into a building? Like through a tinted window on a car.


THANKS!!!
unimatrix (www.freewebz.com/thazquest/)
unimatrix wrote:
Okay this one I've been puzzling over for a while, how do you make so that you can see out but not into a building? Like through a tinted window on a car.

Since opacity (or the lack thereof) in BYOND works both ways, I think the only way to do this would be to use the dummy object solution I've mentioned before. The building interior should be on a different z-level, with the immediate surroundings all replicated from the original z-level. Anyone inside the building can look out at the dummies, which look just like the real things moving around outside. Anyone outside is on the other z-level, and the windows aren't "real" there.

Lummox JR
In response to Lummox JR
Or a better easier way would be how you set the 3 spaces in on both sides of the window. Make use of area/ and if the person is standing in the view area then the opacity for the window is such, and if they are in the Non-view area, change the opacity of the window so they can't see in.

LJR
In response to LordJR
LordJR wrote:
Or a better easier way would be how you set the 3 spaces in on both sides of the window. Make use of area/ and if the person is standing in the view area then the opacity for the window is such, and if they are in the Non-view area, change the opacity of the window so they can't see in.

LJR

Sorry, but this just plain won't work, unless it's a one-person game. Opacity changes will happen for all clients, not just for the person who walked towards the window.
I'm not sure how well this will work, since I haven't tested it yet. It works on a principal similar to the fog of war code I've been working on (which would work a lot better if I can get some support for my request at [link] ;)

  • Give the object opacity = 0, so everyone can see through it.
  • Give clients (or mobs, depending on how you prefer to do it) a list variable to store images.

    1. When a player moves, check to see if a one way mirror is in sight.
    2. If there is a mirror, see if the mob is on the side that's blocked.
    3. If sight should be blocked by the mirror:
      1. Store view(world.view,mob) in a list.
      2. Make the object opaque.
      3. Subtract view(world.view,mob) from the view list. This list now contains the items that should be blocked from sight by the mirror.
      4. Return the object opacity to 0, so everyone can see through it again.
      5. Loop through the view list and create images over each turf to block them from sight.
    4. If the client image list contains images, loop through them and delete them.
    5. If there is a new view list created from the mirror blocking the mob's sight, set the client's image list equal to the new view list.


The only real problem is that players can right click the blacked out areas to see what atoms are there that have verbs attached to them. Also, NPCs will still react to things behind the mirror if you don't make a special view() proc to keep them from seeing behind it.

[Edit] A little demo here: http://shadowdarke.byond.com/snippets/OneWayView_src.zip
In response to Skysaw
hey would this work? a mob enters the area and an object is put in the src's view that is dense, but only that mob can see it?