| Forces a unit to fire the given weapon. See also: [[BIS_fnc_fire]].<br/>

−

<br/>'''NOTE:''' Just like with [[forceWeaponFire]] it is possible to pass remote unit as argument, but this could be unreliable. Considering this command might need to be used in combination with [[selectWeapon]], which takes only [[local]] arguments, it would make sense to execute [[fire]] command where unit is also [[local]]. See also: [[BIS_fnc_fire]] |DESCRIPTION=

+

{{Informative | Just like with [[forceWeaponFire]] it is possible to pass remote unit as argument, but this could be unreliable. Considering this command might need to be used in combination with [[selectWeapon]], which takes only [[local]] arguments, it would make sense to execute [[fire]] command where unit is also [[local]].}} |DESCRIPTION=

<dd class="note">Sometimes AI won't shoot when you use this command. It can be fixed by placing [[selectWeapon]] command before it.

<dd class="note">Sometimes AI won't shoot when you use this command. It can be fixed by placing [[selectWeapon]] command before it.

+

<dd class="notedate">Posted on February 2, 2007

<dd class="notedate">Posted on February 2, 2007

−

<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''

+

<dt class="note">[[User:Ceeeb|Ceeeb]]

<dd class="note">

<dd class="note">

In '''OFP v1.96''', when a [[Operation_Flashpoint:_CfgVehicles#Man_Class_Vehicles|man]] class unit is given this command, he will aim up in the air before firing his weapon. This makes it rather useless if you want to make him shoot a target. It does work with vehicles, when the vehicle is first given a [[doWatch]] or [[doTarget]] command.

In '''OFP v1.96''', when a [[Operation_Flashpoint:_CfgVehicles#Man_Class_Vehicles|man]] class unit is given this command, he will aim up in the air before firing his weapon. This makes it rather useless if you want to make him shoot a target. It does work with vehicles, when the vehicle is first given a [[doWatch]] or [[doTarget]] command.

+

<dd class="notedate">Posted on January 20, 2007

<dd class="notedate">Posted on January 20, 2007

−

<dt class="note">'''[[User:Bdfy|Bdfy]]'''

+

<dt class="note">[[User:Bdfy|Bdfy]]

−

<dd class="note">In '''ArmA v1.02''', this command is not working with weapons in the secondary turrets (like "DSHKM" in t72)

+

<dd class="note">In '''ArmA v1.02''', this command is not working with weapons in the secondary turrets (like "DSHKM" in T-72)

In Arma 3 in order for AI to place Claymore, for example, it is necessary to execute 3 statements - an animation, weapon select and the actual [[fire]] command. Animation is most likely for forcing unit to leave rest state, weapon select and fire kinda both go together anyway:<br><code>_unit [[playActionNow]] "PutDown";

+

In Arma 3 in order for AI to place Claymore, for example, it is necessary to execute 3 statements - an animation, weapon select and the actual [[fire]] command. Animation is most likely for forcing unit to leave rest state, weapon select and fire kinda both go together anyway:

+

<code>_unit [[playActionNow]] "PutDown";

_unit [[selectWeapon]] "DirectionalMineRemoteMuzzle";

_unit [[selectWeapon]] "DirectionalMineRemoteMuzzle";

_unit [[fire]] [

_unit [[fire]] [

Line 111:

Line 122:

];</code>

];</code>

</dd>

</dd>

−

</dl>

−

<!-- CONTINUE Notes -->

−

<dl class="command_description">

<dd class="notedate">Posted on November 25th, 2017

<dd class="notedate">Posted on November 25th, 2017

−

<dt class="note">'''[[User:SteveStevenson|Steve]]'''

+

<dt class="note">[[User:SteveStevenson|Steve]]

<dd class="note">

<dd class="note">

−

In ArmA 3, as of version 1.76, examples 2 and 3 in the section above for smoke grenades are no longer working. As a workaround (throwing green smoke grenades for example), you can use: <br><code>[_soldier, "SmokeShellGreenMuzzle"] call BIS_fnc_fire;</code></dt>

+

In ArmA 3, as of version 1.76, examples 2 and 3 in the section above for smoke grenades are no longer working.

+

As a workaround (throwing green smoke grenades for example), you can use:

Revision as of 23:48, 4 September 2019

Description

Just like with forceWeaponFire it is possible to pass remote unit as argument, but this could be unreliable. Considering this command might need to be used in combination with selectWeapon, which takes only local arguments, it would make sense to execute fire command where unit is also local.

Notes

In OFP v1.96, when a man class unit is given this command, he will aim up in the air before firing his weapon. This makes it rather useless if you want to make him shoot a target. It does work with vehicles, when the vehicle is first given a doWatch or doTarget command.

Command is broken - confirmed. Use action "USEWEAPON" instead.
Place a game logic in the editor. Name it MyGameLogic.
Use this code to make unit1 fire his primaryweapon:
MyGameLogic action ["useWeapon", primaryWeapon unit1, unit1, 0];

Bottom Section

In Arma 3 in order for AI to place Claymore, for example, it is necessary to execute 3 statements - an animation, weapon select and the actual fire command. Animation is most likely for forcing unit to leave rest state, weapon select and fire kinda both go together anyway:
_unit playActionNow "PutDown";
_unit selectWeapon "DirectionalMineRemoteMuzzle";
_unit fire [
"DirectionalMineRemoteMuzzle",
"DirectionalMineRemoteMuzzle",
"ClaymoreDirectionalMine_Remote_Mag"
];

In ArmA 3, as of version 1.76, examples 2 and 3 in the section above for smoke grenades are no longer working.
As a workaround (throwing green smoke grenades for example), you can use:
[_soldier, "SmokeShellGreenMuzzle"] callBIS_fnc_fire;