forceWeaponFire: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "{{Command " to "{{RV|type=command ") |
Lou Montana (talk | contribs) m (Text replacement - "<dd class="notedate">Posted on ([^<>]+) " to "<dd class="notedate">Posted on $1</dd> ") |
||
Line 45: | Line 45: | ||
<!-- Note Section BEGIN --> | <!-- Note Section BEGIN --> | ||
<dd class="notedate">Posted on August 25, 2013 | <dd class="notedate">Posted on August 25, 2013</dd> | ||
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]] | <dt class="note">[[User:Killzone_Kid|Killzone_Kid]] | ||
<dd class="note">Here is a neat workaround trick for firemode change from a script: | <dd class="note">Here is a neat workaround trick for firemode change from a script: | ||
Line 53: | Line 53: | ||
[[player]] [[forceWeaponFire]] [_weapon, "FullAuto"]; | [[player]] [[forceWeaponFire]] [_weapon, "FullAuto"]; | ||
[[player]] [[setAmmo]] [_weapon, _ammo];</code> | [[player]] [[setAmmo]] [_weapon, _ammo];</code> | ||
<dd class="notedate">Posted on April 14, 2014 | <dd class="notedate">Posted on April 14, 2014</dd> | ||
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]] | <dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]] | ||
<dd class="note">(A3 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: | <dd class="note">(A3 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: | ||
Line 64: | Line 64: | ||
Currently this command is not available for land vehicle remote fire. | Currently this command is not available for land vehicle remote fire. | ||
<dd class="notedate">Posted on September 02, 2014 | <dd class="notedate">Posted on September 02, 2014</dd> | ||
<dt class="note">[[User:Benargee|Benargee]] | <dt class="note">[[User:Benargee|Benargee]] | ||
<dd class="note"> | <dd class="note"> |
Revision as of 01:03, 30 January 2021
Description
- Description:
- Description needed
- Groups:
- Unit ControlWeapons
Syntax
- Syntax:
- Syntax needed
- Parameters:
- unit: Object - unit alone or in vehicle
- muzzle: String
- firemode: String - Common options are "Single", "Burst", "FullAuto". For the full list of a weapon firemodes:
hint str (getArray (configFile >> "CfgWeapons" >> currentWeapon player >> "modes"));
If modes[] param in config for the weapon says {"this"}, then the same classname as for the weapon param (currentWeapon player) should be used as firemode param. - Return Value:
- Return value needed
Examples
- Example 1:
_unit forceWeaponFire ["arifle_MX_F", "Single"]; _unit forceWeaponFire ["hgun_ACPC2_F", "hgun_ACPC2_F"]; _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"]; _unit forceWeaponFire ["Laserdesignator","Laserdesignator"];
- Example 2:
gunner blackfoot forceWeaponFire ["gatling_20mm", "close"];
Additional Information
- See also:
- See also needed
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
- 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 April 14, 2014
- ffur2007slx2_5
- (A3 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:
_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. - Posted on September 02, 2014
- Benargee
-
Similar to Killzone Kid's note, This fires the units current weapon in its current firemode.
_unit forceWeaponFire [weaponState _unit select 1, weaponState _unit select 2];
- Posted on January 3, 2015 - 14:55 (UTC)
- Killzone Kid
-
fireAtTarget command can be used to force fire gunner weapon in vehicles. A gunner must be present.
_veh fireAtTarget [objNull];
Will fire one shot even if player is gunner. fire command can also be used to fire vehicle weapon, like smoke launcher for example:vehicle player fire "SmokeLauncher";
And if this doesn't work, it is possible to force fire via actiontank action ["UseWeapon", tank, commander tank, 0];