compatibleWeapons

From Bohemia Interactive Community
Revision as of 21:49, 8 December 2025 by Killzone Kid (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Hover & click on the images for description

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"],...]

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