ID:1330195
 
Is it possible to control an atoms invisibility with bit operators and allow people whose see_invisible variable match it see it?
Example...
mob/verb
CreateImage()
var/image/S = new("HiddenText",usr)
S.visibility = HIDDEN //or S.visibility |= HIDDEN this is just an example so I don't expect it to be 100% correct.
usr.see_invisible |= HIDDEN //usr can now see atoms with the HIDDEN invisibility
spawn(100)
usr.see_invisible &= ~HIDDEN //usr can no longer see the atoms

That is basically what I mean. Is this possible, and if so what is the correct way to do this?
You could check out Forum_account's Visibility Groups library, which I believe handles visibility using bit flags.
In response to LordAndrew
LordAndrew wrote:
You could check out Forum_account's Visibility Groups library, which I believe handles visibility using bit flags.

I have, and it works. But the issue is that the way I need it requires that this be able to work on overlays, which unfortunately it doesn't seem to.

The method I mentioned in my first post does work, but not on overlays. When the object is set as an overlay it constantly displays, regardless of if your see_invisible variable allows you to. The only other thing I have been able to think of would be to make the object constantly relocate to the person it is supposed to be an overlay of. The issue with that being that it will not change icon states with the player and probably use up more CPU (a minor amount probably, but more than what needs to be used.)
In response to Koriami
Hmm. Forum_account has another library that handles overlays too in a more robust manner than the built-in method, maybe the two libraries can be combined to produce the functionality you're looking for?
In response to LordAndrew
LordAndrew wrote:
Hmm. Forum_account has another library that handles overlays too in a more robust manner than the built-in method, maybe the two libraries can be combined to produce the functionality you're looking for?

I'm still getting the same issue... I'm not sure if that is because I can always see my own overlays? Maybe other people can't. I'll have to test that.
Edit: Turns out everyone can see it, and not just myself.
I figured out a simple workaround for it. I appreciate the help LordAndrew.
Pretty much what I did was, since I need it to follow my character like an overlay, create an object with the visibility setting that I need it to have. Attach it to a variable of the mob, then when the move proc is called do a relocation. That doesn't take up too much CPU and works.
Are you using overlays or images? In the snippet you posted you're using images. Overlays should only show if the mob they're attached to is visible.
In response to DarkCampainger
DarkCampainger wrote:
Are you using overlays or images? In the snippet you posted you're using images. Overlays should only show if the mob they're attached to is visible.

I tried it both ways. The thing about it was that I hadn't realized the limitations of overlays. Not realizing you couldn't control the invisibility of an overlay I tried to change it, which obviously didn't work.

After that, I tried it with images. However, images require that you allow someone to see it. That is closer to what I was aiming for, but still not independent enough for what I am using it for.

Because there are multiple instances of this particular image, I was trying to make it so that by changing the see_invisible var would allow the player to see all instances.

I found that the method I mentioned I used in my previous post works well for what I was trying to accomplish. The only issue with that being if I want to click the mob, I click the object instead. Though, I'm sure I can simply make it so that when you click the object it makes you click the mob instead.
Be careful with images... you have to refactor who can see the images when people login and out and such.