Visibility Groups

by Forum_account
A library to manage image objects. [More]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Forum_account.VisibilityGroups##version=3

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Forum_account.VisibilityGroups##version=3

528 downloads
Version 3
Date added: Oct 1 2011
Last updated: Mar 18 2012
16 fans
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

Comments

KururugiSuzaku: (Aug 31 2013, 5:13 am)
This library's really neat. Thanks F_A, I learned a lot from it.
Flysbad: (Mar 11 2012, 5:35 pm)
Good job, :3 I might use it .