Arma 3 Scripting

currentVisionMode

  • Global argument
  • Arma 3 v0.50
  • First in Arma 2: Operation Arrowhead v1.50

Command · Markdown · JSON · original wiki page

Description

Returns current vision mode of unit's weapon. Vision mode could be one of:

Alternative syntaxes additionally return FLIR index (see setCamUseTI) of the thermal vision mode (See also "VisionModeChanged" entity event handler)

Syntax

Syntax 1

currentVisionMode entity

Parameters:

Returns: Number - vision mode (0 on error, e.g on objNull)

Syntax 2

since arma3 2.08

currentVisionMode [entity]

Parameters:

Returns: Array format [visionMode, flirIndex] where:

[-1, -1] on error

Syntax 3

since arma3 2.08

vehicle currentVisionMode turretPath

Parameters:

Returns: Array format [visionMode, flirIndex] where:

[-1, -1] on error

Syntax 4

since arma3 2.08

unit currentVisionMode weapon

Parameters:

Returns: Array format [visionMode, flirIndex] where:

[-1, -1] on error

Examples

Example 1

_visionMode = currentVisionMode gunner _tank;

Example 2

if (currentVisionMode player == 1) then
{
    hint "nightvision active";
};

Example 3

private _detailedVisionMode = currentVisionMode [gunner _tank];
_detailedVisionMode params ["_mode", "_flirIndex"];

Example 4

private _detailedGunnerVisionMode = _tank currentVisionMode [0];

Example 5

private _detailedWeaponVisionMode = player currentVisionMode "";

See also

disableNVGEquipment · disableTIEquipment · camUseNVG · setCamUseTI · currentMagazine · currentWeapon · currentMuzzle · currentWeaponMode · currentZeroing · magazinesTurret · weaponsTurret

Community notes

AgentRev

Caution

This information is obsolete as of Arma 3 v2.08.

The return value is somewhat erratic for UAVs. For example, if you are connected to a UAV, with the turret set to thermal vision and PIP feed enabled, currentVisionMode gunner _uav returns 2 when controlling the turret, but returns 0 after releasing control, even thought the PIP feed is still in thermal mode. With nightvision, it will return 1 whether or not you are controlling the turret, but if you switch from 1st to 3rd person before releasing control, then it returns 0 afterwards...