ID:169921
 
Say i have a turf called inviso_spikehole. And I have a mob named Testman. How would I modify it so that, unless Testman had a certain var set that allowed him to see traps, all inviso_spikehole traps on the map would be invisible to him? Thanx in advance.
obj/Trap
icon = 'trap.dmi'
invisibility = 1
mob
verb
See_Traps()
usr.see_invisible = 2
usr << "<b>You can now see traps.</b>"


That should work.
If you have multiple types of invisible objects and want the ability to see each of them seperately while not seeing others, you need to use image objects.

Attach an object of type /image to the inviso_spikehole and output the image to whoever you want to see it.
var/global/list/spikeholes[0]
obj/inviso_spikehole()
var/image/I
New()
spikeholes+=src
I=image('inviso_spikehole.dmi',src)
for(var/mob/Testman/M in world)
M<<I
mob/Testman
Login()
for(var/obj/invisi_spikehole/O in spikeholes)
src<<O.I
In response to Zero's Baby
Messing with the invisibility flag may not be the way to go, if other things may be invisible too. If this is the only kind of invisible thing, though, this is the easiest approach.

Lummox JR