Introduced in

Version:1.68

Description

Description:Forces a unit to fire the given weapon.

The unit needs to be equipped with the respective weapon and ammunition, in order to fire. Also, disableGunnerInput and (if used) setWeaponSafety need to be disabled, in order for the command to work properly.

Note: The command is not available in V2.0+. It is reintroduced in V3.4.3.

Syntax

Syntax:vehicle turretFire [weapon, turretPath, numberOfRounds, requiredGunner]
Parameters:
  • vehicle: Object - The vehicle that is supposed to fire.
  • weapon: String - The class name of the weapon to fire.

    Some weapons have advanced muzzle configurations, in which case, the command does not work with the default weapon name. For example, the BMP-2 has a 30mm cannon with a class name of "VBS2_2A42_30mm", but the actual weapon parameter you need to use is "muzzle_AP" or "muzzle_HE". You can get the weapon string by using the muzzles command (for instance: Tank01 turretFire [(muzzles [Tank01, [0]) select 0, [0], 5, false]).


  • turretPath: Array - The turret path of the specified weapon.
  • numberOfRounds: Number - The number of rounds to fire (there are normal reloading delays between rounds). A value of -1 causes the vehicle to fire until it goes out of
  • requiredGunner: Boolean - If set to false, it is possible to fire the vehicle weapon without the gunner being present in the related turret (V17.3.0+) (optional, default: true).
Return Value:Nothing

Examples

Examples:M1A1 points turret to the right, and fires two shots.
(gunner tank1) disableGunnerInput true;
tank1 setWeaponDirection [[0],[45,0]];
[tank1,[0]] setWeaponSafety false;
waitUntil {round (tank1 turretAzimuth [0])==45};
tank1 turretFire ["vbs2_m256_120mm",[0],2];

Additional Information

See also: doFire, commandFire, playerForceFire, fire, createShot
Multiplayer:
Problems:

Notes