ID:272792
 
So, I know you can make an image, and I know that to allow a player to view it you can simply do something like:
mob << image


Assuming that I want to create an image that multiple players can see, how would I go about removing the player's ability to see the image without destroying it? (Assuming of course, that the player can already see it to begin with due to the previous piece of code being called at some point.)

Or do I need to create a separate image for each player and destroy that when the right conditions are met?
Well, if you want everyone not to see it yet retain seeing that same imafe elsewhere without outputting again, you can always change the loc of the image:
var/image/scan/SCAN = image(...)

mob << SCAN

SCAN.loc = locate(0,0,0)
SCAN.loc = locate("hell")
etc.


If you want to remove it from the image list of the client (so the image stays where it is without changing loc but make people unable to see it), remove it from the client list:
if(src.client)
client.images -= SCAN



With the above, you can do things that look for certain images to be present if you want to do something as well:
if(src.client && SCAN in src.client.images && SCAN.loc == locate("heaven"))
src << "Welcome... to heaven."
(I used a variation of the above for one of my image demos - one if you do not see the image and bump into it, nothing will happen. But if you see it, you win the round.
In response to GhostAnime
Ah good. Thanks a lot!
You're welcome.