NWNX:EE  8193.36.12
Visibility

Readme

Allows the visibility of objects to be overridden globally or per player

Files

file  nwnx_visibility.nss
 

Functions

int NWNX_Visibility_GetVisibilityOverride (object oPlayer, object oTarget)
 Queries the existing visibility override for given (oPlayer, oTarget) pair. If oPlayer is OBJECT_INVALID, the global visibility override will be returned. More...
 
void NWNX_Visibility_SetVisibilityOverride (object oPlayer, object oTarget, int nOverride)
 Overrides the default visibility rules about how oPlayer perceives oTarget. If oPlayer is OBJECT_INVALID, the global visibility override will be set. More...
 

Function Documentation

◆ NWNX_Visibility_GetVisibilityOverride()

int NWNX_Visibility_GetVisibilityOverride ( object  oPlayer,
object  oTarget 
)

Queries the existing visibility override for given (oPlayer, oTarget) pair. If oPlayer is OBJECT_INVALID, the global visibility override will be returned.

  • NWNX_VISIBILITY_DEFAULT = Override not set.
  • NWNX_VISIBILITY_VISIBLE = Target is visible but still adheres to default visibility rules.
  • NWNX_VISIBILITY_HIDDEN = Target is always hidden.
  • NWNX_VISIBILITY_DM_ONLY = Target is only visible to DMs but still adheres to default visibility rules.
  • NWNX_VISIBILITY_ALWAYS_VISIBLE = Target is always visible in all circumstances.
  • NWNX_VISIBILITY_ALWAYS_VISIBLE_DM_ONLY = Target is always visible only to DMs in all circumstances.
Parameters
oPlayerThe PC Object or OBJECT_INVALID.
oTargetThe object for which we're querying the visibility override.
Returns
The Visibility Type.

Definition at line 58 of file nwnx_visibility.nss.

◆ NWNX_Visibility_SetVisibilityOverride()

void NWNX_Visibility_SetVisibilityOverride ( object  oPlayer,
object  oTarget,
int  nOverride 
)

Overrides the default visibility rules about how oPlayer perceives oTarget. If oPlayer is OBJECT_INVALID, the global visibility override will be set.

  • NWNX_VISIBILITY_DEFAULT = Remove a set override.
  • NWNX_VISIBILITY_VISIBLE = Target is visible but still adheres to default visibility rules.
  • NWNX_VISIBILITY_HIDDEN = Target is always hidden.
  • NWNX_VISIBILITY_DM_ONLY = Target is only visible to DMs but still adheres to default visibility rules.
  • NWNX_VISIBILITY_ALWAYS_VISIBLE = Target is always visible in all circumstances.
  • NWNX_VISIBILITY_ALWAYS_VISIBLE_DM_ONLY = Target is always visible to DMs in all circumstances.
Warning
Setting too many objects to ALWAYS_VISIBLE in an area will impact the performance of your players. Use sparingly.
Note
Player state overrides the global state which means if a global state is set to NWNX_VISIBILITY_HIDDEN or NWNX_VISIBILITY_DM_ONLY but the player's state is set to NWNX_VISIBILITY_VISIBLE for the target, the object will be visible to the player.
Parameters
oPlayerThe PC Object or OBJECT_INVALID.
oTargetThe object for which we're altering the visibility.
nOverrideThe visibility type from Visibility Types.

Definition at line 69 of file nwnx_visibility.nss.

Variable Documentation

◆ NWNX_VISIBILITY_DEFAULT

const int NWNX_VISIBILITY_DEFAULT = -1

Definition at line 12 of file nwnx_visibility.nss.

◆ NWNX_VISIBILITY_VISIBLE

const int NWNX_VISIBILITY_VISIBLE = 0

Definition at line 13 of file nwnx_visibility.nss.

◆ NWNX_VISIBILITY_HIDDEN

const int NWNX_VISIBILITY_HIDDEN = 1

Definition at line 14 of file nwnx_visibility.nss.

◆ NWNX_VISIBILITY_DM_ONLY

const int NWNX_VISIBILITY_DM_ONLY = 2

Definition at line 15 of file nwnx_visibility.nss.

◆ NWNX_VISIBILITY_ALWAYS_VISIBLE

const int NWNX_VISIBILITY_ALWAYS_VISIBLE = 3

Definition at line 16 of file nwnx_visibility.nss.

◆ NWNX_VISIBILITY_ALWAYS_VISIBLE_DM_ONLY

const int NWNX_VISIBILITY_ALWAYS_VISIBLE_DM_ONLY = 4

Definition at line 17 of file nwnx_visibility.nss.