TeRp
You must use switchCamera in order to remote control a unit.
You can only remoteControl characters, e.g. if yo want to remote control a car, you have to add a driver and use
player remoteControl driver someVehicle
Results appear below as you type; use the arrow keys to move through them.
Command · Markdown · JSON · original wiki page
Switches on remote control of the unit. The command was Global argument prior to Arma 3 v2.14). For more info see Remote Control Tutorial.
If the drone is remote it will get transferred to the player's PC.
Note
See also remoteControlled, isRemoteControlling, and Example 4 for a getter workaround for earlier game versions.
Warning
Always use switchCamera first (when needed) before using remoteControl as doing it after may lead to unpredictable results.
who remoteControl whom
Parameters:
Returns: Nothing
Set player remote control of driver:
driver UAV switchCamera "Internal"; // switchCamera required
player remoteControl driver UAV;
// sometimes switchCamera is not needed
player remoteControl driver UAV;
Return control to player:
Important
This method will not work if unit is dead, use the method in Example 3 instead
objNull remoteControl driver UAV;
Arma 3 v2.14 Return control to player:
player remoteControl objNull;
A dirty hack to return controlling unit because of the absence of dedicated getter:
SQF_fnc_remoteControlledBy =
{
params ["_obj"];
if (!isNull objectParent _obj) exitWith { UAVControl _obj select 0 };
private _res = [objNull];
isNil
{
private _pos = getPosWorld _obj;
private _dirUp = [vectorDirVisual _obj, vectorUpVisual _obj];
private _anim = animationState _obj;
private _dummy = "PaperCar" createVehicleLocal [0,0,0];
_obj moveInAny _dummy;
_res = uavControl _dummy;
_obj setPosWorld _pos;
_obj setVectorDirAndUp _dirUp;
_obj switchMove _anim;
deleteVehicle _dummy;
};
_res select 0
};
Usage (could be scheduled or unscheduled):
0 spawn
{
player remoteControl bob;
systemChat str (bob call SQF_fnc_remoteControlledBy); // B Alpha 1-1:1 (KK)
objNull remoteControl bob;
systemChat str (bob call SQF_fnc_remoteControlledBy); // <NULL-object>
};
switchCamera · selectPlayer · UAVControl · remoteControlled · isRemoteControlling · cameraOn · focusOn
You must use switchCamera in order to remote control a unit.
You can only remoteControl characters, e.g. if yo want to remote control a car, you have to add a driver and use
player remoteControl driver someVehicle
Arma 2 v1.05:
player remoteControl driver jeep1; // will remoteControl it, you still will have full control of the player
jeep1 switchCamera "internal"; // fix the camera to the vehicle and not to driver jeep1!
waitUntil { !(alive jeep1) || !(alive player) };
objNull remoteControl driver jeep1; // removes the remoteControlling
player switchCamera "internal"; // returns to the player
Far and away the easiest way to check the unit remote controlling an AI through Zeus' Remote Control module is using BIS_fnc_moduleRemoteControl_owner This will return the unit in question which you can then run name on to find the controller's name.
private _name = "-";
_who = _unit getVariable ["BIS_fnc_moduleRemoteControl_owner", objNull];
if (!isNull _who) then
{
_name = name _who;
};