Applies the direction of a master vehicle (driver or turret) to a slave turret.
Note: The vehicle of the slave turret does not have to be crewed.
|Syntax:||[master, source] setTurretMaster [slave, turret, freeLook, priority]|
- master: Object - Vehicle whose direction should be matched (empty to cancel matching).
- source: String or Array - Position in master vehicle to match. Either "driver" or a turret path. If
source is a turret, or the
freeLook option is enabled, then the vertical direction is matched as well (within the limitations of the slave turret) (empty to cancel matching).
- slave: Object - Vehicle (with turret) that should match the
- turret: Array - Turret to which apply the
- freeLook: Boolean - If true, then the
source free-look direction is used.
- priority: Number - If multiple sources are defined, then the one with the highest priority is used (optional, default: 0).
Apply the direction of tank1 driver to that of its main turret:
[tank1,"driver"] setTurretMaster [tank1,,false];
Apply the view direction of tank1's main turret to that of tank2:
[tank1,] setTurretMaster [tank2,,true];
Reset tank2's direction matching:
 setTurretMaster [tank2,];
|See also:|| getTurretMaster, turretWeaponDirection, setOpticsDirection, changeTurretDirection |
source is set to "driver", then no matter what the
freeLook option is set to, the slave follows the player view.
source is set to "driver", then the command only interprets the initial vehicle assignment, but if positions change, this is not taken into consideration.
source is the driver of a vehicle (occupied by a player), and the player then opens the RTE, the editor view is matched by the slave turret.
master direction is interpreted differently, depending on whether it is a driver or a turret.
For a driver, the vehicle absolute direction is used (for example, a car points at 270 degrees, then the
slave turret points at 270 degrees as well).
For a turret, the direction is relative to its vehicle (for example, a vehicle and turret pointing at 270 degrees translates into a slave turret direction of 0 degrees, or vehicle pointing at 270 degrees, and the turret pointing at 315 degrees causes the slave turret to point at 45 degrees).