currentVisionMode: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]2(\|.*)\]\]" to "{{GameCategory|arma2|Scripting Commands}}")
(Add more examples)
 
(45 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2oa |Game name=
|game1= arma2oa
|version1= 1.50


|1.51|Game version=
|game2= tkoh
|version2= 1.00


|arg= global |Multiplayer Arguments=
|game3= arma3
|version3= 0.50


|gr1= Weapons |GROUP1=
|arg= global
____________________________________________________________________________________________


| Returns current vision mode of unit's weapon.
|gr1= Weapons


* 0 - daytime
|descr= Returns current vision mode of unit's weapon. Vision mode could be one of:
* 0 - normal vision
* 1 - night vision
* 1 - night vision
* 2 - thermal vision |DESCRIPTION=
* 2 - thermal vision
____________________________________________________________________________________________
Alternative syntaxes additionally return FLIR index (see [[setCamUseTI]]) of the thermal vision mode (See also [[Arma_3:_Event_Handlers#VisionModeChanged | "VisionModeChanged"]] entity event handler)


| '''currentVisionMode''' unit |SYNTAX=
|s1= [[currentVisionMode]] entity


|p1= unit: [[Object]] |PARAMETER1=
|p1= entity: [[Object]] - unit or vehicle. Unit query returns current vision mode of the unit. Vehicle query returns driver seat vision mode


| [[Number]] |RETURNVALUE=
|r1= [[Number]] - vision mode
____________________________________________________________________________________________
 
 
|s2= [[currentVisionMode]] [entity]
|x1= <code>_currMode <nowiki>=</nowiki> '''currentVisionMode''' gunner _tank</code> |EXAMPLE1=
 
|x2= <code>if ('''currentVisionMode''' player <nowiki>==</nowiki> 1) then
|s2since= arma3 2.08
 
|p21= entity: [[Object]] - unit or vehicle. Unit query returns current vision mode of the unit. Vehicle query returns driver seat vision mode
 
|r2= [[Array]] in format [vision mode, FLIR index]
 
|s3= vehicle [[currentVisionMode]] turretPath
 
|s3since= arma3 2.08
 
|p41= vehicle: [[Object]] - vehicle with vision modes
 
|p42= turretPath: [[Array]] format [[Turret Path]] - path to vehicle's turret. Use [-1] for driver turret, [] for default primary gunner turret
 
|r3= [[Array]] in format [vision mode, FLIR index]
 
|s4= unit [[currentVisionMode]] weapon
 
|s4since= arma3 2.08
 
|p61= unit: [[Object]] - soldier
 
|p62= weapon: [[String]] - unit's weapon. Use "" for current weapon
 
|r4= [[Array]] in format [vision mode, FLIR index]
 
|x1= <sqf>_visionMode = currentVisionMode gunner _tank;</sqf>
 
|x2= <sqf>
if (currentVisionMode player == 1) then
{
{
hint "nightvision active";
hint "nightvision active";
};
};
</code> |EXAMPLE2=
</sqf>
____________________________________________________________________________________________


| [[disableNVGEquipment]], [[disableTIEquipment]], [[camUseNVG]], [[setCamUseTI]], [[currentMagazine]], [[currentWeapon]], [[currentMuzzle]], [[currentWeaponMode]], [[currentZeroing]], [[magazinesTurret]], [[weaponsTurret]]  |SEEALSO=
|x3= <sqf>
 
private _detailedVisionMode = currentVisionMode [gunner _tank];
}}
_detailedVisionMode params ["_mode", "_flirIndex"];
</sqf>


<h3 style="display:none">Notes</h3>
|x4= <sqf>private _detailedGunnerVisionMode = _tank currentVisionMode [0];</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
|x5= <sqf>private _detailedWeaponVisionMode = player currentVisionMode "";</sqf>


[[Category:Arma 2: Operation Arrowhead: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
|seealso= [[disableNVGEquipment]] [[disableTIEquipment]] [[camUseNVG]] [[setCamUseTI]] [[currentMagazine]] [[currentWeapon]] [[currentMuzzle]] [[currentWeaponMode]] [[currentZeroing]] [[magazinesTurret]] [[weaponsTurret]] 
{{GameCategory|arma2|Scripting Commands}}
}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
{{Note
<dl class="command_description">
|user= AgentRev
<dd class="notedate">Posted on April 29, 2016 - 21:31 (UTC)</dd>
|timestamp= 20160429213100
<dt class="note">[[User:AgentRevolution|AgentRev]]</dt>
|text= {{Feature|obsolete||arma3|2.08}}
<dd class="note">
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...
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...
</dd>
}}
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 16:19, 16 December 2022

Hover & click on the images for description

Description

Description:
Returns current vision mode of unit's weapon. Vision mode could be one of:
  • 0 - normal vision
  • 1 - night vision
  • 2 - thermal vision
Alternative syntaxes additionally return FLIR index (see setCamUseTI) of the thermal vision mode (See also "VisionModeChanged" entity event handler)
Groups:
Weapons

Syntax 1

Syntax:
currentVisionMode entity
Parameters:
entity: Object - unit or vehicle. Unit query returns current vision mode of the unit. Vehicle query returns driver seat vision mode
Return Value:
Number - vision mode

Syntax 2

Syntax:
currentVisionMode [entity]
Parameters:
entity: Object - unit or vehicle. Unit query returns current vision mode of the unit. Vehicle query returns driver seat vision mode
Return Value:
Array in format [vision mode, FLIR index]

Syntax 3

Syntax:
vehicle currentVisionMode turretPath
Parameters:
vehicle: Object - vehicle with vision modes
turretPath: Array format Turret Path - path to vehicle's turret. Use [-1] for driver turret, [] for default primary gunner turret
Return Value:
Array in format [vision mode, FLIR index]

Syntax 4

Syntax:
unit currentVisionMode weapon
Parameters:
unit: Object - soldier
weapon: String - unit's weapon. Use "" for current weapon
Return Value:
Array in format [vision mode, FLIR index]

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 "";

Additional Information

See also:
disableNVGEquipment disableTIEquipment camUseNVG setCamUseTI currentMagazine currentWeapon currentMuzzle currentWeaponMode currentZeroing magazinesTurret weaponsTurret

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
AgentRev - c
Posted on Apr 29, 2016 - 21:31 (UTC)
🕖
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...