Anyone know of a way to effectively pull off seperate "channels" of invisibility?
Like right now... you set somethings invisibility var to a value 0 to 101. Anything with a see_invisible var that matches or is higher than that value can see that thing.
But if I wanted to have say.... Player A, Player B, and C. And I have a Triangle and a Square.
I want Player A to not be able to see the Triangle or Square. I set both of their invisibility to 1 and leave Player A at see_invisible 0. He cant see them so its not a problem.
I want to keep the above and I want Player B to be able to see the Triangle but not the Square. So I bump up the Square to invisibility 2. Player B set to see_invisible 1. Now he can see the Triangle but not the Square and Player A still cant see either one.
Now I also want Player C to be able to see the Square but not the Triangle. There doesn't seem to be any way for me to do this without affecting what Player A and B can see.
There doesn't seem to be a way, that I'm aware of, to make 2 different obj and have 1 of them invisible to 1 player and the other invisible to a different player while still keeping them visible to the opposite player.
Am I missing a way of doing something like this?
May 26 2019, 12:50 pm
Best response
|
|
Images are the way to handle this.
|
Use images and output them to each client you want to see them. You've already figured out a way to do it, but you will have to code the logic for determining who gets to see it yourself. BYOND takes you part way: the rest is up to you.
once you've figured out which clients you want to see the image, output the image to that client. var/image/I = image('icon.dmi',usr) //make an image attached to usr I strongly encourage you to read the documentation on image. You can hit F1 while using dream maker to pull up the docs for images. |
The override var may also be useful, as it will replace the object's original appearance with the image, instead of showing both.
|
the documentation makes notes of several ways to display the image to specific users, it doesnt seem to mention a way to remove a player's ability to see an image.
From my understanding of this proc.... var/image/I = image('square.dmi',SHAPE_OBJ) //This will create an image, in this case the square image and attach it to the SHAPE_OBJ obj, functioning similarly to an overlay, but nobody will be able to see this image at this point. So how would I then go about reversing this then? Say I no longer want this player to see the box anymore. |
In response to IceFire2050
|
|
It's unfortunate that the documentation attempts to abstract away the details since the details are still required. The documentation even suggests that you del the image to hide it from everyone, which is bad on multiple levels.
I think it's best to work with images using the client.images variable. To show an image to a client: client.images += image To hide an image from a client: client.images -= image The output operator is still useful for adding an image to a large number of clients' images lists: clients << image And these operators work with lists of images too, of course. |