mob
Login()
..()
vis = new(src)
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 vis var is the object that manages visibility groups. The four procs that are shown in that example are how you use it. The argument, GHOST, is just a text string that's the name of the visibility group. You can pass the procs any number of arguments to add or remove multiple groups at a time.
The library also defines a "can_see()" proc for mobs. The proc is passed an atom and returns 1 if the mob can see that atom (based on what visibility groups the mob can see and what groups the atom is in) and 0 if it cannot. You can change this or override it to change how the library works.
By default, you can see an atom if it belongs to at least one visibility group that you can see. For example, if a mob is in the "ghost" and "lizard people" groups, you can see the mob if you can view either of those groups. You don't have to be able to view both. But, if you override the mob's can_see proc in your code, you can change it to require all groups.