setOpticsMode: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
mNo edit summary
Line 13: Line 13:


|p1= unit: [[Object]]
|p1= unit: [[Object]]
|p2= modeClassNameOrIndex: [[String]] or [[Number]] - Class name defined in the OpticsModes config class of the optic. Or the 0-based order of the optic modes with 0 being the default optic mode.
|p2= modeClassNameOrIndex: [[String]] or [[Number]] - Class name defined in the OpticsModes config class of the optic. Or the 0-based index of the optic modes with 0 being the default optic mode.


|r1= [[Nothing]]
|r1= [[Nothing]]

Revision as of 10:57, 24 March 2022

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.10.

Description

Description:
Sets the optic mode of the current weapon to the given class name or the index. Class name should be defined in the OpticsModes config class of the optic, index is the 0-based order of the optic modes with 0 being the default optic mode.
Groups:
Object Manipulation

Syntax

Syntax:
unit setOpticsMode modeClassNameOrIndex
Parameters:
unit: Object
modeClassNameOrIndex: String or Number - Class name defined in the OpticsModes config class of the optic. Or the 0-based index of the optic modes with 0 being the default optic mode.
Return Value:
Nothing

Examples

Example 1:
player setOpticsMode "Hamr2Scope"; // Default optic mode for optic_Hamr
Example 2:
player setOpticsMode 0;

Additional Information

See also:
getOpticsMode

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note