# Visibility

Visibility
Every object has a property, which controls its visibility for players. It may be either VIS_All or VIS_None or a bit mask of VIS_Owner, VIS_Allies, VIS_Enemies and VIS_God, or an array starting with VIS_Select followed by bools setting the visibility for each player. If the object has a layer, it will only be visible if the layer is visible, unless VIS_LayerToggle is set for the layer.
this.Visibility = VIS_God | VIS_Owner // The object will only be visible for it's owner and the spectators. this.Visibility = [VIS_Select, 1, 0, 0, 1]; // Visible for player 0 and 3 this.Visibility = [VIS_Enemies]; // This is also possible (as long as it is not done for a layer)

VIS_-Constants
Name
Description
VIS_All
Visible for anyone
VIS_None
Visible for noone
VIS_Owner
Visible for the owner
VIS_Allies
Visible for the owners allies (not for the owner)
VIS_Enemies
Visible for any player hostile to the owner
VIS_Select
Is ignored when the property is not an array. If set, the object is visible if the element at position (playernumber+1) is true. Try and avoid using it, you will have to update it on hostility changes and player joins.
VIS_God
Visible for spectators and in playerless editor windows
VIS_LayerToggle
For layers. Make the layer's objects visible when their layer is invisible and vice versa.
VIS_OverlayOnly
Only overlays will be visible, other visibility-rules still apply.

CheckVisibility
Caesar
2011