Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:19.1.0

Description

Description:Returns the optics information for the given vehicle turret. Returns the same data as the opticsState command.

Syntax

Syntax:turretOpticsState gunner
Parameters:
  • gunner: Object - Unit, vehicle, or gunner of turret to check the optics state of. If the gunner is in Personal Items mode, their own optics are returned, instead of those of the turret.
Return Value:Array - [active, zoom, visionMode, tiMode, selectedWeapon, transition, device, mode]
  • active: Boolean - Returns true, when the optics view is active.
  • zoom: Number - Zoom level.
  • visionMode: Number - 0 - day, 1 - night, 2 - thermal vision.
  • tiMode: Number - TI mode.
  • selectedWeapon: String - Currently selected weapon.
  • transition: Number - Transition (blending) value.
  • device: Number - Index of optic device on muzzle.
  • mode: Number - Index of optic mode of the optic device.

Alternative Syntax

Syntax:turretOpticsState [vehicle, turret]
Parameters:
  • vehicle: Object - Vehicle to check the optics state of.
  • turret: Array - Turret to check the optics state of.
Return Value:Array - [active, zoom, visionMode, tiMode, selectedWeapon, transition, device, mode]
  • active: Boolean - Returns true, when the optics view is active.
  • zoom: Number - Zoom level.
  • visionMode: Number - 0 - day, 1 - night, 2 - thermal vision.
  • tiMode: Number - TI mode.
  • selectedWeapon: String - Currently selected weapon.
  • transition: Number - Transition (blending) value.
  • device: Number - Index of optic device on muzzle.
  • mode: Number - Index of optic mode of the optic device.

Examples

Examples:
_unitOpticsState = turretOpticsState (leader group player)
_turretOpticsState = turretOpticsState [vehicle player, [0]]

Additional Information

See also: opticsState, setOpticsState, getCameraFOV, getMuzzleOpticsZoom
Multiplayer:The optics state of turrets is synchronized in multiplayer, so that this command can be used on any client.
Problems: