Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.




Introduced in

Version:1.22

Description

Description:Determines the visibility of an object from a specified position, and returns the ratio of visible boundingBox corners (if none are visible, 0 is returned, if all eight are visible, 1 is returned).

Syntax

Syntax:[position, object, except, terrain] call fn_vbs_getVisibility
Parameters:
  • position: Array - Position in the PositionAGL format.
  • object: Object - The object.
  • except: Array - Array with objects which are not taken into account as view blockers (optional).
  • terrain: Boolean - Check (if set to true) the terrain for blocking the Line of Sight (LOS) to the points (optional) (VBS3 and VBS4 20.1.0+).
Return Value:Number - Visibility ratio.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Functions A-Z.

Examples

Examples:
_isVisible = [position player, target, [player]] call fn_vbs_getVisibility

Additional Information

See also: fn vbs isVisible,getVisibility, collisionDetection
Multiplayer:
Problems:

Notes