compatibleWeapons: Difference between revisions

From Bohemia Interactive Community
(Created page with "{{RV|type=command |game1= arma3 |version1= 2.22 |descr= Returns all compatible weapons for given weapon item, weapon magazine or weapon slot. |gr1= Weapons |s1= compatibleWeapons name |p1= name: String - weapon item (see compatibleItems), weapon magazine (see compatibleMagazines) or weapon slot (defined under '''WeaponSlotsInfo''' class in weapon config), for example: * "CowsSlot" for optics * "MuzzleSlot" for silencers * "PointerSlot" for laser p...")
 
m (Add devBranch)
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
|version1= 2.22
|version1= 2.22


|branch= dev


|descr= Returns all compatible weapons for given weapon item, weapon magazine or weapon slot.
|descr= Returns all compatible weapons for given weapon item, weapon magazine or weapon slot.
Line 22: Line 23:
* [weapon, slot] - for weapon slot
* [weapon, slot] - for weapon slot


|x1= <sqf>
|x1= <sqf>compatibleWeapons "LaserBatteries"; // [["Laserdesignator_pilotCamera","this"],["Laserdesignator_mounted","this"],...]</sqf>
compatibleWeapons "LaserBatteries"; // [["Laserdesignator_pilotCamera","this"],["Laserdesignator_mounted","this"],...]
</sqf>


|x2= <sqf>
|x2= <sqf>compatibleWeapons "PointerSlot"; // [["arifle_MX_ACO_pointer_F","PointerSlot"],["arifle_TRG21_F","PointerSlot"],...]</sqf>
compatibleWeapons "PointerSlot"; // [["arifle_MX_ACO_pointer_F","PointerSlot"],["arifle_TRG21_F","PointerSlot"],...]
 
</sqf>
|x3= <sqf>compatibleWeapons "1Rnd_HE_Grenade_shell"; // [["arifle_Katiba_GL_F","EGLM"],["arifle_Katiba_GL_ACO_F","EGLM"],...]</sqf>
 
|x4= <sqf>compatibleWeapons "bipod_01_F_blk"; // [["arifle_MX_ACO_pointer_F","UnderBarrelSlot"],["arifle_MX_F","UnderBarrelSlot"],...]</sqf>


|seealso= [[compatibleItems]] [[compatibleMagazines]] [[BIS_fnc_compatibleItems]] [[canAdd]]
|seealso= [[compatibleItems]] [[compatibleMagazines]] [[BIS_fnc_compatibleItems]] [[canAdd]]
}}
}}

Latest revision as of 15:24, 9 December 2025

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.22.

Description

Description:
Returns all compatible weapons for given weapon item, weapon magazine or weapon slot.
Groups:
Weapons

Syntax

Syntax:
compatibleWeapons name
Parameters:
name: String - weapon item (see compatibleItems), weapon magazine (see compatibleMagazines) or weapon slot (defined under WeaponSlotsInfo class in weapon config), for example:
  • "CowsSlot" for optics
  • "MuzzleSlot" for silencers
  • "PointerSlot" for laser pointers and flashlights
  • "UnderBarrelSlot" for bipods
Return Value:
Array of Arrays in format:
  • [weapon, slot] - for weapon items
  • [weapon, muzzle] - for weapon magazines (primary muzzle returned as "this")
  • [weapon, slot] - for weapon slot

Examples

Example 1:
compatibleWeapons "LaserBatteries"; // [["Laserdesignator_pilotCamera","this"],["Laserdesignator_mounted","this"],...]
Example 2:
compatibleWeapons "PointerSlot"; // [["arifle_MX_ACO_pointer_F","PointerSlot"],["arifle_TRG21_F","PointerSlot"],...]
Example 3:
compatibleWeapons "1Rnd_HE_Grenade_shell"; // [["arifle_Katiba_GL_F","EGLM"],["arifle_Katiba_GL_ACO_F","EGLM"],...]
Example 4:
compatibleWeapons "bipod_01_F_blk"; // [["arifle_MX_ACO_pointer_F","UnderBarrelSlot"],["arifle_MX_F","UnderBarrelSlot"],...]

Additional Information

See also:
compatibleItems compatibleMagazines BIS_fnc_compatibleItems canAdd

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note