UAVControl: Difference between revisions

From Bohemia Interactive Community
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:


|arg= global
|arg= global
|eff= local


|gr1= Remote Control
|gr1= Remote Control
Line 22: Line 21:
The UAV terminals are [[local]] to the [[player]]s so only [[local]] terminal connections are returned.
The UAV terminals are [[local]] to the [[player]]s so only [[local]] terminal connections are returned.


{{Feature|informative|This command works only for vehicles, to get a unit remote-controlling a unit, see [[remoteControlled]] and {{Link|remoteControl#Example 4}}.}}
{{Feature|informative|This command works only for vehicles, to get a unit remote-controlling a unit, see [[remoteControlled]] and {{Link|remoteControl#Example 4}}.
<br>While main syntax can only return remote players when they are controlling either pilot or gunner, the alternative syntax can also return all remote players connected with terminals to given UAV.}}


|s1= [[UAVControl]] uav
|s1= [[UAVControl]] uav
Line 36: Line 36:
** unit2: [[Object]] - see {{Link|#Example 2}}
** unit2: [[Object]] - see {{Link|#Example 2}}
** vehicleRole2: Can be "DRIVER", "GUNNER", or "". (see {{Link|#Example 2}})
** vehicleRole2: Can be "DRIVER", "GUNNER", or "". (see {{Link|#Example 2}})
|s2= [[UAVControl]] [uav, option]
|s2since= arma3 2.22
|p21= uav: [[Object]] - uav vehicle
|p22= option: [[String]] - output option, could be one of the following:
* "driver" - player controlling UAV pilot
* "gunner" - player controlling UAV gunner
* "crew" - both driver and gunner in that order
* "all" - all the players currently connected to the UAV with their terminals (dead players will show up until they are completely braindead (respawned for example))
* "allbutcrew" - same as "all" but excluding driver and pilot
* "allbutdead" - same as "all" but excluding dead players
|r2= [[Array]] - [player1], [player1, player2] or [player1, player2,...playerN]


|x1= <sqf>private _result = UAVControl _myUAV;</sqf>
|x1= <sqf>private _result = UAVControl _myUAV;</sqf>

Latest revision as of 10:56, 27 January 2026

Hover & click on the images for description

Description

Description:
Returns array with current operator of UAV and his vehicle role in UAV. If nobody is controlling the UAV, the command tries to find if player has terminal connected to this UAV. If nobody is connected, objNull is used as returned operator (see Example 2). The possible outputs are:
  • [objNull, ""] - nobody is controlling UAV but there maybe an abandoned terminal connected to the UAV, which will auto-disconnect when a new connection to the UAV is made
  • [somePlayer1, "DRIVER"] - some player (could be remote) is a pilot, the gunner seat is empty
  • [somePlayer2, "GUNNER"] - some player (could be remote) is a gunner, the pilot seat is empty
  • [somePlayer1, "DRIVER", somePlayer2, "GUNNER"] - some players (could be remote) control both the pilot and the gunner seats
  • [player, ""] - local player has terminal connected to this UAV
The UAV terminals are local to the players so only local terminal connections are returned.
This command works only for vehicles, to get a unit remote-controlling a unit, see remoteControlled and remoteControl - Example 4.
While main syntax can only return remote players when they are controlling either pilot or gunner, the alternative syntax can also return all remote players connected with terminals to given UAV.
Groups:
Remote Control

Syntax

Syntax:
UAVControl uav
Parameters:
uav: Object
Return Value:
  • Array with [unit, vehicleRole]
    • unit: Object - UAV operator
    • vehicleRole: String - vehicle role of the operator in UAV. Can be "DRIVER", "GUNNER" or "" (not in control)
  • Arma 3 logo black.png 1.96 Array with [unit, vehicleRole, unit2, vehicleRole2] (see Example 2)
    • unit: Object - UAV operator
    • vehicleRole: String - vehicle role of the operator in UAV. Can be "DRIVER", "GUNNER" or "" (not in control)
    • unit2: Object - see Example 2
    • vehicleRole2: Can be "DRIVER", "GUNNER", or "". (see Example 2)

Alternative Syntax

Syntax:
UAVControl [uav, option]
Parameters:
uav: Object - uav vehicle
option: String - output option, could be one of the following:
  • "driver" - player controlling UAV pilot
  • "gunner" - player controlling UAV gunner
  • "crew" - both driver and gunner in that order
  • "all" - all the players currently connected to the UAV with their terminals (dead players will show up until they are completely braindead (respawned for example))
  • "allbutcrew" - same as "all" but excluding driver and pilot
  • "allbutdead" - same as "all" but excluding dead players
Return Value:
Array - [player1], [player1, player2] or [player1, player2,...playerN]

Examples

Example 1:
private _result = UAVControl _myUAV;
Example 2:
Since Arma 3 logo black.png 1.96 this command returns both driver and gunner units if the UAV is controlled by 2 players. Here is the list of all expected outputs:
[player1, "DRIVER"]; // player1 is controlling the UAV and is the pilot [player2, "GUNNER"]; // player2 is controlling the UAV and is the gunner [player1, "DRIVER", player2, "GUNNER"]; // player1 is controlling the UAV as the pilot, player2 is controlling the UAV as the gunner [player3, ""]; // no one is controlling the UAV, player3 is connected to the UAV via terminal, but not controlling it yet [objNull, ""]; // nobody is controlling but there maybe an abandoned terminal connected to the UAV, // which will auto-disconnect when a new connection to the UAV is made

Additional Information

See also:
showUAVFeed shownUAVFeed allUnitsUAV getConnectedUAV connectTerminalToUAV isUAVConnected remoteControl currentPilot isRemoteControlling remoteControlled

Notes

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