compatibleItems: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{RV|type=command |game1= arma3 |version1= 2.10 |arg= global |branch= dev |descr= Returns all items (attachments) that can be mounted on the given weapon. |gr1= Weapons...")
 
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *W([a-z ])" to "$1 - w$2")
 
(5 intermediate revisions by 3 users not shown)
Line 4: Line 4:
|version1= 2.10
|version1= 2.10


|arg= global
|branch= dev


|descr= Returns all items (attachments) that can be mounted on the given weapon.
|descr= Returns all items (attachments) that can be mounted on the given weapon.
Line 14: Line 11:
|s1= [[compatibleItems]] weapon
|s1= [[compatibleItems]] weapon


|p1= weapon: [[String]] - Weapon class name
|p1= weapon: [[String]] - weapon class name


|r1= [[Array]] of [[String]]s - Compatible attachments
|r1= [[Array]] of [[String]]s - compatible attachments


|s2= [[compatibleItems]] [weapon, slot]
|s2= [[compatibleItems]] [weapon, slot]


|p21= weapon: [[String]] - Weapon class name
|p21= weapon: [[String]] - weapon class name


|p22= slot: [[String]] - Class name of the slot (defined under '''WeaponSlotsInfo''' class in weapon config)
|p22= slot: [[String]] - class name of the slot (defined under '''WeaponSlotsInfo''' class in weapon config)


|r2= [[Array]] of [[String]]s - Compatible attachments
|r2= [[Array]] of [[String]]s - compatible attachments


|x1= <sqf>
|x1= <sqf>
compatibleItems "arifle_Katiba_GL_F" // ["optic_Nightstalker","optic_tws","optic_tws_mg","optic_NVS", ...]
compatibleItems "arifle_Katiba_GL_F"; // ["optic_Nightstalker","optic_tws","optic_tws_mg","optic_NVS", ...]
</sqf>
</sqf>


|x2= <sqf>
|x2= <sqf>
compatibleItems ["arifle_Katiba_GL_F", "PointerSlot"] // ["acc_flashlight","acc_flashlight_broken","acc_pointer_IR", ...]
compatibleItems ["arifle_Katiba_GL_F", "PointerSlot"]; // ["acc_flashlight","acc_flashlight_broken","acc_pointer_IR", ...]
</sqf>
</sqf>


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

Latest revision as of 17:35, 8 November 2023

Hover & click on the images for description

Description

Description:
Returns all items (attachments) that can be mounted on the given weapon.
Groups:
Weapons

Syntax

Syntax:
compatibleItems weapon
Parameters:
weapon: String - weapon class name
Return Value:
Array of Strings - compatible attachments

Alternative Syntax

Syntax:
compatibleItems [weapon, slot]
Parameters:
weapon: String - weapon class name
slot: String - class name of the slot (defined under WeaponSlotsInfo class in weapon config)
Return Value:
Array of Strings - compatible attachments

Examples

Example 1:
compatibleItems "arifle_Katiba_GL_F"; // ["optic_Nightstalker","optic_tws","optic_tws_mg","optic_NVS", ...]
Example 2:
compatibleItems ["arifle_Katiba_GL_F", "PointerSlot"]; // ["acc_flashlight","acc_flashlight_broken","acc_pointer_IR", ...]

Additional Information

See also:
compatibleMagazines BIS_fnc_compatibleItems canAdd

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