Visibility Groups

by Forum_account
A library to manage image objects.
ID:120594
 
This library lets you assign atoms to visibility groups and lets you specify which visibility groups a player can see. Image objects are used and managed by the library to hide or show objects based on the visibility group assignments. For example:

mob
proc
die()
// when a player dies they become a ghost and can see ghosts
vis.is_a(GHOST)
vis.can_see(GHOST)

respawn()
// when the player respawns they are no longer a ghost and cannot see ghosts
vis.is_not_a(GHOST)
vis.cant_see(GHOST)


The library manages the image object to make the dead players only visible to players that can see ghosts.

Version 3
• Changed how image objects are used. Previously, an atom's display would be replaced with an image object when its vis object was created. Now, the atom is replaced with an image object only when they're added to a visibility group (when you call the vis.is_a() proc). The reason for this is that you might have a mob who isn't in any visibility groups but has a vis object just to limit what they can see - since this mob is not in any groups they're seen by all players and don't need to be represented by an image object.

Version 2
• Added a demo that shows how to create roofs that are shown when you're outside the building, but hidden when you're inside the building.

Version 1
• Initial posting
Good job, :3 I might use it .
This library's really neat. Thanks F_A, I learned a lot from it.