forceWeaponFire: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (forceWeaponFire support all types of weapons on aircraft.)
m (if passed mode is "this", use the weapon name instead.)
Line 55: Line 55:
<dd class="notedate">Posted on Apr 14, 2014
<dd class="notedate">Posted on Apr 14, 2014
<dt class="note">'''[[User:ffur2007slx2_5|ffur2007slx2_5]]'''
<dt class="note">'''[[User:ffur2007slx2_5|ffur2007slx2_5]]'''
<dd class="note">In ArmA3 ver 1.16 [[forceWeaponFire]] is no longer only limited to units, but can remote air crafts weapon firing as well. Passed source unit should be the correct one who controls the weapon. E.g.
<dd class="note">In ArmA3 ver 1.16 [[forceWeaponFire]] is no longer only limited to units, but can remote aircrafts weapon firing as well. Passed source unit should be the correct one who controls the weapon, if passed mode is "this", use the weapon name instead. E.g.
<code>
<code>
_weapon = (weapons _veh) select 3;
_weapon = (weapons _veh) select 3;

Revision as of 16:17, 14 April 2014

Hover & click on the images for description

Description

Description:
The unit will be forced to fire from the given weapon. The weapon will not fire if firemode passed as parameter is not supported by the weapon. Command must be executed where unit is local.
Groups:
Uncategorised

Syntax

Syntax:
unit forceWeaponFire [weapon, firemode]
Parameters:
unit: Object
[weapon, firemode]: Array
weapon: String
firemode: String - Possible options are "Single", "Burst" and "FullAuto".
Return Value:
Nothing

Examples

Example 1:
soldierOne forceWeaponFire ["arifle_MX_F", "Single"];
Example 2:
_unit forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"]; _unit forceWeaponFire ["MiniGrenadeMuzzle","MiniGrenadeMuzzle"]; _unit forceWeaponFire ["HandGrenade_Stone","HandGrenade_Stone"]; _unit forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"]; _unit forceWeaponFire ["ChemlightGreenMuzzle","ChemlightGreenMuzzle"]; _unit forceWeaponFire ["IRGrenade","IRGrenade"];

Additional Information

See also:
currentWeaponcurrentWeaponModefiresetWeaponReloadingTimeselectWeapondoFirecommandFirefireAtTarget

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 August 25, 2013
Killzone_Kid
Here is a neat workaround trick for firemode change from a script: _weapon = currentWeapon player; _ammo = player ammo _weapon; player setAmmo [_weapon, 0]; player forceWeaponFire [_weapon, "FullAuto"]; player setAmmo [_weapon, _ammo];
Posted on Apr 14, 2014
ffur2007slx2_5
In ArmA3 ver 1.16 forceWeaponFire is no longer only limited to units, but can remote aircrafts weapon firing as well. Passed source unit should be the correct one who controls the weapon, if passed mode is "this", use the weapon name instead. E.g. _weapon = (weapons _veh) select 3; _mode = (getarray (configfile >> "cfgweapons" >> _weapon >> "modes")) select 0; if (_mode == "this") then {_mode = _weapon;}; (driver _veh) forceWeaponFire [_weapon, _mode]; //Force a CAS fire a rocket. Currently this command is not available for land vehicle remote fire.

Bottom Section