Most likely only for missiles and for interaction with player only.
Description
Remotely forces a unit to fire the given weapon. See also BIS_fnc_fire.
Syntax
sourceVehicle fireAtTarget [targetVehicle, weaponMuzzleName]
Parameters:
sourceVehicle: Object - source vehicle to fire fromtargetVehicle: Object - target vehicle to fire atweaponMuzzleName: String - (Optional) weapon muzzle classname, optional parameter
Returns: Boolean - true if fired, false if not
Examples
Example 1
_handle = this fireAtTarget [groundtarget1, "HellfireLauncher"];
Example 2
_handle = Igla_AA_pod_TK_EP1 fireAtTarget [_helicopter, currentWeapon Igla_AA_pod_TK_EP1];
Example 3
_handle = Igla_AA_pod_TK_EP1 fireAtTarget [helicopter];
See also
fire · doFire · commandFire · canFire · forceWeaponFire · commandArtilleryFire · commandSuppressiveFire · doArtilleryFire · doSuppressiveFire · isManualFire · aimedAtTarget · BIS_fnc_fire
Community notes
(Arma 3 1.14) Source vehicle is only limited to manned vehicle while any other types won’t be able to active fireAtTarget handle, e.g.
_handle = _infantryUnit fireAtTarget [_infantryTarget, weapons _infantryUnit select 0];
// false & no bullet shoot
Target has no limitation and can be any object:
_handle = (vehicle _veh) fireAtTarget [objNull, weapons (vehicle _veh) select 0];
// true & a bullet shoot
Handle returns false if weapon class name is inaccurate, e.g.
_handle = (vehicle _veh) fireAtTarget [ObjNull, "UnknownWeapon"];
// false & no bullet shoot
Handle still returns true even though the vehicle is unavailable to shoot any bullet:
_weapon = weapons (vehicle _veh) select 0;
(vehicle _veh) setAmmo [_weapon, 0];
_handle = (vehicle _veh) fireAtTarget [objNull, _weapon];
// true & no bullet shoot
Difference
| command | Source | Target | Behavior | Workaround templets |
|---|---|---|---|---|
| fire | Either unit or manned vehicle | N/A | Fired aiming at air for infantry rifle | Together with selectWeapon, suggested to work with "throw","put" weapon type for infantry, or vehicle entity indeed. |
| fireAtTarget | Manned vehicle only | Any object | Normal shoot, won’t aim at target automatically | sqf |
| forceWeaponFire | Either unit or manned aircraft (weapon operator) | N/A | Normal shoot, can change fire mode | sqf |
| doFire | Unit only | Either unit or vehicle | automatic aiming and shooting | No special example. |
| commandFire | Unit only | Either unit or vehicle | automatic aiming and shooting | No special example. |
| [action "UseWeapon"] | Either unit or manned vehicle | N/A | unexpected behavior | N/A |