ID:157462
 
I was wondering if it is possible to make objects and mobs invisible to the user unless on the same loc?
Yes, a few ways. Look up Entered(), /image, see_invisible and invisibility.
In response to Popisfizzy
It's also possible to muck around with see_infrared and infra_luminosity, like so:

mob
// Remove their normal sight entirely:
see_in_dark = 0
// Let them see all turfs/areas, and themselves:
sight = SEE_TURFS|SEE_SELF
// Allow them to see infrared objects outside their normal sight:
see_infrared = 1

area
// Turn out the lights everywhere:
luminosity = 0

obj
must_stand_on_to_see
infra_luminosity = 1
can_see_from_further_away
infra_luminosity = 10


Note that you lose line-of-sight calculations for turfs entirely, though opacity will still block the sight of objects. Unfortunately, infra_luminosity for turfs makes it so you can see every object on the turf as well (rather than just the turf), so it's not a particularly flexible solution.

Also, behavior is slightly different from Popisfizzy's suggestion, as objects will be made visible as you pass over them (say, diagonally).
In response to Garthor
Could I set all objects on a turf to 1 invisibility and on enter have them turn to 0 and exit back to 1?

I am not see how to accomplish this.. I know the first step is setting it invisible, but the object still comes up in my grid when I go over it...Just cant click it.

But I set the object invisible and then I need to set the usr to see invisible 1 but this would enable to see the items anyways, I need to only see the objects that are on the same tile.
In response to V3RR3Z
I was wondering if it is possible to simply not have

/obj/Item

show on the map.
In response to V3RR3Z
Explain in better detail.
In response to Popisfizzy
Simply that.. I wish for /obj/Item not to show on the map.. But not to disable it like invisibility does..
In response to V3RR3Z
... then make it non dense and don't give it an icon?
In response to Popisfizzy
I am wanting it to be able to be used.. so say, the Apple is on the ground, it doesnt show on map, but when your ontop it shows in the grid that shows all items in current loc.contents

----
I couldnt figure out the image thing by the way, I may be attempting the same thing just a different look.
In response to V3RR3Z
for(var/obj/Item in world)
In response to V3RR3Z
I have no idea what you're trying to do with that but I can assure you with 100% certainty that it is wrong.

It would help if you took two minutes out of your busy schedule of spamming the same goddamned thread over and over again and instead wrote a COHERENT explanation of what you wanted.
In response to Garthor
Very nice, I said I figured it out. Someone messaged me and we bounced ideals off each other. And it works fine.
In response to V3RR3Z
If you could describe what you want I'd be able to tell you how to do it properly. However, in absence of any idea of what you're asking, the most I can tell you is that looping through every single object in the world to find the one or two you are standing on is NOT fine.

At the very least, you could just reduce that to for(var/obj/O in loc).
In response to Garthor
Alright then. I will explain although it seems fine.

It is a clicking game, objects on the map are merely objects to show you where a NPC is or walls and trees that sort of things...

Objects such as items potions armor and even monster mobs only show up when on the same tile.

The goal is getting the items to show only in the output grid( grid outputs a list of items in the current loc.contents) and not on the map and only showing the current locations.. but leaving all other objects/turfs/mobs alone.
In response to V3RR3Z
world
New()
for(var/obj/Item/I in world)
I.layer = 1.9
for(var/obj/StealthedItems/I in world)
I.layer = 1.9
for(var/mob/NPC/N in world)
N.layer = 1.9
for(var/obj/Spawners/S in world)
S.invisibility = 10
for(var/mob/Spawned/S in world)
S.layer = 1.9


This is the code I am using to not show certain mobs/objs on the map.. Although the last one isnt working.
In response to V3RR3Z
Why are you giving them a layer at runtime? And why aren't you calling parent proc ..() ?
In response to Emasym
This is how I have come to a conclusion to get it to work.. and because I only wont it to run this once.