remoteControl: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
Line 1: Line 1:
{{Command|= Comments
{{Command|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma2 |= Game name
| arma2 |Game name=


|1.00|= Game version
|1.00|Game version=
|eff= global|= Effects in MP
 
|arg= local|= Arguments in MP
|eff= global|Effects in MP=
 
|arg= local|Arguments in MP=
____________________________________________________________________________________________
____________________________________________________________________________________________


| Switches on remote control of the unit. Command needs to be executed locally to the player. If driver is remote it will get transferred to players PC. There is currently no getter command for remote control, but it is possible to use a trick described in Example 3. |DESCRIPTION=
| Switches on remote control of the unit. Command needs to be executed locally to the player.
If driver is remote it will get transferred to players PC.
There is currently no getter command for remote control, but it is possible to use a trick described in Example 3. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| who '''remoteControl''' whom |SYNTAX=
| who [[remoteControl]] whom |SYNTAX=


|p1= who: [[Object]] - controlling unit |PARAMETER1=  
|p1= who: [[Object]] - controlling unit |PARAMETER1=


|p2= whom: [[Object]] - controlled unit |PARAMETER2=
|p2= whom: [[Object]] - controlled unit |PARAMETER2=
 
|p3= |PARAMETER3=  


| [[Nothing]] |RETURNVALUE=  
| [[Nothing]] |RETURNVALUE=  


 
|x1= Set player remote control of driver:
|x1= Set player remote control of driver:<code>[[player]] [[remoteControl]] [[driver]] UAV;
<code>[[player]] [[remoteControl]] [[driver]] UAV;
[[driver]] UAV [[switchCamera]] "Internal"; //switchCamera required
[[driver]] UAV [[switchCamera]] "Internal"; {{codecomment|// switchCamera required}}
//sometimes switchCamera is not needed
{{codecomment|//sometimes switchCamera is not needed}}
[[player]] [[remoteControl]] [[driver]] UAV;
[[player]] [[remoteControl]] [[driver]] UAV;
</code>|EXAMPLE1=  
</code> |EXAMPLE1=


|x2= Return control to player:<code>[[objNull]] [[remoteControl]] [[driver]] UAV;</code>|EXAMPLE1=  
|x2= Return control to player: <code>[[objNull]] [[remoteControl]] [[driver]] UAV;</code>|EXAMPLE2=  


|x3= A dirty hack to return controlling unit because of the absence of dedicated getter:
|x3= A dirty hack to return controlling unit because of the absence of dedicated getter:
<code>SQF_fnc_remoteControlledBy =  
<code>SQF_fnc_remoteControlledBy =
{
{
[[params]] ["_obj"];
[[params]] ["_obj"];
Line 56: Line 58:
{
{
[[player]] [[remoteControl]] bob;
[[player]] [[remoteControl]] bob;
[[systemChat]] [[str]] (bob [[call]] SQF_fnc_remoteControlledBy); // B Alpha 1-1:1 (KK)
[[systemChat]] [[str]] (bob [[call]] SQF_fnc_remoteControlledBy); {{codecomment|// B Alpha 1-1:1 (KK)}}
[[objNull]] [[remoteControl]] bob;
[[objNull]] [[remoteControl]] bob;
[[systemChat]] [[str]] (bob [[call]] SQF_fnc_remoteControlledBy); // <NULL-object>
[[systemChat]] [[str]] (bob [[call]] SQF_fnc_remoteControlledBy); {{codecomment|// <NULL-object>}}
};</code>|EXAMPLE3=
};</code>|EXAMPLE3=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[switchCamera]], [[selectPlayer]], [[UAVControl]]  |SEEALSO=  
| [[switchCamera]], [[selectPlayer]], [[UAVControl]]  |SEEALSO=


| |MPBEHAVIOUR=  
| |MPBEHAVIOUR=
____________________________________________________________________________________________
}}
}}


Line 71: Line 72:
<dl class='command_description'>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dt class="note">'''[[User:TeRp|TeRp]]'''
<dt class="note">[[User:TeRp|TeRp]]
<dd class="note">
<dd class="note">
You must use switchCamera in order to remote control the unit and.<br />
You must use switchCamera in order to remote control the unit and.<br />
Line 80: Line 81:


<dd class="notedate">Posted on Jan 25, 2010 - 14:35 (CEST)
<dd class="notedate">Posted on Jan 25, 2010 - 14:35 (CEST)
<dt class="note">'''[[User:Lou Montana|Lou Montana]]'''
<dt class="note">[[User:Lou Montana|Lou Montana]]
<dd class="note">'''Arma 1.05''' :
<dd class="note">'''Arma 1.05''' :
*You can remoteControl multiple units at the same time.
* You can remoteControl multiple units at the same time.
*It is not needed to [[switchCamera]] to the unit to be able to control it - it is needed to be able to fire with.
* It is not needed to [[switchCamera]] to the unit to be able to control it - it is needed to be able to fire with.
*The switchCamera is fixed : the player can't change internal/external/optics view.
* The switchCamera is fixed : the player can't change internal/external/optics view.
*Do not think about it like a [[selectPlayer]] : it is used to give the control to '''the vehicle role the unit is in'''.
* Do not think about it like a [[selectPlayer]] : it is used to give the control to '''the vehicle role the unit is in'''.
*SwitchCamera to the '''vehicle''' the unit is in ; the camera will go depending the role you are remoteControlling.
* SwitchCamera to the '''vehicle''' the unit is in ; the camera will go depending the role you are remoteControlling.
*The AI driver won't follow your vehicle move orders.
* The AI driver won't follow your vehicle move orders.
*If the player dies, the death screen will appear, not automatically turning back to the player.
* If the player dies, the death screen will appear, not automatically turning back to the player.
*If you want to stop the remote control, use objNull as remote controller.
* If you want to stop the remote control, use objNull as remote controller.
*Example :
* Example :
<pre>
<code>[[player]] [[remoteControl [[driver]] jeep1; {{codecomment|// will remoteControl it, you still will have full control of the player}}
player remoteControl driver jeep1; // will remoteControl it, you still will have full control of the player
jeep1 [[switchCamera]] "internal"; {{codecomment|// fix the camera to the ''vehicle'' and not to (driver jeep1) !}}
jeep1 switchCamera "internal"; // fix the camera to the ''vehicle'' and not to (driver jeep1) !
[[waitUntil]] { !([[alive]] jeep1) || !([[alive]] [[player]]) };
waitUntil { !(alive jeep1) || !(alive player) };
[[objNull]] [[remoteControl]] [[driver]] jeep1; {{codecomment|// removes the remoteControlling}}
objNull remoteControl driver jeep1; // removes the remoteControlling
[[player]] [[switchCamera]] "internal"; {{codecomment|// returns to the player}}</code>
player switchCamera "internal"; // returns to the player
</pre>


<!-- Note Section END -->
<!-- Note Section END -->
Line 108: Line 107:
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Command Group: Remote Control]]

Revision as of 20:38, 7 April 2019

Hover & click on the images for description

Description

Description:
Switches on remote control of the unit. Command needs to be executed locally to the player. If driver is remote it will get transferred to players PC. There is currently no getter command for remote control, but it is possible to use a trick described in Example 3.
Groups:
Uncategorised

Syntax

Syntax:
who remoteControl whom
Parameters:
who: Object - controlling unit
whom: Object - controlled unit
Return Value:
Nothing

Examples

Example 1:
Set player remote control of driver: player remoteControl driver UAV; driver UAV switchCamera "Internal"; // switchCamera required //sometimes switchCamera is not needed player remoteControl driver UAV;
Example 2:
Return control to player: objNull remoteControl driver UAV;
Example 3:
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): [] 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> };

Additional Information

See also:
switchCameraselectPlayerUAVControl

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

Notes

TeRp
You must use switchCamera in order to remote control the unit and.
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".
Posted on Jan 25, 2010 - 14:35 (CEST)
Lou Montana
Arma 1.05 :
  • You can remoteControl multiple units at the same time.
  • It is not needed to switchCamera to the unit to be able to control it - it is needed to be able to fire with.
  • The switchCamera is fixed : the player can't change internal/external/optics view.
  • Do not think about it like a selectPlayer : it is used to give the control to the vehicle role the unit is in.
  • SwitchCamera to the vehicle the unit is in ; the camera will go depending the role you are remoteControlling.
  • The AI driver won't follow your vehicle move orders.
  • If the player dies, the death screen will appear, not automatically turning back to the player.
  • If you want to stop the remote control, use objNull as remote controller.
  • Example :
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

Bottom Section