Arma 3 Scripting

Command in Weapons

currentVisionMode

Also available as Markdown and JSON, or read the original wiki page.

Description

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

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:

Syntax 3

since arma3 2.08

vehicle currentVisionMode turretPath

Parameters:

Returns: Array format [visionMode, flirIndex] where:

Syntax 4

since arma3 2.08

unit currentVisionMode weapon

Parameters:

Returns: Array format [visionMode, flirIndex] where:

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.

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...