BIS fnc fire: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
{{Function


| arma3 |Game name=
| arma3


|1.74|Game version=
|1.74


|gr1 = Weapons |GROUP1=
|gr1 = Weapons


|gr2 = Object Manipulation |GROUP2=
|gr2 = Object Manipulation


|gr3 = Combat |GROUP3=
|gr3 = Combat


|arg= global |Arguments in MP=
|arg= global |Arguments in MP=
Line 17: Line 17:
|  Makes a unit or a vehicle fire given muzzle. Make sure that there is some ammo to fire, and, in case of a unit, the weapon with given muzzle is already selected. It can be used to fire pretty much any muzzle on unit or vehicle from anywhere. Available weapons could usually be found with [[weapons]], [[weaponsTurret]] and [[allTurrets]] commands.
|  Makes a unit or a vehicle fire given muzzle. Make sure that there is some ammo to fire, and, in case of a unit, the weapon with given muzzle is already selected. It can be used to fire pretty much any muzzle on unit or vehicle from anywhere. Available weapons could usually be found with [[weapons]], [[weaponsTurret]] and [[allTurrets]] commands.


|mp= The function is global, it is not to be used in unit fields. |MULTIPLAYER=
|mp= The function is global, it is not to be used in unit fields.


|pr= unit will not fire its weapon from FFV position. This is due to [[forceWeaponFire]] command ignoring units in FFV. |DESCRIPTION=
|pr= unit will not fire its weapon from FFV position. This is due to [[forceWeaponFire]] command ignoring units in FFV.


| [entity, muzzle, turret] call [[BIS_fnc_fire]] |SYNTAX=
| [entity, muzzle, turret] call [[BIS_fnc_fire]]
|p1= entity: [[Object]] - unit or vehicle |PARAMETER1=
|p1= entity: [[Object]] - unit or vehicle
|p2= muzzle: [[String]] -  muzzle name of the muzzle to fire |PARAMETER2=
|p2= muzzle: [[String]] -  muzzle name of the muzzle to fire
|p3= turret (Optional): [[Array]] - turret path of the turret with given muzzle (vehicles only) |PARAMETER3=
|p3= turret (Optional): [[Array]] - turret path of the turret with given muzzle (vehicles only)


| [[Boolean]] - in SP and on hosted server in MP or [[Nothing]] on client in MP. When boolean, [[true]] if all checks have passed and muzzle should have fired, [[false]] if there was a problem, like:
| [[Boolean]] - in SP and on hosted server in MP or [[Nothing]] on client in MP. When boolean, [[true]] if all checks have passed and muzzle should have fired, [[false]] if there was a problem, like:
Line 30: Line 30:
* non-existing muzzle
* non-existing muzzle
* the muzzle is on a weapon that is not selected
* the muzzle is on a weapon that is not selected
* the weapon has no unit operating it |RETURNVALUE=
* the weapon has no unit operating it


|x1= <code>marshall = "B_APC_Wheeled_01_cannon_F" [[createVehicle]] [[position]] [[player]];
|x1= <code>marshall = "B_APC_Wheeled_01_cannon_F" [[createVehicle]] [[position]] [[player]];
Line 40: Line 40:
[marshall, "LMG_M200_body"] [[call]] [[BIS_fnc_fire]]; {{cc|fires machine gun}}
[marshall, "LMG_M200_body"] [[call]] [[BIS_fnc_fire]]; {{cc|fires machine gun}}
[marshall, "SmokeLauncher"] [[call]] [[BIS_fnc_fire]]; {{cc|fires smoke launcher}}
[marshall, "SmokeLauncher"] [[call]] [[BIS_fnc_fire]]; {{cc|fires smoke launcher}}
[marshall, "TruckHorn"] [[call]] [[BIS_fnc_fire]]; {{cc|beeps the horn}}</code> |Example1=
[marshall, "TruckHorn"] [[call]] [[BIS_fnc_fire]]; {{cc|beeps the horn}}</code>


|x2= <code>[bob, "SmokeShellMuzzle"] [[call]] [[BIS_fnc_fire]];  {{cc|bob throws smoke grenade, if he has one}}
|x2= <code>[bob, "SmokeShellMuzzle"] [[call]] [[BIS_fnc_fire]];  {{cc|bob throws smoke grenade, if he has one}}
[bob, "HandGrenadeMuzzle"] [[call]] [[BIS_fnc_fire]]; {{cc|bob throws hand grenade, if he has one}}</code> |Example2=
[bob, "HandGrenadeMuzzle"] [[call]] [[BIS_fnc_fire]]; {{cc|bob throws hand grenade, if he has one}}</code>


|x3= <code>blackfoot = "B_Heli_Attack_01_dynamicLoadout_F" [[createVehicle]] [[position]] [[player]];
|x3= <code>blackfoot = "B_Heli_Attack_01_dynamicLoadout_F" [[createVehicle]] [[position]] [[player]];
Line 51: Line 51:
[blackfoot, "missiles_ASRAAM"] [[call]] [[BIS_fnc_fire]]; {{cc|fires missiles}}
[blackfoot, "missiles_ASRAAM"] [[call]] [[BIS_fnc_fire]]; {{cc|fires missiles}}
[blackfoot, "gatling_20mm"]    [[call]] [[BIS_fnc_fire]]; {{cc|fires machine gun}}
[blackfoot, "gatling_20mm"]    [[call]] [[BIS_fnc_fire]]; {{cc|fires machine gun}}
[blackfoot, "CMFlareLauncher"] [[call]] [[BIS_fnc_fire]]; {{cc|fires chaff}}</code> |Example3=
[blackfoot, "CMFlareLauncher"] [[call]] [[BIS_fnc_fire]]; {{cc|fires chaff}}</code>


|x4= <code><nowiki>[</nowiki>[[vehicle]] mortargunner, "mortar_82mm"] [[call]] [[BIS_fnc_fire]]; // mortargunner fires mortar</code>|Example4=
|x4= <code><nowiki>[</nowiki>[[vehicle]] mortargunner, "mortar_82mm"] [[call]] [[BIS_fnc_fire]]; // mortargunner fires mortar</code>


| [[fire]], [[fireAtTarget]], [[forceWeaponFire]]|SEEALSO=
| [[fire]], [[fireAtTarget]], [[forceWeaponFire]]
}}
}}




<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>

Revision as of 23:03, 17 January 2021

Hover & click on the images for description

Description

Description:
Makes a unit or a vehicle fire given muzzle. Make sure that there is some ammo to fire, and, in case of a unit, the weapon with given muzzle is already selected. It can be used to fire pretty much any muzzle on unit or vehicle from anywhere. Available weapons could usually be found with weapons, weaponsTurret and allTurrets commands.
Execution:
call
Multiplayer:
The function is global, it is not to be used in unit fields.
Problems:
unit will not fire its weapon from FFV position. This is due to forceWeaponFire command ignoring units in FFV.
Groups:
WeaponsObject ManipulationCombat

Syntax

Syntax:
[entity, muzzle, turret] call BIS_fnc_fire
Parameters:
entity: Object - unit or vehicle
muzzle: String - muzzle name of the muzzle to fire
turret (Optional): Array - turret path of the turret with given muzzle (vehicles only)
Return Value:
Boolean - in SP and on hosted server in MP or Nothing on client in MP. When boolean, true if all checks have passed and muzzle should have fired, false if there was a problem, like:
  • no ammo
  • non-existing muzzle
  • the muzzle is on a weapon that is not selected
  • the weapon has no unit operating it

Examples

Example 1:
marshall = "B_APC_Wheeled_01_cannon_F" createVehicle position player; createVehicleCrew marshall; [marshall, "HE"] call BIS_fnc_fire; // fires HE muzzle of the main cannon [marshall, "AP"] call BIS_fnc_fire; // fires AP muzzle of the main cannon [marshall, "autocannon_40mm_CTWS"] call BIS_fnc_fire; // fires HE muzzle, because it is default [marshall, "LMG_M200_body"] call BIS_fnc_fire; // fires machine gun [marshall, "SmokeLauncher"] call BIS_fnc_fire; // fires smoke launcher [marshall, "TruckHorn"] call BIS_fnc_fire; // beeps the horn
Example 2:
[bob, "SmokeShellMuzzle"] call BIS_fnc_fire; // bob throws smoke grenade, if he has one [bob, "HandGrenadeMuzzle"] call BIS_fnc_fire; // bob throws hand grenade, if he has one
Example 3:
blackfoot = "B_Heli_Attack_01_dynamicLoadout_F" createVehicle position player; createVehicleCrew blackfoot; [blackfoot, "missiles_DAGR"] call BIS_fnc_fire; // fires missiles [blackfoot, "missiles_ASRAAM"] call BIS_fnc_fire; // fires missiles [blackfoot, "gatling_20mm"] call BIS_fnc_fire; // fires machine gun [blackfoot, "CMFlareLauncher"] call BIS_fnc_fire; // fires chaff
Example 4:
[vehicle mortargunner, "mortar_82mm"] call BIS_fnc_fire; // mortargunner fires mortar

Additional Information

See also:
firefireAtTargetforceWeaponFire

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


Bottom Section