ID:166860
 
I have a plain idea on how to do the below, but I don't really how I would do it.

I want to make a setting where when you enter buildings or something (using an Entered() proc from either a placed area or a turf) that everything outside of it, isn't visible to the player, and the opposite when you are outside the building, where you cannot see inside it (Basically, fill it with black would be fine). Does anyone have an efficient way of doing this?

The only idea I can really think of for this is warping the player to another area, which could get rather annoying, therefore I'd rather not do that unless I have to.
You could create images and send them selectively to the user entering the building, then delete them upon leaving. If they were black opaque images, the player would percieve the outside as being black.

Look up the image() proc for details, if that's the sort of solution you're looking for.
In response to PirateHead
Ill check that out, but I'm open to any other suggestions.
In response to Polantaris
doesn't opacity do this. when you are on one side of the wall, you can't see the other side, so if you are outside you cant see thropugh a wall, and the same goes for when you are inside.

turf
wall

density=1
//if you set the opacity of a wall to 1 then you can't see through it
opacity=1
icon='turf.dmi'

wall_1
icon_state="red"
wall_2
icon_state="blue"
In response to Blooballz
But what if you want to have a space that's easy to see into (a big wide doorway), but once you're inside you can't see out? Opacity doesn't do that.
In response to PirateHead
Well, you could put an area with an opacity of 1 in the doorway.

O-matic
In response to O-matic
But then you wouldn't be able to see in. Right?
In response to PirateHead
Oh, sorry - I misread Polantaris' post. I didn't know he wanted the outside ones to see the inside part.

Sorry!
In response to O-matic
Wait, no, you read it right. Opacity is what he wanted. Heh.

obj/no_see_through
opacity=1


Just put those in the doorway.
In response to Blooballz
My problem with opacity is the fact that with it, it will cut out all the other stuff....example

bbbWWWWW
bbbWbbbW
bbbWbbbW
bbbWbbgW
WWWWbggW
gggggggW

b = blackness
g = ground
W = wall

I want all the b inside the wall dead-end to be seen, no matter what. If its opaque, then when im infront of that corner wall but to the left 1, stuff in the room will get blacked out, when I dont want it to.
In response to PirateHead
Read my reply to the information after the original suggestion of opacity. Opacity is not what I want because of this.
In response to Polantaris
Okay, I understand. You need to use images. Let's say that your world view is 5 - that means the screen is 11 by 11. At most, the user would be able to see squares 4 away from the wall - that means that you need to build a 4-square buffer of black images around the perimeter of the building.

That can either be done sequentially, as the player moves (probably best for large buildings) or all at once, as the player enters the building (probably best for small buildings). In either case, storing all those images in a special list allows them to be dereferenced quickly when they are no longer wanted, or removed from view and cached in case the user enters the building again.
In response to PirateHead
Hmmm alright, I'll check that out.