fireAtTarget: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (updated an old note wit date)
m (see also)
Line 24: Line 24:
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[fire]], [[laserTarget]] |= See also
| [[fire]], [[laserTarget]], [[forceWeaponFire]], [[doFire]], [[commandFire]], [[aimedAtTarget]] |= See also


}}
}}
Line 36: Line 36:
<dd class="notedate">Posted on Apr 8, 2014 - 16:50
<dd class="notedate">Posted on Apr 8, 2014 - 16:50
<dt class="note">'''[[User:ffur2007slx2_5|ffur2007slx2_5]]'''<dd class="note">
<dt class="note">'''[[User:ffur2007slx2_5|ffur2007slx2_5]]'''<dd class="note">
In ArmA3 ver 1.14 Source vehicle is only limited to manned vehicle while any other types won’t be able to active [[fireAtTarget]] handler, e.g.
In ArmA3 ver 1.14 Source vehicle is only limited to manned vehicle while any other types won’t be able to active [[fireAtTarget]] handle, e.g.
<code>
<code>
_handler = _InfantryUnit fireAtTarget [_Infnatrytarget,(weapons _Infantryunit select 0)];  
_handle = _InfantryUnit fireAtTarget [_Infnatrytarget,(weapons _Infantryunit select 0)];  
//false & no bullet shoot
//false & no bullet shoot
</code>
</code>
Target has no limitation and can be any object, e.g.
Target has no limitation and can be any object, e.g.
<code>
<code>
_handler = (vehicle _veh) fireAtTarget [ObjNull,(weapons (vehicle _veh) select 0)];  
_handle = (vehicle _veh) fireAtTarget [ObjNull,(weapons (vehicle _veh) select 0)];  
//true & a bullet shoot
//true & a bullet shoot
</code>
</code>
Handler returns false if weapon class name is inaccurate, e.g.
Handle returns false if weapon class name is inaccurate, e.g.
<code>
<code>
_Handle = (vehicle _veh) fireAtTarget [ObjNull,”UnknownWeapon”];
_Handle = (vehicle _veh) fireAtTarget [ObjNull,”UnknownWeapon”];
//false & no bullet shoot.
//false & no bullet shoot.
</code>
</code>
Handler still returns true even though the vehicle is unavailable to shoot any bullet, e.g.
Handle still returns true even though the vehicle is unavailable to shoot any bullet, e.g.
<code>
<code>
_weapon = weapons (vehicle _veh) select 0;
_weapon = weapons (vehicle _veh) select 0;

Revision as of 10:13, 8 April 2014

Hover & click on the images for description

Description

Description:
Remotely forces a unit to fire the given weapon.
Groups:
Uncategorised

Syntax

Syntax:
Script = sourceVehicle fireAtTarget [targetVehicle,weaponClassName]
Parameters:
sourceVehicle: Object - source vehicle to fire from
targetVehicle: Object - target vehicle to fire at
WeaponClassName: String - weapon classname, optional parameter
Return Value:
Script - script handle, which can be used to determine (via scriptDone) when the called script has finished.

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];

Additional Information

See also:
firelaserTargetforceWeaponFiredoFirecommandFireaimedAtTarget

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

Posted on Sep 16, 2010 - 08:17
Dwarden
Most likely only for missiles and for interaction with player only.
Posted on Apr 8, 2014 - 16:50
ffur2007slx2_5
In ArmA3 ver 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 [_Infnatrytarget,(weapons _Infantryunit select 0)]; //false & no bullet shoot Target has no limitation and can be any object, e.g. _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, e.g. _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
fire Unit only N/A Fired aiming at air
fireAtTarget Manned vehicle only Any object Normal shoot, won’t aim at target automatically
forceWeaponFire Unit only N/A Normal shoot, can change fire mode
doFire Unit only Either unit or vehicle automatic aiming and shooting
commandFire Unit only Either unit or vehicle automatic aiming and shooting
action [“useweapon”] Either unit or vehicle N/A unexpected behavior

Bottom Section